OGS
SetMeshSpaceDimension.cpp
Go to the documentation of this file.
1
13
14#include <range/v3/algorithm/for_each.hpp>
15
16#include "GetSpaceDimension.h"
18#include "MeshLib/Mesh.h"
19
20namespace MeshLib
21{
22void setMeshSpaceDimension(std::vector<std::unique_ptr<Mesh>> const& meshes)
23{
24 // Get the space dimension from the bulk mesh:
25 auto const d = getSpaceDimension(meshes[0]->getNodes());
26 for (auto const& mesh : meshes)
27 {
28 ranges::for_each(mesh->getElements(),
29 [d](Element* const e) { e->space_dimension_ = d; });
30 }
31}
32}; // namespace MeshLib
Definition of the Element class.
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)
Definition of the Mesh class.
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.