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...
 
virtual ~Mesh ()
 Destructor. More...
 
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...
 
double getMinEdgeLength () const
 Get the minimum edge length over all elements of the mesh. More...
 
double getMaxEdgeLength () const
 Get the maximum edge length over all elements of the mesh. 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 > _edge_length
 The minimal and maximal edge length over all elements in the mesh. More...
 
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/2]

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 54 of file Mesh.cpp.

61  _mesh_dimension(0),
62  _edge_length(std::numeric_limits<double>::max(), 0),
63  _node_distance(std::numeric_limits<double>::max(), 0),
64  _name(std::move(name)),
65  _nodes(std::move(nodes)),
66  _elements(std::move(elements)),
67  _properties(properties)
68 {
69  this->resetNodeIDs();
70  this->resetElementIDs();
71  this->setDimension();
72 
74 
75  this->setElementNeighbors();
76  this->calcEdgeLengthRange();
77 }
static std::size_t global_mesh_counter
Mesh counter used to uniquely identify meshes by id.
Definition: Mesh.cpp:31
Properties _properties
Definition: Mesh.h:153
void calcEdgeLengthRange()
Set the minimum and maximum length over the edges of the mesh.
Definition: Mesh.cpp:166
std::size_t const _id
Definition: Mesh.h:142
std::vector< std::vector< Element const * > > _elements_connected_to_nodes
Definition: Mesh.h:155
std::pair< double, double > _edge_length
The minimal and maximal edge length over all elements in the mesh.
Definition: Mesh.h:145
unsigned _mesh_dimension
Definition: Mesh.h:143
std::string _name
Definition: Mesh.h:150
void resetNodeIDs()
Resets the IDs of all mesh-nodes to their position in the node vector.
Definition: Mesh.cpp:136
std::vector< Element * > _elements
Definition: Mesh.h:152
void setDimension()
Sets the dimension of the mesh.
Definition: Mesh.cpp:154
void resetElementIDs()
Resets the IDs of all mesh-elements to their position in the element vector.
Definition: Mesh.cpp:145
void setElementNeighbors()
Definition: Mesh.cpp:180
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:149
std::vector< Node * > _nodes
Definition: Mesh.h:151
std::vector< std::vector< Element const * > > findElementsConnectedToNodes(Mesh const &mesh)
Definition: Mesh.cpp:35

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

◆ Mesh() [2/2]

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

Copy constructor.

Definition at line 79 of file Mesh.cpp.

81  _mesh_dimension(mesh.getDimension()),
82  _edge_length(mesh._edge_length.first, mesh._edge_length.second),
83  _node_distance(mesh._node_distance.first, mesh._node_distance.second),
84  _name(mesh.getName()),
85  _nodes(mesh.getNumberOfNodes()),
86  _elements(mesh.getNumberOfElements()),
87  _properties(mesh._properties)
88 {
89  const std::vector<Node*>& nodes(mesh.getNodes());
90  const std::size_t nNodes(nodes.size());
91  for (unsigned i = 0; i < nNodes; ++i)
92  {
93  _nodes[i] = new Node(*nodes[i]);
94  }
95 
96  const std::vector<Element*>& elements(mesh.getElements());
97  const std::size_t nElements(elements.size());
98  for (unsigned i = 0; i < nElements; ++i)
99  {
100  const std::size_t nElemNodes = elements[i]->getNumberOfNodes();
101  _elements[i] = elements[i]->clone();
102  for (unsigned j = 0; j < nElemNodes; ++j)
103  {
104  _elements[i]->setNode(j, _nodes[elements[i]->getNode(j)->getID()]);
105  }
106  }
107 
108  if (_mesh_dimension == 0)
109  {
110  this->setDimension();
111  }
113  this->setElementNeighbors();
114 }
std::size_t getID() const
Get id of the mesh.
Definition: Mesh.h:110
const Node * getNode(std::size_t idx) const
Get the node with the given index.
Definition: Mesh.h:74

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

◆ ~Mesh()

MeshLib::Mesh::~Mesh ( )
virtual

Destructor.

Definition at line 116 of file Mesh.cpp.

117 {
118  const std::size_t nElements(_elements.size());
119  for (std::size_t i = 0; i < nElements; ++i)
120  {
121  delete _elements[i];
122  }
123 
124  const std::size_t nNodes(_nodes.size());
125  for (std::size_t i = 0; i < nNodes; ++i)
126  {
127  delete _nodes[i];
128  }
129 }

References _elements, and _nodes.

Member Function Documentation

◆ addElement()

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

Add an element to the mesh.

Definition at line 131 of file Mesh.cpp.

132 {
133  _elements.push_back(elem);
134 }

References _elements.

◆ calcEdgeLengthRange()

void MeshLib::Mesh::calcEdgeLengthRange ( )
protected

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

Definition at line 166 of file Mesh.cpp.

167 {
168  const std::size_t nElems(getNumberOfElements());
169  for (std::size_t i = 0; i < nElems; ++i)
170  {
171  auto const& [min_length, max_length] =
173  _edge_length.first = std::min(_edge_length.first, min_length);
174  _edge_length.second = std::max(_edge_length.second, max_length);
175  }
176  _edge_length.first = std::sqrt(_edge_length.first);
177  _edge_length.second = std::sqrt(_edge_length.second);
178 }
std::size_t getNumberOfElements() const
Get the number of elements.
Definition: Mesh.h:86
std::pair< double, double > computeSqrEdgeLengthRange(Element const &element)
Compute the minimum and maximum squared edge length for this element.
Definition: Element.cpp:162

References _edge_length, _elements, MeshLib::computeSqrEdgeLengthRange(), and getNumberOfElements().

Referenced by 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 71 of file Mesh.h.

71 { 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(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::ThermoRichardsMechanicsProcess(), 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, IntegrationMethod, GlobalDim >::getOrientedSurfaceNormal(), MeshLib::MeshSurfaceExtraction::getSurfaceAreaForNodes(), getSurfaceIntegratedValuesForNodes(), MeshLib::MeshSurfaceExtraction::getSurfaceNodes(), 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::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< 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::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::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(), 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 98 of file Mesh.h.

98 { return _elements; }

References _elements.

Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), MeshGeoToolsLib::HeuristicSearchLength::HeuristicSearchLength(), Mesh(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< GlobalDim, LocalAssemblerImplementation >::NormalTractionBoundaryCondition(), 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(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::constructDofTable(), MeshLib::convertMeshToGeo(), MeshLib::convertToLinearMesh(), MeshLib::createBoundaryElements(), ProcessLib::createDeactivatedSubdomainMesh(), MeshLib::createFlippedMesh(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), MeshLib::createQuadraticOrderMesh(), ParameterLib::createRandomFieldMeshElementParameter(), MeshLib::MeshLayerMapper::createRasterLayers(), MeshLib::MeshLayerMapper::createStaticLayers(), MeshLib::MeshSubset::elementsBegin(), MeshLib::MeshSubset::elementsEnd(), 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(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::integrate(), MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), MeshLib::is2DMeshOnRotatedVerticalPlane(), isVoxelGrid(), 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(), 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 238 of file Mesh.cpp.

240 {
241  return _elements_connected_to_nodes[node.getID()];
242 }

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

◆ getElementsConnectedToNode() [2/2]

◆ getID()

◆ getMaxEdgeLength()

double MeshLib::Mesh::getMaxEdgeLength ( ) const
inline

Get the maximum edge length over all elements of the mesh.

Definition at line 83 of file Mesh.h.

83 { return _edge_length.second; }

References _edge_length.

Referenced by main(), and ElementTreeModel::setMesh().

◆ getMinEdgeLength()

double MeshLib::Mesh::getMinEdgeLength ( ) const
inline

Get the minimum edge length over all elements of the mesh.

Definition at line 80 of file Mesh.h.

80 { return _edge_length.first; }

References _edge_length.

Referenced by MeshGeoToolsLib::appendLinesAlongPolylines(), extractBoundaries(), main(), and ElementTreeModel::setMesh().

◆ getName()

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

Get name of the mesh.

Definition at line 92 of file Mesh.h.

92 { return _name; }

References _name.

Referenced by ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), 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(), ProcessLib::Output::addProcess(), ProcessLib::addProcessDataToMesh(), 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(), 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 95 of file Mesh.h.

95 { return _nodes; }

References _nodes.

Referenced by MeshGeoToolsLib::BoundaryElementsAtPoint::BoundaryElementsAtPoint(), ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::DirichletBoundaryCondition::DirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), Mesh(), MeshGeoToolsLib::MeshNodesAlongPolyline::MeshNodesAlongPolyline(), MeshGeoToolsLib::MeshNodesAlongSurface::MeshNodesAlongSurface(), MeshLib::MeshSubset::MeshSubset(), MeshLib::NodeAdjacencyTable::NodeAdjacencyTable(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< GlobalDim, LocalAssemblerImplementation >::NormalTractionBoundaryCondition(), 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::DirichletBoundaryConditionWithinTimeInterval::config(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::constructDofTable(), ProcessLib::Process::constructDofTableOfSpecifiedProcessStaggeredScheme(), ProcessLib::Process::constructMonolithicProcessDofTable(), MeshLib::MeshRevision::constructNewNodesArray(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), MeshLib::createFlippedMesh(), 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::DirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::DirichletBoundaryConditionWithinTimeInterval::getEssentialBCValues(), ProcessLib::PrimaryVariableConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::SolutionDependentDirichletBoundaryCondition::getEssentialBCValues(), 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 214 of file Mesh.cpp.

215 {
216  return std::count_if(begin(_nodes), end(_nodes),
217  [this](auto const* const node) {
218  return isBaseNode(
219  *node,
220  _elements_connected_to_nodes[node->getID()]);
221  });
222 }
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(), MeshLib::NodePartitionedMesh::getLargestActiveNodeID(), and ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh().

◆ getNumberOfElements()

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

Get the number of elements.

Definition at line 86 of file Mesh.h.

86 { 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(), calcEdgeLengthRange(), 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(), 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 89 of file Mesh.h.

89 { 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(), 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(), ProcessLib::PythonBoundaryCondition::getEssentialBCValues(), 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(), and MeshLib::IO::Legacy::MeshIO::write().

◆ getProperties() [1/2]

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

Definition at line 123 of file Mesh.h.

123 { return _properties; }

References _properties.

Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), ProcessLib::SurfaceFlux::SurfaceFlux(), CreateStructuredGridDialog::accept(), MeshElementRemovalDialog::accept(), MeshLib::addLayerToMesh(), ProcessLib::addProcessDataToMesh(), MeshLib::addPropertyToMesh(), MeshElementRemovalDialog::addScalarArrays(), ProcessLib::PythonBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), 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(), ProcessLib::extractInnerAndOuterNodes(), extractMatGroup(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), ProcessLib::PythonBoundaryCondition::getEssentialBCValues(), ProcessLib::getIntegrationPointMetaData(), 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(), mapArray(), markFaults(), MeshLib::materialIDs(), MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), 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 124 of file Mesh.h.

124 { return _properties; }

References _properties.

◆ hasNonlinearElement()

bool MeshLib::Mesh::hasNonlinearElement ( ) const

Check if the mesh contains any nonlinear element.

Definition at line 224 of file Mesh.cpp.

225 {
226  return std::any_of(
227  std::begin(_elements), std::end(_elements),
228  [](Element const* const e)
229  { return e->getNumberOfNodes() != e->getNumberOfBaseNodes(); });
230 }

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

◆ isAxiallySymmetric()

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

Definition at line 126 of file Mesh.h.

126 { return _is_axially_symmetric; }
bool _is_axially_symmetric
Definition: Mesh.h:157

References _is_axially_symmetric.

Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< GlobalDim, LocalAssemblerImplementation >::NormalTractionBoundaryCondition(), 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().

◆ resetElementIDs()

void MeshLib::Mesh::resetElementIDs ( )

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

Definition at line 145 of file Mesh.cpp.

146 {
147  const std::size_t nElements(this->_elements.size());
148  for (unsigned i = 0; i < nElements; ++i)
149  {
150  _elements[i]->setID(i);
151  }
152 }

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 136 of file Mesh.cpp.

137 {
138  const std::size_t nNodes(_nodes.size());
139  for (std::size_t i = 0; i < nNodes; ++i)
140  {
141  _nodes[i]->setID(i);
142  }
143 }

References _nodes.

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

◆ setAxiallySymmetric()

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

Definition at line 127 of file Mesh.h.

127  {
128  _is_axially_symmetric = is_axial_symmetric;
129  }

References _is_axially_symmetric.

◆ setDimension()

void MeshLib::Mesh::setDimension ( )
protected

Sets the dimension of the mesh.

Definition at line 154 of file Mesh.cpp.

155 {
156  const std::size_t nElements(_elements.size());
157  for (unsigned i = 0; i < nElements; ++i)
158  {
160  {
161  _mesh_dimension = _elements[i]->getDimension();
162  }
163  }
164 }
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:71

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 180 of file Mesh.cpp.

181 {
182  std::vector<Element const*> neighbors;
183  for (auto element : _elements)
184  {
185  // create vector with all elements connected to current element
186  // (includes lots of doubles!)
187  const std::size_t nNodes(element->getNumberOfBaseNodes());
188  for (unsigned n(0); n < nNodes; ++n)
189  {
190  auto const& conn_elems(
191  _elements_connected_to_nodes[element->getNode(n)->getID()]);
192  neighbors.insert(neighbors.end(), conn_elems.begin(),
193  conn_elems.end());
194  }
195  std::sort(neighbors.begin(), neighbors.end());
196  auto const neighbors_new_end =
197  std::unique(neighbors.begin(), neighbors.end());
198 
199  for (auto neighbor = neighbors.begin(); neighbor != neighbors_new_end;
200  ++neighbor)
201  {
202  std::optional<unsigned> const opposite_face_id =
203  element->addNeighbor(const_cast<Element*>(*neighbor));
204  if (opposite_face_id)
205  {
206  const_cast<Element*>(*neighbor)->setNeighbor(element,
207  *opposite_face_id);
208  }
209  }
210  neighbors.clear();
211  }
212 }

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 107 of file Mesh.h.

107 { this->_name = name; }

References _name, and MaterialPropertyLib::name.

Referenced by VtkVisPipelineView::convertVTKToOGSMesh().

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

◆ _edge_length

std::pair<double, double> MeshLib::Mesh::_edge_length
protected
Initial value:
= {
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::quiet_NaN()}

The minimal and maximal edge length over all elements in the mesh.

Definition at line 145 of file Mesh.h.

Referenced by calcEdgeLengthRange(), getMaxEdgeLength(), and getMinEdgeLength().

◆ _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 142 of file Mesh.h.

Referenced by getID().

◆ _is_axially_symmetric

bool MeshLib::Mesh::_is_axially_symmetric = false
protected

Definition at line 157 of file Mesh.h.

Referenced by isAxiallySymmetric(), and setAxiallySymmetric().

◆ _mesh_dimension

unsigned MeshLib::Mesh::_mesh_dimension
protected

Definition at line 143 of file Mesh.h.

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

◆ _name

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

Definition at line 150 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 149 of file Mesh.h.

◆ _nodes

◆ _properties

Properties MeshLib::Mesh::_properties
protected

Definition at line 153 of file Mesh.h.

Referenced by getProperties().


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