OGS
MeshLib::Mesh Class Reference

Detailed Description

A basic mesh.

Definition at line 40 of file Mesh.h.

#include <Mesh.h>

Inheritance diagram for MeshLib::Mesh:
[legend]
Collaboration diagram for MeshLib::Mesh:
[legend]

Public Member Functions

 Mesh (std::string name, std::vector< Node * > nodes, std::vector< Element * > elements, Properties const &properties=Properties())
 
 Mesh (const Mesh &mesh)
 Copy constructor. More...
 
 Mesh (Mesh &&mesh)
 
Meshoperator= (const Mesh &mesh)=delete
 
Meshoperator= (Mesh &&mesh)=delete
 
virtual ~Mesh ()
 Destructor. More...
 
void shallowClean ()
 
void addElement (Element *elem)
 Add an element to the mesh. More...
 
unsigned getDimension () const
 Returns the dimension of the mesh (determined by the maximum dimension over all elements). More...
 
const NodegetNode (std::size_t idx) const
 Get the node with the given index. More...
 
const ElementgetElement (std::size_t idx) const
 Get the element with the given index. More...
 
std::size_t getNumberOfElements () const
 Get the number of elements. More...
 
std::size_t getNumberOfNodes () const
 Get the number of nodes. More...
 
const std::string getName () const
 Get name of the mesh. More...
 
std::vector< Node * > const & getNodes () const
 Get the nodes-vector for the mesh. More...
 
std::vector< Element * > const & getElements () const
 Get the element-vector for the mesh. More...
 
void resetElementIDs ()
 Resets the IDs of all mesh-elements to their position in the element vector. More...
 
void resetNodeIDs ()
 Resets the IDs of all mesh-nodes to their position in the node vector. More...
 
void setName (const std::string &name)
 Changes the name of the mesh. More...
 
std::size_t getID () const
 Get id of the mesh. More...
 
std::size_t getNumberOfBaseNodes () const
 Get the number of base nodes. More...
 
bool hasNonlinearElement () const
 Check if the mesh contains any nonlinear element. More...
 
std::vector< Element const * > const & getElementsConnectedToNode (std::size_t node_id) const
 
std::vector< Element const * > const & getElementsConnectedToNode (Node const &node) const
 
PropertiesgetProperties ()
 
Properties const & getProperties () const
 
bool isAxiallySymmetric () const
 
void setAxiallySymmetric (bool is_axial_symmetric)
 

Protected Member Functions

void calcEdgeLengthRange ()
 Set the minimum and maximum length over the edges of the mesh. More...
 
void setDimension ()
 Sets the dimension of the mesh. More...
 
void setElementNeighbors ()
 

Protected Attributes

std::size_t const _id
 
unsigned _mesh_dimension
 
std::pair< double, double > _node_distance
 The minimal and maximal distance of nodes within an element over all elements in the mesh. More...
 
std::string _name
 
std::vector< Node * > _nodes
 
std::vector< Element * > _elements
 
Properties _properties
 
std::vector< std::vector< Element const * > > _elements_connected_to_nodes
 
bool _is_axially_symmetric = false
 

Friends

class ApplicationUtils::NodeWiseMeshPartitioner
 
void removeMeshNodes (Mesh &mesh, const std::vector< std::size_t > &nodes)
 

Constructor & Destructor Documentation

◆ Mesh() [1/3]

MeshLib::Mesh::Mesh ( std::string  name,
std::vector< Node * >  nodes,
std::vector< Element * >  elements,
Properties const &  properties = Properties() 
)

Constructor using a mesh name and an array of nodes and elements

Parameters
nameMesh name.
nodesA vector of mesh nodes.
elementsAn array of mesh elements.
propertiesMesh properties.

Definition at line 59 of file Mesh.cpp.

66  _mesh_dimension(0),
67  _node_distance(std::numeric_limits<double>::max(), 0),
68  _name(std::move(name)),
69  _nodes(std::move(nodes)),
70  _elements(std::move(elements)),
71  _properties(properties)
72 {
73  this->resetNodeIDs();
74  this->resetElementIDs();
75  this->setDimension();
76 
78 
79  this->setElementNeighbors();
80 }
static std::size_t global_mesh_counter
Mesh counter used to uniquely identify meshes by id.
Definition: Mesh.cpp:36
Properties _properties
Definition: Mesh.h:155
std::size_t const _id
Definition: Mesh.h:148
std::vector< std::vector< Element const * > > _elements_connected_to_nodes
Definition: Mesh.h:157
unsigned _mesh_dimension
Definition: Mesh.h:149
std::string _name
Definition: Mesh.h:152
void resetNodeIDs()
Resets the IDs of all mesh-nodes to their position in the node vector.
Definition: Mesh.cpp:146
std::vector< Element * > _elements
Definition: Mesh.h:154
void setDimension()
Sets the dimension of the mesh.
Definition: Mesh.cpp:164
void resetElementIDs()
Resets the IDs of all mesh-elements to their position in the element vector.
Definition: Mesh.cpp:155
void setElementNeighbors()
Definition: Mesh.cpp:191
std::pair< double, double > _node_distance
The minimal and maximal distance of nodes within an element over all elements in the mesh.
Definition: Mesh.h:151
std::vector< Node * > _nodes
Definition: Mesh.h:153
std::vector< std::vector< Element const * > > findElementsConnectedToNodes(Mesh const &mesh)
Definition: Mesh.cpp:42

References _elements_connected_to_nodes, MeshLib::findElementsConnectedToNodes(), resetElementIDs(), resetNodeIDs(), setDimension(), and setElementNeighbors().

◆ Mesh() [2/3]

MeshLib::Mesh::Mesh ( const Mesh mesh)

Copy constructor.

Definition at line 82 of file Mesh.cpp.

84  _mesh_dimension(mesh.getDimension()),
85  _node_distance(mesh._node_distance.first, mesh._node_distance.second),
86  _name(mesh.getName()),
87  _nodes(mesh.getNumberOfNodes()),
88  _elements(mesh.getNumberOfElements()),
89  _properties(mesh._properties)
90 {
91  const std::vector<Node*>& nodes(mesh.getNodes());
92  const std::size_t nNodes(nodes.size());
93  for (unsigned i = 0; i < nNodes; ++i)
94  {
95  _nodes[i] = new Node(*nodes[i]);
96  }
97 
98  const std::vector<Element*>& elements(mesh.getElements());
99  const std::size_t nElements(elements.size());
100  for (unsigned i = 0; i < nElements; ++i)
101  {
102  _elements[i] = elements[i]->clone();
103  for (auto const& [j, node_id] :
104  elements[i]->nodes() | views::ids | ranges::views::enumerate)
105  {
106  _elements[i]->setNode(static_cast<unsigned>(j), _nodes[node_id]);
107  }
108  }
109 
110  if (_mesh_dimension == 0)
111  {
112  this->setDimension();
113  }
115  this->setElementNeighbors();
116 }
constexpr ranges::views::view_closure ids
For an element of a range view return its id.
Definition: Mesh.h:314

References _elements, _elements_connected_to_nodes, _mesh_dimension, _nodes, MeshLib::findElementsConnectedToNodes(), getElements(), getNodes(), MeshLib::views::ids, setDimension(), and setElementNeighbors().

◆ Mesh() [3/3]

MeshLib::Mesh::Mesh ( Mesh &&  mesh)
default

◆ ~Mesh()

MeshLib::Mesh::~Mesh ( )
virtual

Destructor.

Definition at line 126 of file Mesh.cpp.

127 {
128  const std::size_t nElements(_elements.size());
129  for (std::size_t i = 0; i < nElements; ++i)
130  {
131  delete _elements[i];
132  }
133 
134  const std::size_t nNodes(_nodes.size());
135  for (std::size_t i = 0; i < nNodes; ++i)
136  {
137  delete _nodes[i];
138  }
139 }

References _elements, and _nodes.

Member Function Documentation

◆ addElement()

void MeshLib::Mesh::addElement ( Element elem)

Add an element to the mesh.

Definition at line 141 of file Mesh.cpp.

142 {
143  _elements.push_back(elem);
144 }

References _elements.

◆ calcEdgeLengthRange()

void MeshLib::Mesh::calcEdgeLengthRange ( )
protected

Set the minimum and maximum length over the edges of the mesh.

◆ getDimension()

unsigned MeshLib::Mesh::getDimension ( ) const
inline

Returns the dimension of the mesh (determined by the maximum dimension over all elements).

Definition at line 83 of file Mesh.h.

83 { return _mesh_dimension; }

References _mesh_dimension.

Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::HydroMechanicsProcess(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::RichardsMechanicsProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::SmallDeformationNonlocalProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), ProcessLib::SurfaceFlux::SurfaceFlux(), ProcessLib::TES::TESProcess::TESProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::TH2MProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::ThermoHydroMechanicsProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::ThermoMechanicsProcess(), MeshLib::addLayerToMesh(), MeshGeoToolsLib::GeoMapper::advancedMapOnMesh(), MeshLib::ElementSizeMetric::calculateQuality(), MeshLib::SizeDifferenceMetric::calculateQuality(), MeshLib::RasterDataToMesh::checkMesh(), MeshView::contextMenuEvent(), MeshLib::convertMeshToGeo(), ProcessLib::createBoundaryCondition(), MeshLib::createBoundaryElements(), ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::createConstraintDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), MeshLib::createFlippedMesh(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::HT::createHTProcess(), LayeredMeshGenerator::createLayers(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), ProcessLib::createNeumannBoundaryCondition(), ProcessLib::createPrimaryVariableConstraintDirichletBoundaryCondition(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), LayeredVolume::createRasterLayers(), MeshLib::MeshLayerMapper::createRasterLayers(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::createRobinBoundaryCondition(), ProcessLib::createSolutionDependentDirichletBoundaryCondition(), ProcessLib::createSourceTerm(), MeshLib::MeshLayerMapper::createStaticLayers(), ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), MeshLib::MeshValidation::detectHoles(), ProcessLib::LIE::anonymous_namespace{MeshUtils.cpp}::findFracutreIntersections(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), ProcessLib::LIE::getFractureMatrixDataInMesh(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::getOrientedSurfaceNormal(), MeshLib::MeshSurfaceExtraction::getSurfaceAreaForNodes(), getSurfaceIntegratedValuesForNodes(), MeshLib::MeshSurfaceExtraction::getSurfaceNodes(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::initializeConcreteProcess(), ProcessLib::HT::HTProcess::initializeConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::initializeConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::initializeConcreteProcess(), ProcessLib::TES::TESProcess::initializeConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::initializeConcreteProcess(), ProcessLib::TES::TESProcess::initializeSecondaryVariables(), MeshLib::is2DMeshOnRotatedVerticalPlane(), MeshLib::MeshLayerMapper::layerMapping(), MeshGeoToolsLib::GeoMapper::mapOnMesh(), MeshLib::MeshLayerMapper::mapToStaticValue(), MeshLib::NodeSearch::searchBoundaryNodes(), setDimension(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), testIfMeshesAreEqual(), FileIO::SHPInterface::write2dMeshToSHP(), and FileIO::TetGenInterface::writeTetGenSmesh().

◆ getElement()

◆ getElements()

std::vector<Element*> const& MeshLib::Mesh::getElements ( ) const
inline

Get the element-vector for the mesh.

Definition at line 104 of file Mesh.h.

104 { return _elements; }

References _elements.

Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), MeshGeoToolsLib::HeuristicSearchLength::HeuristicSearchLength(), Mesh(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::PythonBoundaryCondition::PythonBoundaryCondition(), ProcessLib::SourceTerms::Python::PythonSourceTerm::PythonSourceTerm(), ProcessLib::SurfaceFlux::SurfaceFlux(), ProcessLib::VolumetricSourceTerm::VolumetricSourceTerm(), LayeredVolume::addLayerBoundaries(), LayeredVolume::addLayerToMesh(), MeshLib::MeshLayerMapper::addLayerToMesh(), MeshLib::addLayerToMesh(), MeshModel::addMeshObject(), MeshGeoToolsLib::appendLinesAlongPolylines(), MeshLib::ElementSizeMetric::calc1dQuality(), MeshLib::ElementSizeMetric::calc2dQuality(), MeshLib::ElementSizeMetric::calc3dQuality(), MeshLib::EdgeRatioMetric::calculateQuality(), MeshLib::RadiusEdgeRatioMetric::calculateQuality(), MeshLib::SizeDifferenceMetric::calculateQuality(), MaterialPropertyLib::checkMaterialSpatialDistributionMap(), ProcessLib::ComponentTransport::checkMPLProperties(), ProcessLib::RichardsComponentTransport::anonymous_namespace{CreateRichardsComponentTransportProcess.cpp}::checkMPLProperties(), ProcessLib::StokesFlow::anonymous_namespace{CreateStokesFlowProcess.cpp}::checkMPLProperties(), computePointCloudNodes(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::constructDofTable(), MeshLib::convertMeshToGeo(), MeshLib::convertToLinearMesh(), MeshLib::createBoundaryElements(), ProcessLib::createDeactivatedSubdomainMesh(), MeshLib::createFlippedMesh(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), NumLib::createNumericalStabilization(), createPropertyVector(), MeshLib::createQuadraticOrderMesh(), ParameterLib::createRandomFieldMeshElementParameter(), MeshLib::MeshLayerMapper::createRasterLayers(), MeshLib::MeshLayerMapper::createStaticLayers(), MeshLib::MeshSubset::elementsBegin(), MeshLib::MeshSubset::elementsEnd(), extractBoundaries(), extractBoundaryMeshes(), MeshLib::findElementsConnectedToNodes(), MeshLib::ElementStatus::getActiveElements(), ProcessLib::HeatTransportBHE::getBHEDataInMesh(), ProcessLib::ConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::LIE::getFractureMatrixDataInMesh(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), MeshLib::MeshInformation::getNumberOfElementTypes(), MeshLib::MeshSurfaceExtraction::getSurfaceNodes(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshElements(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::initializeConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::initializeConcreteProcess(), ProcessLib::HT::HTProcess::initializeConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::initializeConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::initializeConcreteProcess(), ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::TES::TESProcess::initializeConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::initializeConcreteProcess(), MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), MeshLib::is2DMeshOnRotatedVerticalPlane(), isVoxelGrid(), main(), ApplicationUtils::markDuplicateGhostCells(), markFaults(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), ProcessLib::ConstraintDirichletBoundaryCondition::preTimestep(), MeshLib::RasterDataToMesh::projectToElements(), MeshLib::removeElements(), removeLineElements(), MeshLib::removeNodes(), reorderNonlinearNodes(), MeshLib::VtkMappedMeshSource::RequestData(), MeshGeoToolsLib::resetMeshElementProperty(), MeshLib::NodeSearch::searchBoundaryNodes(), MeshLib::ElementSearch::searchByBoundingBox(), MeshLib::ElementSearch::searchByContent(), MeshLib::ElementSearch::searchByElementType(), MeshLib::ElementValueModification::setByElementType(), setMaterialIDs(), ElementTreeModel::setMesh(), MeshLib::MeshRevision::simplifyMesh(), MeshLib::MeshElementGrid::sortElementsInGridCells(), MeshLib::MeshValidation::testElementGeometry(), MeshLib::IO::transformToXDMFTopology(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::TetGenInterface::write2dElements(), FileIO::SHPInterface::write2dMeshToSHP(), and FileIO::TetGenInterface::write3dElements().

◆ getElementsConnectedToNode() [1/2]

std::vector< MeshLib::Element const * > const & MeshLib::Mesh::getElementsConnectedToNode ( Node const &  node) const

Definition at line 249 of file Mesh.cpp.

251 {
252  return _elements_connected_to_nodes[node.getID()];
253 }

References _elements_connected_to_nodes, and MathLib::Point3dWithID::getID().

◆ getElementsConnectedToNode() [2/2]

std::vector< MeshLib::Element const * > const & MeshLib::Mesh::getElementsConnectedToNode ( std::size_t  node_id) const

◆ getID()

◆ getName()

const std::string MeshLib::Mesh::getName ( ) const
inline

Get name of the mesh.

Definition at line 98 of file Mesh.h.

98 { return _name; }

References _name.

Referenced by MeshGeoToolsLib::HeuristicSearchLength::HeuristicSearchLength(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::HydroMechanicsProcess(), MeshGeoToolsLib::MeshNodeSearcher::MeshNodeSearcher(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), SaveMeshDialog::SaveMeshDialog(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), MeshLib::addLayerToMesh(), MeshModel::addMeshObject(), VtkVisPipeline::addPipelineItem(), addPrimaryVariablesToMesh(), ProcessLib::Output::addProcess(), MeshGeoToolsLib::appendLinesAlongPolylines(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), MeshLib::convertMeshToGeo(), MeshLib::convertSurfaceToMesh(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::createNeumannBoundaryCondition(), MeshLib::createQuadraticOrderMesh(), ProcessLib::createRobinBoundaryCondition(), ProcessLib::createSourceTerm(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), ProcessLib::Output::doOutputAlways(), ProcessLib::Output::doOutputNonlinearIteration(), MeshView::exportToShapefile(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), MeshGeoToolsLib::MeshNodeSearcher::getMeshNodeIDs(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), NumLib::MeshComponentMap::getSubset(), MeshLib::is2DMeshOnRotatedVerticalPlane(), ParameterLib::isDefinedOnSameMesh(), main(), SaveMeshDialog::on_selectDirButton_clicked(), MeshView::openRasterDataToMeshDialog(), ProcessLib::outputMeshVtk(), ElementTreeModel::setMesh(), anonymous_namespace{IdentifySubdomainMesh.cpp}::updateOrCheckExistingSubdomainProperty(), MeshLib::vtkStandardNewMacro(), FileIO::SHPInterface::write2dMeshToSHP(), and MeshLib::ElementQualityInterface::writeHistogram().

◆ getNode()

◆ getNodes()

std::vector<Node*> const& MeshLib::Mesh::getNodes ( ) const
inline

Get the nodes-vector for the mesh.

Definition at line 101 of file Mesh.h.

101 { return _nodes; }

References _nodes.

Referenced by MeshGeoToolsLib::BoundaryElementsAtPoint::BoundaryElementsAtPoint(), ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::DirichletBoundaryCondition::DirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), Mesh(), MeshGeoToolsLib::MeshNodesAlongPolyline::MeshNodesAlongPolyline(), MeshGeoToolsLib::MeshNodesAlongSurface::MeshNodesAlongSurface(), MeshLib::MeshSubset::MeshSubset(), MeshLib::NodeAdjacencyTable::NodeAdjacencyTable(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::PrimaryVariableConstraintDirichletBoundaryCondition::PrimaryVariableConstraintDirichletBoundaryCondition(), ProcessLib::PythonBoundaryCondition::PythonBoundaryCondition(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), ProcessLib::SurfaceFlux::SurfaceFlux(), LayeredVolume::addLayerToMesh(), MeshLib::MeshLayerMapper::addLayerToMesh(), MeshLib::addLayerToMesh(), adjustExtent(), MeshGeoToolsLib::appendLinesAlongPolylines(), MeshLib::calculateNodesConnectedByElements(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), MeshLib::MeshRevision::collapseNodeIndices(), ProcessLib::DeactivatedSubdomainDirichlet::config(), ProcessLib::DirichletBoundaryConditionWithinTimeInterval::config(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::constructDofTable(), ProcessLib::Process::constructDofTableOfSpecifiedProcessStaggeredScheme(), ProcessLib::Process::constructMonolithicProcessDofTable(), MeshLib::MeshRevision::constructNewNodesArray(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), MeshLib::createFlippedMesh(), ProcessLib::HeatConduction::createHeatConductionProcess(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), createMeshFromElements(), MeshLib::createQuadraticOrderMesh(), ProcessLib::createSourceTerm(), MeshLib::MeshLayerMapper::createStaticLayers(), MeshLib::NodeAdjacencyTable::createTable(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), ProcessLib::extractInnerAndOuterNodes(), MeshLib::findElementsConnectedToNodes(), MeshLib::ElementStatus::getActiveNodes(), MeshLib::MeshInformation::getBoundingBox(), ProcessLib::PythonBoundaryCondition::getEssentialBCValues(), ProcessLib::PrimaryVariableConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::getEssentialBCValuesLocal(), MeshGeoToolsLib::MeshNodeSearcher::getMeshNodeIDs(), MeshLib::MeshSurfaceExtraction::getSurfaceAreaForNodes(), getSurfaceIntegratedValuesForNodes(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshNodes(), ProcessLib::NodalSourceTerm::integrate(), MeshLib::Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(), MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), MeshLib::MeshLayerMapper::layerMapping(), MeshGeoToolsLib::GeoMapper::mapOnMesh(), MeshGeoToolsLib::GeoMapper::mapPointDataToMeshSurface(), MeshGeoToolsLib::GeoMapper::mapStationData(), MeshLib::MeshLayerMapper::mapToStaticValue(), markFaults(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), ProcessLib::SolutionDependentDirichletBoundaryCondition::postTimestep(), ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::preTimestep(), MeshLib::RasterDataToMesh::projectToNodes(), MeshLib::removeElements(), MeshLib::removeNodes(), reorderNonlinearNodes(), MeshLib::VtkMappedMeshSource::RequestData(), MeshGeoToolsLib::resetMeshElementProperty(), rotateMesh(), MeshLib::NodeSearch::searchBoundaryNodes(), MeshLib::NodeSearch::searchUnused(), swapNodeCoordinateAxes(), MeshLib::IO::transformGeometry(), MeshLib::IO::transformToXDMFGeometry(), and FileIO::TetGenInterface::writeTetGenSmesh().

◆ getNumberOfBaseNodes()

std::size_t MeshLib::Mesh::getNumberOfBaseNodes ( ) const

Get the number of base nodes.

Definition at line 225 of file Mesh.cpp.

226 {
227  return std::count_if(begin(_nodes), end(_nodes),
228  [this](auto const* const node) {
229  return isBaseNode(
230  *node,
231  _elements_connected_to_nodes[node->getID()]);
232  });
233 }
bool isBaseNode(Node const &node, std::vector< Element const * > const &elements_connected_to_node)
Definition: Mesh.cpp:370

References _elements_connected_to_nodes, _nodes, and MeshLib::isBaseNode().

Referenced by MeshGeoToolsLib::MeshNodesAlongPolyline::MeshNodesAlongPolyline(), MeshGeoToolsLib::MeshNodesAlongSurface::MeshNodesAlongSurface(), MeshLib::convertToLinearMesh(), and ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh().

◆ getNumberOfElements()

std::size_t MeshLib::Mesh::getNumberOfElements ( ) const
inline

Get the number of elements.

Definition at line 92 of file Mesh.h.

92 { return _elements.size(); }

References _elements.

Referenced by MeshLib::ElementQualityMetric::ElementQualityMetric(), MeshLib::ElementStatus::ElementStatus(), MeshGeoToolsLib::HeuristicSearchLength::HeuristicSearchLength(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), CreateStructuredGridDialog::accept(), addIntegrationPointData(), MeshLib::MeshLayerMapper::addLayerToMesh(), MeshLib::addLayerToMesh(), MeshLib::addPropertyToMesh(), FileIO::SwmmInterface::addResultsToMesh(), addSecondaryVariableResiduals(), MeshGeoToolsLib::appendLinesAlongPolylines(), MeshLib::EdgeRatioMetric::calculateQuality(), MeshLib::RadiusEdgeRatioMetric::calculateQuality(), MeshLib::SizeDifferenceMetric::calculateQuality(), MeshLib::convertMeshToGeo(), ProcessLib::createConstraintDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), ChemistryLib::PhreeqcIOData::createEquilibriumReactants(), MeshLib::createFlippedMesh(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ChemistryLib::PhreeqcIOData::createKineticReactants(), ProcessLib::createNeumannBoundaryCondition(), ProcessLib::createPrimaryVariableConstraintDirichletBoundaryCondition(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), ProcessLib::createRobinBoundaryCondition(), MeshLib::createSfcMeshProperties(), ProcessLib::createSolutionDependentDirichletBoundaryCondition(), MeshLib::MeshLayerMapper::createStaticLayers(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), ProcessLib::HeatTransportBHE::getBHEDataInMesh(), ProcessLib::LIE::getFractureMatrixDataInMesh(), MeshLib::getOrCreateMeshProperty(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshElements(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), main(), markFaults(), MeshAnalysisDialog::on_startButton_pressed(), removeUnusedElements(), setMaterialIDs(), ElementTreeModel::setMesh(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), MeshLib::MeshRevision::simplifyMesh(), MeshLib::MeshValidation::testElementGeometry(), testIfMeshesAreEqual(), ProcessLib::ProcessVariable::updateDeactivatedSubdomains(), FileIO::SHPInterface::write2dMeshToSHP(), and FileIO::TetGenInterface::writeTetGenSmesh().

◆ getNumberOfNodes()

std::size_t MeshLib::Mesh::getNumberOfNodes ( ) const
inline

Get the number of nodes.

Definition at line 95 of file Mesh.h.

95 { return _nodes.size(); }

References _nodes.

Referenced by MeshLib::ElementStatus::ElementStatus(), MeshGeoToolsLib::MeshNodesAlongPolyline::MeshNodesAlongPolyline(), MeshGeoToolsLib::MeshNodesAlongSurface::MeshNodesAlongSurface(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), LayeredVolume::addLayerBoundaries(), LayeredVolume::addLayerToMesh(), MeshLib::MeshLayerMapper::addLayerToMesh(), MeshLib::addPropertyToMesh(), FileIO::SwmmInterface::addResultsToMesh(), addSecondaryVariableNodes(), MeshLib::MeshRevision::collapseNodeIndices(), ProcessLib::TES::TESProcess::computeEquilibriumLoading(), ProcessLib::TES::TESProcess::computeRelativeHumidity(), ProcessLib::TES::TESProcess::computeVapourPartialPressure(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), ProcessLib::LIE::PostProcessTool::copyPropertyValues(), ProcessLib::createConstraintDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::createNeumannBoundaryCondition(), NumLib::MeshComponentMap::createParallelMeshComponentMap(), ProcessLib::createPrimaryVariableConstraintDirichletBoundaryCondition(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), MeshLib::MeshLayerMapper::createRasterLayers(), ProcessLib::createRobinBoundaryCondition(), MeshLib::createSfcMeshProperties(), ProcessLib::createSolutionDependentDirichletBoundaryCondition(), MeshLib::MeshLayerMapper::createStaticLayers(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), ProcessLib::extractInnerAndOuterNodes(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), MeshLib::getOrCreateMeshProperty(), MeshLib::MeshSurfaceExtraction::getSurfaceAreaForNodes(), MeshLib::MeshSurfaceExtraction::getSurfaceNodes(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshNodes(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), MeshLib::MeshLayerMapper::layerMapping(), main(), MeshGeoToolsLib::GeoMapper::mapOnMesh(), MeshAnalysisDialog::on_startButton_pressed(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), MeshLib::VtkMappedMeshSource::RequestInformation(), MeshLib::NodeSearch::searchNodesConnectedToOnlyGivenElements(), MeshLib::NodeSearch::searchUnused(), ElementTreeModel::setMesh(), ProcessLib::ComponentTransport::ComponentTransportProcess::solveReactionEquation(), testIfMeshesAreEqual(), and MeshLib::IO::Legacy::MeshIO::write().

◆ getProperties() [1/2]

Properties& MeshLib::Mesh::getProperties ( )
inline

Definition at line 129 of file Mesh.h.

129 { return _properties; }

References _properties.

Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), ProcessLib::SurfaceFlux::SurfaceFlux(), CreateStructuredGridDialog::accept(), MeshElementRemovalDialog::accept(), ProcessLib::addBulkMeshNodePropertyToSubMesh(), MeshLib::addLayerToMesh(), MeshLib::addPropertyToMesh(), MeshElementRemovalDialog::addScalarArrays(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), MeshLib::ElementValueModification::condense(), MeshLib::VtkMeshConverter::convertScalarArrays(), MeshLib::convertToLinearMesh(), MeshLib::createFlippedMesh(), ParameterLib::createGroupBasedParameter(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ParameterLib::createMeshElementParameter(), ParameterLib::createMeshNodeParameter(), MeshLib::createQuadraticOrderMesh(), ParameterLib::createRandomFieldMeshElementParameter(), ProcessLib::createSourceTerm(), determineIntegrationOrder(), ProcessLib::extractElementsAlongOuterNodes(), ProcessLib::extractInnerAndOuterNodes(), extractMatGroup(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), ChemistryLib::ChemicalSolverInterface::getElementIDs(), ProcessLib::DeactivatedSubdomainDirichlet::getEssentialBCValues(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), MeshLib::getOrCreateMeshProperty(), NumLib::MeshComponentMap::getSubset(), getSurfaceIntegratedValuesForNodes(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshElements(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), MeshLib::Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(), MeshLib::IO::Legacy::MeshIO::loadMeshFromFile(), main(), mapArray(), markFaults(), MeshLib::materialIDs(), MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), ProcessLib::Output::prepareSubmesh(), MeshLib::RasterDataToMesh::projectToElements(), MeshLib::RasterDataToMesh::projectToNodes(), FileIO::GMSH::readGMSHMesh(), MeshLib::removeElements(), MeshLib::removeNodes(), MeshLib::ElementValueModification::replace(), MeshLib::VtkMappedMeshSource::RequestData(), MeshGeoToolsLib::resetMeshElementProperty(), MeshLib::scaleMeshPropertyVector(), MeshLib::ElementSearch::searchByPropertyValueRange(), MeshLib::ElementValueModification::setByElementType(), setMaterialIDs(), ElementTreeModel::setMesh(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), MeshLib::MeshRevision::simplifyMesh(), MeshLib::IO::transformAttributes(), anonymous_namespace{IdentifySubdomainMesh.cpp}::updateOrCheckExistingSubdomainProperty(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::TetGenInterface::write2dElements(), FileIO::SHPInterface::write2dMeshToSHP(), FileIO::TetGenInterface::write3dElements(), and MeshLib::MeshInformation::writePropertyVectorInformation().

◆ getProperties() [2/2]

Properties const& MeshLib::Mesh::getProperties ( ) const
inline

Definition at line 130 of file Mesh.h.

130 { return _properties; }

References _properties.

◆ hasNonlinearElement()

bool MeshLib::Mesh::hasNonlinearElement ( ) const

Check if the mesh contains any nonlinear element.

Definition at line 235 of file Mesh.cpp.

236 {
237  return std::any_of(
238  std::begin(_elements), std::end(_elements),
239  [](Element const* const e)
240  { return e->getNumberOfNodes() != e->getNumberOfBaseNodes(); });
241 }
constexpr bool any_of(List const &values)
Checks if any of the elements in the given list is true.
Definition: Algorithm.h:325

References _elements, BaseLib::any_of(), MeshLib::Element::getNumberOfBaseNodes(), and MeshLib::Element::getNumberOfNodes().

◆ isAxiallySymmetric()

bool MeshLib::Mesh::isAxiallySymmetric ( ) const
inline

Definition at line 132 of file Mesh.h.

132 { return _is_axially_symmetric; }
bool _is_axially_symmetric
Definition: Mesh.h:159

References _is_axially_symmetric.

Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::PythonBoundaryCondition::PythonBoundaryCondition(), ProcessLib::SourceTerms::Python::PythonSourceTerm::PythonSourceTerm(), ProcessLib::SurfaceFlux::SurfaceFlux(), ProcessLib::VolumetricSourceTerm::VolumetricSourceTerm(), MeshGeoToolsLib::constructAdditionalMeshesFromGeoObjects(), ProcessLib::createBoundaryCondition(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::initializeConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::initializeConcreteProcess(), ProcessLib::HT::HTProcess::initializeConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::initializeConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::initializeConcreteProcess(), ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::TES::TESProcess::initializeConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::initializeConcreteProcess(), and ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::initializeConcreteProcess().

◆ operator=() [1/2]

Mesh& MeshLib::Mesh::operator= ( const Mesh mesh)
delete

◆ operator=() [2/2]

Mesh& MeshLib::Mesh::operator= ( Mesh &&  mesh)
delete

◆ resetElementIDs()

void MeshLib::Mesh::resetElementIDs ( )

Resets the IDs of all mesh-elements to their position in the element vector.

Definition at line 155 of file Mesh.cpp.

156 {
157  const std::size_t nElements(this->_elements.size());
158  for (unsigned i = 0; i < nElements; ++i)
159  {
160  _elements[i]->setID(i);
161  }
162 }

References _elements.

Referenced by Mesh().

◆ resetNodeIDs()

void MeshLib::Mesh::resetNodeIDs ( )

Resets the IDs of all mesh-nodes to their position in the node vector.

Definition at line 146 of file Mesh.cpp.

147 {
148  const std::size_t nNodes(_nodes.size());
149  for (std::size_t i = 0; i < nNodes; ++i)
150  {
151  _nodes[i]->setID(i);
152  }
153 }

References _nodes.

Referenced by Mesh(), reorderNonlinearNodes(), and MeshLib::MeshRevision::simplifyMesh().

◆ setAxiallySymmetric()

void MeshLib::Mesh::setAxiallySymmetric ( bool  is_axial_symmetric)
inline

Definition at line 133 of file Mesh.h.

133  {
134  _is_axially_symmetric = is_axial_symmetric;
135  }

References _is_axially_symmetric.

◆ setDimension()

void MeshLib::Mesh::setDimension ( )
protected

Sets the dimension of the mesh.

Definition at line 164 of file Mesh.cpp.

165 {
166  const std::size_t nElements(_elements.size());
167  for (unsigned i = 0; i < nElements; ++i)
168  {
170  {
171  _mesh_dimension = _elements[i]->getDimension();
172  }
173  }
174 }
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:83

References _elements, _mesh_dimension, and getDimension().

Referenced by Mesh().

◆ setElementNeighbors()

void MeshLib::Mesh::setElementNeighbors ( )
protected

Fills in the neighbor-information for elements. Note: Using this implementation, an element e can only have neighbors that have the same dimensionality as e.

Definition at line 191 of file Mesh.cpp.

192 {
193  std::vector<Element const*> neighbors;
194  for (auto element : _elements)
195  {
196  // create vector with all elements connected to current element
197  // (includes lots of doubles!)
198  const std::size_t nNodes(element->getNumberOfBaseNodes());
199  for (unsigned n(0); n < nNodes; ++n)
200  {
201  auto const& conn_elems(
202  _elements_connected_to_nodes[element->getNode(n)->getID()]);
203  neighbors.insert(neighbors.end(), conn_elems.begin(),
204  conn_elems.end());
205  }
206  std::sort(neighbors.begin(), neighbors.end());
207  auto const neighbors_new_end =
208  std::unique(neighbors.begin(), neighbors.end());
209 
210  for (auto neighbor = neighbors.begin(); neighbor != neighbors_new_end;
211  ++neighbor)
212  {
213  std::optional<unsigned> const opposite_face_id =
214  element->addNeighbor(const_cast<Element*>(*neighbor));
215  if (opposite_face_id)
216  {
217  const_cast<Element*>(*neighbor)->setNeighbor(element,
218  *opposite_face_id);
219  }
220  }
221  neighbors.clear();
222  }
223 }

References _elements, _elements_connected_to_nodes, and MeshLib::Element::setNeighbor().

Referenced by Mesh().

◆ setName()

void MeshLib::Mesh::setName ( const std::string &  name)
inline

Changes the name of the mesh.

Definition at line 113 of file Mesh.h.

113 { this->_name = name; }

References _name, and MaterialPropertyLib::name.

Referenced by VtkVisPipelineView::convertVTKToOGSMesh().

◆ shallowClean()

void MeshLib::Mesh::shallowClean ( )

Only cleans vector members _nodes and _elements, and does not touch the pointer entries of the vectors. This function can only be called in the case that the pointers of _nodes and _elements are shared with other instances of this class and are deleted by them as well.

Definition at line 120 of file Mesh.cpp.

121 {
122  _elements.clear();
123  _nodes.clear();
124 }

References _elements, and _nodes.

Referenced by main().

Friends And Related Function Documentation

◆ ApplicationUtils::NodeWiseMeshPartitioner

Definition at line 46 of file Mesh.h.

◆ removeMeshNodes

void removeMeshNodes ( Mesh mesh,
const std::vector< std::size_t > &  nodes 
)
friend

Member Data Documentation

◆ _elements

std::vector<Element*> MeshLib::Mesh::_elements
protected

◆ _elements_connected_to_nodes

std::vector<std::vector<Element const*> > MeshLib::Mesh::_elements_connected_to_nodes
protected

◆ _id

std::size_t const MeshLib::Mesh::_id
protected

Definition at line 148 of file Mesh.h.

Referenced by getID().

◆ _is_axially_symmetric

bool MeshLib::Mesh::_is_axially_symmetric = false
protected

Definition at line 159 of file Mesh.h.

Referenced by isAxiallySymmetric(), and setAxiallySymmetric().

◆ _mesh_dimension

unsigned MeshLib::Mesh::_mesh_dimension
protected

Definition at line 149 of file Mesh.h.

Referenced by Mesh(), getDimension(), and setDimension().

◆ _name

std::string MeshLib::Mesh::_name
protected

Definition at line 152 of file Mesh.h.

Referenced by getName(), and setName().

◆ _node_distance

std::pair<double, double> MeshLib::Mesh::_node_distance
protected

The minimal and maximal distance of nodes within an element over all elements in the mesh.

Definition at line 151 of file Mesh.h.

◆ _nodes

std::vector<Node*> MeshLib::Mesh::_nodes
protected

◆ _properties

Properties MeshLib::Mesh::_properties
protected

Definition at line 155 of file Mesh.h.

Referenced by getProperties().


The documentation for this class was generated from the following files: