https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: ae59514c0f12b40373ae52d356613b3ef21e4f47 authored by Lars Bilke on 22 May 2023, 19:53:06 UTC
Merge branch 'mac-petsc' into 'master'
Tip revision: ae59514
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 "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 space_dimension = getSpaceDimension(meshes[0]->getNodes());
    for (auto& mesh : meshes)
    {
        auto elements = mesh->getElements();
        for (auto element : elements)
        {
            element->space_dimension_ = space_dimension;
        }
    }
}
};  // namespace MeshLib
back to top