https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 16882ff2b3165cc906d2659668ff7bc9d216361d authored by Tom Fischer on 25 August 2023, 06:59:16 UTC
Merge branch 'FixGML' into 'master'
Tip revision: 16882ff
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