https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 3bc6e8ae82403153b57dddb981d9f52fabd3b646 authored by Lars Bilke on 29 September 2023, 10:03:44 UTC
Merge branch 'bundled-fmt' into 'master'
Tip revision: 3bc6e8a
SetMeshSpaceDimension.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2023, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 * Created on May 5, 2021, 12:46 PM
 */

#include "SetMeshSpaceDimension.h"

#include <range/v3/algorithm/for_each.hpp>

#include "GetSpaceDimension.h"
#include "MeshLib/Elements/Element.h"
#include "MeshLib/Mesh.h"

namespace MeshLib
{
void setMeshSpaceDimension(std::vector<std::unique_ptr<Mesh>> const& meshes)
{
    // Get the space dimension from the bulk mesh:
    auto const d = getSpaceDimension(meshes[0]->getNodes());
    for (auto const& mesh : meshes)
    {
        ranges::for_each(mesh->getElements(),
                         [d](Element* const e) { e->space_dimension_ = d; });
    }
}
};  // namespace MeshLib
back to top