OGS
SetMeshSpaceDimension.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <range/v3/algorithm/for_each.hpp>
7
8#include "GetSpaceDimension.h"
10#include "MeshLib/Mesh.h"
11
12namespace MeshLib
13{
14void setMeshSpaceDimension(std::vector<std::unique_ptr<Mesh>> const& meshes)
15{
16 // Get the space dimension from the bulk mesh:
17 auto const d = getSpaceDimension(meshes[0]->getNodes());
18 for (auto const& mesh : meshes)
19 {
20 ranges::for_each(mesh->getElements(),
21 [d](Element* const e) { e->space_dimension_ = d; });
22 }
23}
24}; // namespace MeshLib
std::vector< std::size_t > getNodes(GeoLib::Point const &pnt, std::vector< MeshLib::Node * > const &nodes, MeshLib::PropertyVector< int > const &mat_ids, std::pair< int, int > const &mat_limits, std::pair< double, double > const &elevation_limits, MeshLib::Mesh const &mesh)
void setMeshSpaceDimension(std::vector< std::unique_ptr< Mesh > > const &meshes)
int getSpaceDimension(std::vector< Node * > const &nodes)
Computes dimension of the embedding space containing the set of given points.