OGS 6.3.0-179-g962fdcd4e.dirty.20200403132553
MeshLib::Mesh Class Reference

Detailed Description

A basic mesh.

Definition at line 41 of file Mesh.h.

#include <Mesh.h>

Inheritance diagram for MeshLib::Mesh:
Collaboration diagram for MeshLib::Mesh:

Public Member Functions

 Mesh (std::string name, std::vector< Node *> nodes, std::vector< Element *> elements, Properties const &properties=Properties(), const std::size_t n_base_nodes=0)
 
 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 recalculateMaxBaseNodeId ()
 Finds the maximum id among all of the base nodes. 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 isBaseNode (std::size_t node_idx) const
 Return true if the given node is a basic one (i.e. linear order node) More...
 
bool isNonlinear () const
 Return true if the mesh has any nonlinear nodes. More...
 
MeshLib::PropertiesgetProperties ()
 
MeshLib::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 setElementsConnectedToNodes ()
 Fills in the neighbor-information for nodes (i.e. which element each node belongs to). More...
 
void setElementNeighbors ()
 
void setNodesConnectedByElements ()
 
void checkNonlinearNodeIDs () const
 Check if all the nonlinear nodes are stored at the end of the node vector. More...
 
bool hasNonlinearElement () const
 Check if the mesh contains any nonlinear element. More...
 

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
 
std::size_t _n_base_nodes
 
Properties _properties
 
bool _is_axially_symmetric = false
 

Friends

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

Additional Inherited Members

- Private Member Functions inherited from BaseLib::Counter< Mesh >
 Counter ()
 
- Static Private Attributes inherited from BaseLib::Counter< Mesh >
static std::size_t _counter_value
 

Constructor & Destructor Documentation

◆ Mesh() [1/2]

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

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

Parameters
nameMesh name.
nodesA vector of mesh nodes. In case nonlinear nodes are involved, one should put them after line ones in the vector and set "n_base_nodes" argument.
elementsAn array of mesh elements.
propertiesMesh properties.
n_base_nodesThe number of base nodes. This is an optional parameter for nonlinear case. If the parameter is set to zero, we consider there are no nonlinear nodes.

Definition at line 33 of file Mesh.cpp.

References _n_base_nodes, _nodes, calcEdgeLengthRange(), checkNonlinearNodeIDs(), hasNonlinearElement(), isNonlinear(), recalculateMaxBaseNodeId(), resetElementIDs(), resetNodeIDs(), setDimension(), setElementNeighbors(), setElementsConnectedToNodes(), and setNodesConnectedByElements().

40  : _id(_counter_value - 1),
41  _mesh_dimension(0),
42  _edge_length(std::numeric_limits<double>::max(), 0),
43  _node_distance(std::numeric_limits<double>::max(), 0),
44  _name(std::move(name)),
45  _nodes(std::move(nodes)),
46  _elements(std::move(elements)),
47  _n_base_nodes(n_base_nodes),
48  _properties(properties)
49 {
50  assert(_n_base_nodes <= _nodes.size());
51  this->resetNodeIDs();
52  this->resetElementIDs();
53  if (_n_base_nodes == 0)
54  {
56  }
57  if ((_n_base_nodes == 0 && hasNonlinearElement()) || isNonlinear())
58  {
59  this->checkNonlinearNodeIDs();
60  }
61  this->setDimension();
64  this->setElementNeighbors();
65 
66  this->calcEdgeLengthRange();
67 }
std::pair< double, double > _edge_length
The minimal and maximal edge length over all elements in the mesh.
Definition: Mesh.h:166
std::string _name
Definition: Mesh.h:169
std::vector< Element * > _elements
Definition: Mesh.h:171
std::vector< Node * > _nodes
Definition: Mesh.h:170
void setNodesConnectedByElements()
Definition: Mesh.cpp:231
void resetNodeIDs()
Resets the IDs of all mesh-nodes to their position in the node vector.
Definition: Mesh.cpp:132
void checkNonlinearNodeIDs() const
Check if all the nonlinear nodes are stored at the end of the node vector.
Definition: Mesh.cpp:264
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:168
void recalculateMaxBaseNodeId()
Finds the maximum id among all of the base nodes.
Definition: Mesh.cpp:141
std::size_t _n_base_nodes
Definition: Mesh.h:172
std::size_t const _id
Definition: Mesh.h:163
unsigned _mesh_dimension
Definition: Mesh.h:164
Properties _properties
Definition: Mesh.h:173
bool hasNonlinearElement() const
Check if the mesh contains any nonlinear element.
Definition: Mesh.cpp:285
bool isNonlinear() const
Return true if the mesh has any nonlinear nodes.
Definition: Mesh.h:129
void calcEdgeLengthRange()
Set the minimum and maximum length over the edges of the mesh.
Definition: Mesh.cpp:187
void setElementsConnectedToNodes()
Fills in the neighbor-information for nodes (i.e. which element each node belongs to)...
Definition: Mesh.cpp:175
void setDimension()
Sets the dimension of the mesh.
Definition: Mesh.cpp:163
void setElementNeighbors()
Definition: Mesh.cpp:204
static std::size_t _counter_value
Definition: Counter.h:24
void resetElementIDs()
Resets the IDs of all mesh-elements to their position in the element vector.
Definition: Mesh.cpp:154

◆ Mesh() [2/2]

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

Copy constructor.

Definition at line 69 of file Mesh.cpp.

References _elements, _mesh_dimension, _nodes, getElements(), getNodes(), MeshLib::Node, setDimension(), setElementNeighbors(), and setElementsConnectedToNodes().

70  : _id(_counter_value-1), _mesh_dimension(mesh.getDimension()),
71  _edge_length(mesh._edge_length.first, mesh._edge_length.second),
72  _node_distance(mesh._node_distance.first, mesh._node_distance.second),
73  _name(mesh.getName()), _nodes(mesh.getNumberOfNodes()), _elements(mesh.getNumberOfElements()),
74  _n_base_nodes(mesh.getNumberOfBaseNodes()),
75  _properties(mesh._properties)
76 {
77  const std::vector<Node*>& nodes (mesh.getNodes());
78  const std::size_t nNodes (nodes.size());
79  for (unsigned i = 0; i < nNodes; ++i)
80  {
81  _nodes[i] = new Node(*nodes[i]);
82  }
83 
84  const std::vector<Element*>& elements (mesh.getElements());
85  const std::size_t nElements (elements.size());
86  for (unsigned i=0; i<nElements; ++i)
87  {
88  const std::size_t nElemNodes = elements[i]->getNumberOfNodes();
89  _elements[i] = elements[i]->clone();
90  for (unsigned j = 0; j < nElemNodes; ++j)
91  {
92  _elements[i]->_nodes[j] = _nodes[elements[i]->getNode(j)->getID()];
93  }
94  }
95 
96  if (_mesh_dimension == 0)
97  {
98  this->setDimension();
99  }
101  //this->setNodesConnectedByElements();
102  this->setElementNeighbors();
103 }
std::pair< double, double > _edge_length
The minimal and maximal edge length over all elements in the mesh.
Definition: Mesh.h:166
std::string _name
Definition: Mesh.h:169
std::vector< Element * > _elements
Definition: Mesh.h:171
std::vector< Node * > _nodes
Definition: Mesh.h:170
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:168
std::size_t _n_base_nodes
Definition: Mesh.h:172
std::size_t const _id
Definition: Mesh.h:163
unsigned _mesh_dimension
Definition: Mesh.h:164
Properties _properties
Definition: Mesh.h:173
void setElementsConnectedToNodes()
Fills in the neighbor-information for nodes (i.e. which element each node belongs to)...
Definition: Mesh.cpp:175
void setDimension()
Sets the dimension of the mesh.
Definition: Mesh.cpp:163
void setElementNeighbors()
Definition: Mesh.cpp:204
static std::size_t _counter_value
Definition: Counter.h:24

◆ ~Mesh()

MeshLib::Mesh::~Mesh ( )
virtual

Destructor.

Definition at line 105 of file Mesh.cpp.

References _elements, and _nodes.

106 {
107  const std::size_t nElements (_elements.size());
108  for (std::size_t i = 0; i < nElements; ++i)
109  {
110  delete _elements[i];
111  }
112 
113  const std::size_t nNodes (_nodes.size());
114  for (std::size_t i = 0; i < nNodes; ++i)
115  {
116  delete _nodes[i];
117  }
118 }
std::vector< Element * > _elements
Definition: Mesh.h:171
std::vector< Node * > _nodes
Definition: Mesh.h:170

Member Function Documentation

◆ addElement()

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

Add an element to the mesh.

Definition at line 120 of file Mesh.cpp.

References _elements, MeshLib::Element::_nodes, MeshLib::Node::addElement(), and MeshLib::Element::getNumberOfNodes().

121 {
122  _elements.push_back(elem);
123 
124  // add element information to nodes
125  unsigned nNodes (elem->getNumberOfNodes());
126  for (unsigned i = 0; i < nNodes; ++i)
127  {
128  elem->_nodes[i]->addElement(elem);
129  }
130 }
std::vector< Element * > _elements
Definition: Mesh.h:171

◆ calcEdgeLengthRange()

void MeshLib::Mesh::calcEdgeLengthRange ( )
protected

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

Definition at line 187 of file Mesh.cpp.

References _edge_length, _elements, and getNumberOfElements().

Referenced by Mesh().

188 {
189  this->_edge_length.first = std::numeric_limits<double>::max();
190  this->_edge_length.second = 0;
191  double min_length(0);
192  double max_length(0);
193  const std::size_t nElems (this->getNumberOfElements());
194  for (std::size_t i=0; i<nElems; ++i)
195  {
196  _elements[i]->computeSqrEdgeLengthRange(min_length, max_length);
197  this->_edge_length.first = std::min(this->_edge_length.first, min_length);
198  this->_edge_length.second = std::max(this->_edge_length.second, max_length);
199  }
200  this->_edge_length.first = sqrt(this->_edge_length.first);
201  this->_edge_length.second = sqrt(this->_edge_length.second);
202 }
std::pair< double, double > _edge_length
The minimal and maximal edge length over all elements in the mesh.
Definition: Mesh.h:166
std::vector< Element * > _elements
Definition: Mesh.h:171
std::size_t getNumberOfElements() const
Get the number of elements.
Definition: Mesh.h:93

◆ checkNonlinearNodeIDs()

void MeshLib::Mesh::checkNonlinearNodeIDs ( ) const
protected

Check if all the nonlinear nodes are stored at the end of the node vector.

Definition at line 264 of file Mesh.cpp.

References _elements, and getNumberOfBaseNodes().

Referenced by Mesh().

265 {
266  for (MeshLib::Element const* e : _elements)
267  {
268  for (unsigned i=e->getNumberOfBaseNodes(); i<e->getNumberOfNodes(); i++)
269  {
270  if (e->getNodeIndex(i) >= getNumberOfBaseNodes())
271  {
272  continue;
273  }
274 
275  WARN(
276  "Found a nonlinear node whose ID (%d) is smaller than the "
277  "number of base node IDs (%d). Some functions may not work "
278  "properly.",
279  e->getNodeIndex(i), getNumberOfBaseNodes());
280  return;
281  }
282  }
283 }
std::vector< Element * > _elements
Definition: Mesh.h:171
std::size_t getNumberOfBaseNodes() const
Get the number of base nodes.
Definition: Mesh.h:123

◆ getDimension()

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

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

Definition at line 78 of file Mesh.h.

Referenced by MeshLib::addLayerToMesh(), MeshGeoToolsLib::GeoMapper::advancedMapOnMesh(), MeshLib::ElementSizeMetric::calculateQuality(), MeshLib::SizeDifferenceMetric::calculateQuality(), ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), 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::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), MeshLib::MeshLayerMapper::createRasterLayers(), LayeredVolume::createRasterLayers(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::createRobinBoundaryCondition(), ProcessLib::createSourceTerm(), MeshLib::MeshLayerMapper::createStaticLayers(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), MeshLib::MeshValidation::detectHoles(), ProcessLib::LIE::anonymous_namespace{MeshUtils.cpp}::findFracutreIntersections(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), ProcessLib::LIE::getFractureMatrixDataInMesh(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), MeshLib::MeshSurfaceExtraction::getSurfaceAreaForNodes(), getSurfaceIntegratedValuesForNodes(), MeshLib::MeshSurfaceExtraction::getSurfaceNodes(), ProcessLib::RichardsFlow::RichardsFlowProcess::initializeConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::initializeConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::initializeConcreteProcess(), ProcessLib::TES::TESProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::initializeConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::initializeConcreteProcess(), ProcessLib::HT::HTProcess::initializeConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::TES::TESProcess::initializeSecondaryVariables(), MeshLib::MeshLayerMapper::layerMapping(), MeshGeoToolsLib::GeoMapper::mapOnMesh(), MeshLib::MeshLayerMapper::mapToStaticValue(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), MeshLib::NodeSearch::searchBoundaryNodes(), setDimension(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), ProcessLib::TES::TESProcess::TESProcess(), ProcessLib::VolumetricSourceTerm::VolumetricSourceTerm(), FileIO::SHPInterface::write2dMeshToSHP(), and FileIO::TetGenInterface::writeTetGenSmesh().

78 { return _mesh_dimension; }
unsigned _mesh_dimension
Definition: Mesh.h:164

◆ getElement()

◆ getElements()

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

Get the element-vector for the mesh.

Definition at line 105 of file Mesh.h.

Referenced by LayeredVolume::addLayerBoundaries(), MeshLib::MeshLayerMapper::addLayerToMesh(), LayeredVolume::addLayerToMesh(), MeshLib::addLayerToMesh(), MeshModel::addMeshObject(), MeshGeoToolsLib::appendLinesAlongPolylines(), MeshLib::ElementSizeMetric::calc1dQuality(), MeshLib::ElementSizeMetric::calc2dQuality(), MeshLib::ElementSizeMetric::calc3dQuality(), MeshLib::AngleSkewMetric::calculateQuality(), MeshLib::EdgeRatioMetric::calculateQuality(), MeshLib::RadiusEdgeRatioMetric::calculateQuality(), MeshLib::SizeDifferenceMetric::calculateQuality(), MaterialPropertyLib::checkMaterialSpatialDistributionMap(), ProcessLib::ComponentTransport::checkMPLProperties(), ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), constructMesh(), MeshLib::convertMeshToGeo(), MeshLib::convertToLinearMesh(), MeshLib::createBoundaryElements(), ProcessLib::createDeactivatedSubdomain(), MeshLib::createFlippedMesh(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), MeshLib::createQuadraticOrderMesh(), MeshLib::MeshLayerMapper::createRasterLayers(), MeshLib::MeshLayerMapper::createStaticLayers(), MeshLib::MeshSubset::elementsBegin(), MeshLib::MeshSubset::elementsEnd(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), MeshLib::ElementStatus::getActiveElements(), ProcessLib::HeatTransportBHE::getBHEDataInMesh(), ProcessLib::ConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::LIE::getFractureMatrixDataInMesh(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), MeshLib::MeshInformation::getNumberOfElementTypes(), MeshLib::MeshSurfaceExtraction::getSurfaceNodes(), MeshGeoToolsLib::HeuristicSearchLength::HeuristicSearchLength(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshElements(), ProcessLib::RichardsFlow::RichardsFlowProcess::initializeConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::initializeConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::initializeConcreteProcess(), ProcessLib::TES::TESProcess::initializeConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::initializeConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::initializeConcreteProcess(), ProcessLib::HT::HTProcess::initializeConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::integrate(), MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), ProcessLib::LineSourceTerm::LineSourceTerm(), Mesh(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< LocalAssemblerImplementation >::NormalTractionBoundaryCondition(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::ConstraintDirichletBoundaryCondition::preTimestep(), MeshLib::projectMeshOntoPlane(), ProcessLib::PythonBoundaryCondition::PythonBoundaryCondition(), ProcessLib::SourceTerms::Python::PythonSourceTerm::PythonSourceTerm(), MeshLib::removeElements(), MeshLib::removeNodes(), reorderNonlinearNodes(), MeshLib::VtkMappedMeshSource::RequestData(), MeshLib::NodeSearch::searchBoundaryNodes(), MeshLib::ElementSearch::searchByBoundingBox(), MeshLib::ElementSearch::searchByContent(), MeshLib::ElementSearch::searchByElementType(), MeshLib::ElementValueModification::setByElementType(), MeshLib::MeshRevision::simplifyMesh(), MeshLib::MeshElementGrid::sortElementsInGridCells(), ProcessLib::SurfaceFlux::SurfaceFlux(), MeshLib::MeshValidation::testElementGeometry(), ProcessLib::VolumetricSourceTerm::VolumetricSourceTerm(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::TetGenInterface::write2dElements(), FileIO::SHPInterface::write2dMeshToSHP(), and FileIO::TetGenInterface::write3dElements().

105 { return _elements; }
std::vector< Element * > _elements
Definition: Mesh.h:171

◆ getID()

◆ getMaxEdgeLength()

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

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

Definition at line 90 of file Mesh.h.

Referenced by ElementTreeModel::setMesh().

90 { return _edge_length.second; }
std::pair< double, double > _edge_length
The minimal and maximal edge length over all elements in the mesh.
Definition: Mesh.h:166

◆ getMinEdgeLength()

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

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

Definition at line 87 of file Mesh.h.

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

87 { return _edge_length.first; }
std::pair< double, double > _edge_length
The minimal and maximal edge length over all elements in the mesh.
Definition: Mesh.h:166

◆ getName()

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

Get name of the mesh.

Definition at line 99 of file Mesh.h.

Referenced by MeshLib::addLayerToMesh(), MeshModel::addMeshObject(), VtkVisPipeline::addPipelineItem(), MeshGeoToolsLib::appendLinesAlongPolylines(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), MeshLib::convertSurfaceToMesh(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::createNeumannBoundaryCondition(), MeshLib::createQuadraticOrderMesh(), ProcessLib::createRobinBoundaryCondition(), ProcessLib::createSourceTerm(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), ProcessLib::Output::doOutputAlways(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), MeshGeoToolsLib::MeshNodeSearcher::getMeshNodeIDs(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), NumLib::MeshComponentMap::getSubset(), MeshGeoToolsLib::HeuristicSearchLength::HeuristicSearchLength(), ParameterLib::isDefinedOnSameMesh(), main(), MeshGeoToolsLib::MeshNodeSearcher::MeshNodeSearcher(), SaveMeshDialog::on_selectDirButton_clicked(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), SaveMeshDialog::SaveMeshDialog(), ElementTreeModel::setMesh(), anonymous_namespace{IdentifySubdomainMesh.cpp}::updateOrCheckExistingSubdomainProperty(), MeshLib::vtkStandardNewMacro(), FileIO::SHPInterface::write2dMeshToSHP(), and MeshLib::ElementQualityInterface::writeHistogram().

99 { return _name; }
std::string _name
Definition: Mesh.h:169

◆ getNode()

◆ getNodes()

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

Get the nodes-vector for the mesh.

Definition at line 102 of file Mesh.h.

Referenced by MeshLib::MeshLayerMapper::addLayerToMesh(), LayeredVolume::addLayerToMesh(), MeshLib::addLayerToMesh(), MeshGeoToolsLib::appendLinesAlongPolylines(), MeshGeoToolsLib::BoundaryElementsAtPoint::BoundaryElementsAtPoint(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), MeshLib::MeshRevision::collapseNodeIndices(), computeSparsityPatternNonPETSc(), ProcessLib::DirichletBoundaryConditionWithinTimeInterval::config(), ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::constructDofTable(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::constructDofTable(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::constructDofTable(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::Process::constructDofTableOfSpecifiedProsessStaggerdScheme(), ProcessLib::Process::constructMonolithicProcessDofTable(), MeshLib::MeshRevision::constructNewNodesArray(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), ProcessLib::createDeactivatedSubdomain(), MeshLib::createFlippedMesh(), MeshLib::createQuadraticOrderMesh(), ProcessLib::createSourceTerm(), MeshLib::MeshLayerMapper::createStaticLayers(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), ProcessLib::DirichletBoundaryCondition::DirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), MeshLib::ElementStatus::getActiveNodes(), MeshLib::MeshInformation::getBoundingBox(), ProcessLib::DirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::PythonBoundaryCondition::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(), main(), MeshGeoToolsLib::GeoMapper::mapOnMesh(), MeshGeoToolsLib::GeoMapper::mapPointDataToMeshSurface(), MeshGeoToolsLib::GeoMapper::mapStationData(), MeshLib::MeshLayerMapper::mapToStaticValue(), Mesh(), MeshLib::MeshElementGrid::MeshElementGrid(), MeshGeoToolsLib::MeshNodesAlongPolyline::MeshNodesAlongPolyline(), MeshGeoToolsLib::MeshNodesAlongSurface::MeshNodesAlongSurface(), MeshLib::MeshSubset::MeshSubset(), MeshLib::NodePartitionedMesh::NodePartitionedMesh(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< LocalAssemblerImplementation >::NormalTractionBoundaryCondition(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::preTimestep(), MeshLib::projectMeshOntoPlane(), ProcessLib::PythonBoundaryCondition::PythonBoundaryCondition(), MeshLib::removeElements(), MeshLib::removeNodes(), reorderNonlinearNodes(), MeshLib::VtkMappedMeshSource::RequestData(), MeshLib::MeshRevision::resetNodeIDs(), MeshLib::NodeSearch::searchBoundaryNodes(), MeshLib::NodeSearch::searchUnused(), ProcessLib::SurfaceFlux::SurfaceFlux(), swapNodeCoordinateAxes(), and FileIO::TetGenInterface::writeTetGenSmesh().

102 { return _nodes; }
std::vector< Node * > _nodes
Definition: Mesh.h:170

◆ getNumberOfBaseNodes()

◆ getNumberOfElements()

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

Get the number of elements.

Definition at line 93 of file Mesh.h.

Referenced by addIntegrationPointData(), MeshLib::MeshLayerMapper::addLayerToMesh(), MeshLib::addLayerToMesh(), MeshLib::addPropertyToMesh(), FileIO::SwmmInterface::addResultsToMesh(), MeshGeoToolsLib::appendLinesAlongPolylines(), calcEdgeLengthRange(), MeshLib::AngleSkewMetric::calculateQuality(), MeshLib::EdgeRatioMetric::calculateQuality(), MeshLib::RadiusEdgeRatioMetric::calculateQuality(), MeshLib::SizeDifferenceMetric::calculateQuality(), MeshLib::convertMeshToGeo(), ProcessLib::createConstraintDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), MeshLib::createFlippedMesh(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::createNeumannBoundaryCondition(), ProcessLib::RichardsComponentTransport::createPorousMediaProperties(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), ProcessLib::createRobinBoundaryCondition(), MeshLib::createSfcMeshProperties(), MeshLib::MeshLayerMapper::createStaticLayers(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), MeshLib::ElementQualityMetric::ElementQualityMetric(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::HeatTransportBHE::getBHEDataInMesh(), ProcessLib::LIE::getFractureMatrixDataInMesh(), MeshLib::ElementQualityMetric::getHistogram(), MeshLib::getOrCreateMeshProperty(), MeshGeoToolsLib::HeuristicSearchLength::HeuristicSearchLength(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshElements(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess(), main(), ElementTreeModel::setMesh(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), MeshLib::MeshRevision::simplifyMesh(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), MeshLib::MeshValidation::testElementGeometry(), ProcessLib::ProcessVariable::updateDeactivatedSubdomains(), FileIO::SHPInterface::write2dMeshToSHP(), and FileIO::TetGenInterface::writeTetGenSmesh().

93 { return _elements.size(); }
std::vector< Element * > _elements
Definition: Mesh.h:171

◆ getNumberOfNodes()

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

Get the number of nodes.

Definition at line 96 of file Mesh.h.

Referenced by LayeredVolume::addLayerBoundaries(), MeshLib::MeshLayerMapper::addLayerToMesh(), LayeredVolume::addLayerToMesh(), MeshLib::addPropertyToMesh(), FileIO::SwmmInterface::addResultsToMesh(), MeshLib::MeshRevision::collapseNodeIndices(), ProcessLib::TES::TESProcess::computeEquilibriumLoading(), ProcessLib::TES::TESProcess::computeRelativeHumidity(), computeSparsityPatternNonPETSc(), ProcessLib::TES::TESProcess::computeVapourPartialPressure(), constructMesh(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), ProcessLib::LIE::PostProcessTool::copyProperties(), ProcessLib::createConstraintDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::createNeumannBoundaryCondition(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), MeshLib::createQuadraticOrderMesh(), MeshLib::MeshLayerMapper::createRasterLayers(), ProcessLib::createRobinBoundaryCondition(), MeshLib::createSfcMeshProperties(), MeshLib::MeshLayerMapper::createStaticLayers(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), 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(), ProcessLib::LIE::anonymous_namespace{MeshUtils.cpp}::IsCrackTip::IsCrackTip(), MeshLib::MeshLayerMapper::layerMapping(), main(), MeshGeoToolsLib::GeoMapper::mapOnMesh(), MeshGeoToolsLib::MeshNodesAlongPolyline::MeshNodesAlongPolyline(), MeshGeoToolsLib::MeshNodesAlongSurface::MeshNodesAlongSurface(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), MeshLib::projectMeshOntoPlane(), MeshLib::VtkMappedMeshSource::RequestInformation(), MeshLib::MeshRevision::resetNodeIDs(), MeshLib::NodeSearch::searchNodesConnectedToOnlyGivenElements(), MeshLib::NodeSearch::searchUnused(), ElementTreeModel::setMesh(), and MeshLib::IO::Legacy::MeshIO::write().

96 { return _nodes.size(); }
std::vector< Node * > _nodes
Definition: Mesh.h:170

◆ getProperties() [1/2]

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

Definition at line 131 of file Mesh.h.

Referenced by MeshElementRemovalDialog::accept(), MeshLib::addLayerToMesh(), MeshLib::addPropertyToMesh(), MeshElementRemovalDialog::addScalarArrays(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), MeshLib::ElementValueModification::condense(), ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), constructMesh(), containsCellVecs(), MeshLib::RasterToMesh::convert(), MeshLib::VtkMeshConverter::convertScalarArrays(), MeshLib::convertToLinearMesh(), ProcessLib::LIE::PostProcessTool::copyProperties(), MeshLib::createFlippedMesh(), ParameterLib::createGroupBasedParameter(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ParameterLib::createMeshElementParameter(), ParameterLib::createMeshNodeParameter(), ProcessLib::RichardsComponentTransport::createPorousMediaProperties(), ProcessLib::LIE::PostProcessTool::createProperties(), MeshLib::createQuadraticOrderMesh(), ProcessLib::createSourceTerm(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowWithPrhoProcess(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::GenericNaturalBoundaryCondition(), MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(), ProcessLib::PythonBoundaryCondition::getEssentialBCValues(), ProcessLib::getIntegrationPointMetaData(), MeshLib::MeshSurfaceExtraction::getMeshSurface(), MeshLib::getOrCreateMeshProperty(), NumLib::MeshComponentMap::getSubset(), getSurfaceIntegratedValuesForNodes(), MeshLib::MeshInformation::getValueBounds(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshElements(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), MeshLib::Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(), MeshLib::IO::Legacy::MeshIO::loadMeshFromFile(), mapArray(), MeshLib::materialIDs(), MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(), ChemistryLib::PhreeqcIOData::operator<<(), ChemistryLib::PhreeqcIOData::operator>>(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), FileIO::GMSH::readGMSHMesh(), MeshLib::removeElements(), MeshLib::removeNodes(), MeshLib::ElementValueModification::replace(), MeshLib::VtkMappedMeshSource::RequestData(), MeshLib::scaleMeshPropertyVector(), MeshLib::ElementSearch::searchByPropertyValueRange(), ChemistryLib::PhreeqcIOData::PhreeqcIO::setAqueousSolutionsOrUpdateProcessSolutions(), MeshLib::ElementValueModification::setByElementType(), ElementTreeModel::setMesh(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), MeshLib::MeshRevision::simplifyMesh(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), anonymous_namespace{IdentifySubdomainMesh.cpp}::updateOrCheckExistingSubdomainProperty(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::TetGenInterface::write2dElements(), FileIO::SHPInterface::write2dMeshToSHP(), and FileIO::TetGenInterface::write3dElements().

131 { return _properties; }
Properties _properties
Definition: Mesh.h:173

◆ getProperties() [2/2]

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

Definition at line 132 of file Mesh.h.

132 { return _properties; }
Properties _properties
Definition: Mesh.h:173

◆ hasNonlinearElement()

bool MeshLib::Mesh::hasNonlinearElement ( ) const
protected

Check if the mesh contains any nonlinear element.

Definition at line 285 of file Mesh.cpp.

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

Referenced by Mesh().

286 {
287  return std::any_of(std::begin(_elements), std::end(_elements),
288  [](Element const* const e) {
289  return e->getNumberOfNodes() != e->getNumberOfBaseNodes();
290  });
291 }
std::vector< Element * > _elements
Definition: Mesh.h:171

◆ isAxiallySymmetric()

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

Definition at line 134 of file Mesh.h.

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

134 { return _is_axially_symmetric; }
bool _is_axially_symmetric
Definition: Mesh.h:175

◆ isBaseNode()

bool MeshLib::Mesh::isBaseNode ( std::size_t  node_idx) const
inline

Return true if the given node is a basic one (i.e. linear order node)

Definition at line 126 of file Mesh.h.

Referenced by MeshGeoToolsLib::MeshNodesOnPoint::MeshNodesOnPoint().

126 {return node_idx < _n_base_nodes; }
std::size_t _n_base_nodes
Definition: Mesh.h:172

◆ isNonlinear()

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

Return true if the mesh has any nonlinear nodes.

Definition at line 129 of file Mesh.h.

Referenced by Mesh().

129 { return (getNumberOfNodes() != getNumberOfBaseNodes()); }
std::size_t getNumberOfNodes() const
Get the number of nodes.
Definition: Mesh.h:96
std::size_t getNumberOfBaseNodes() const
Get the number of base nodes.
Definition: Mesh.h:123

◆ recalculateMaxBaseNodeId()

void MeshLib::Mesh::recalculateMaxBaseNodeId ( )

Finds the maximum id among all of the base nodes.

Definition at line 141 of file Mesh.cpp.

References _elements, and _n_base_nodes.

Referenced by Mesh().

142 {
143  std::size_t max_basenode_ID = 0;
144  for (Element const* e : _elements)
145  {
146  for (std::size_t i = 0; i < e->getNumberOfBaseNodes(); i++)
147  {
148  max_basenode_ID = std::max(max_basenode_ID, e->getNodeIndex(i));
149  }
150  }
151  _n_base_nodes = max_basenode_ID + 1;
152 }
std::vector< Element * > _elements
Definition: Mesh.h:171
std::size_t _n_base_nodes
Definition: Mesh.h:172

◆ resetElementIDs()

void MeshLib::Mesh::resetElementIDs ( )

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

Definition at line 154 of file Mesh.cpp.

References _elements.

Referenced by Mesh().

155 {
156  const std::size_t nElements (this->_elements.size());
157  for (unsigned i = 0; i < nElements; ++i)
158  {
159  _elements[i]->setID(i);
160  }
161 }
std::vector< Element * > _elements
Definition: Mesh.h:171

◆ resetNodeIDs()

void MeshLib::Mesh::resetNodeIDs ( )

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

Definition at line 132 of file Mesh.cpp.

References _nodes.

Referenced by Mesh(), and reorderNonlinearNodes().

133 {
134  const std::size_t nNodes(_nodes.size());
135  for (std::size_t i = 0; i < nNodes; ++i)
136  {
137  _nodes[i]->setID(i);
138  }
139 }
std::vector< Node * > _nodes
Definition: Mesh.h:170

◆ setAxiallySymmetric()

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

Definition at line 135 of file Mesh.h.

135  {
136  _is_axially_symmetric = is_axial_symmetric;
137  }
bool _is_axially_symmetric
Definition: Mesh.h:175

◆ setDimension()

void MeshLib::Mesh::setDimension ( )
protected

Sets the dimension of the mesh.

Definition at line 163 of file Mesh.cpp.

References _elements, _mesh_dimension, and getDimension().

Referenced by Mesh().

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

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

References _elements.

Referenced by Mesh().

205 {
206  std::vector<Element*> neighbors;
207  for (auto element : _elements)
208  {
209  // create vector with all elements connected to current element (includes lots of doubles!)
210  const std::size_t nNodes (element->getNumberOfBaseNodes());
211  for (unsigned n(0); n<nNodes; ++n)
212  {
213  std::vector<Element*> const& conn_elems ((element->getNode(n)->getElements()));
214  neighbors.insert(neighbors.end(), conn_elems.begin(), conn_elems.end());
215  }
216  std::sort(neighbors.begin(), neighbors.end());
217  auto const neighbors_new_end = std::unique(neighbors.begin(), neighbors.end());
218 
219  for (auto neighbor = neighbors.begin(); neighbor != neighbors_new_end; ++neighbor)
220  {
221  boost::optional<unsigned> const opposite_face_id = element->addNeighbor(*neighbor);
222  if (opposite_face_id)
223  {
224  (*neighbor)->setNeighbor(element, *opposite_face_id);
225  }
226  }
227  neighbors.clear();
228  }
229 }
std::vector< Element * > _elements
Definition: Mesh.h:171

◆ setElementsConnectedToNodes()

void MeshLib::Mesh::setElementsConnectedToNodes ( )
protected

Fills in the neighbor-information for nodes (i.e. which element each node belongs to).

Definition at line 175 of file Mesh.cpp.

References _elements.

Referenced by Mesh().

176 {
177  for (auto& element : _elements)
178  {
179  const unsigned nNodes(element->getNumberOfNodes());
180  for (unsigned j = 0; j < nNodes; ++j)
181  {
182  element->_nodes[j]->addElement(element);
183  }
184  }
185 }
std::vector< Element * > _elements
Definition: Mesh.h:171

◆ setName()

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

Changes the name of the mesh.

Definition at line 117 of file Mesh.h.

References MaterialPropertyLib::name.

Referenced by VtkVisPipelineView::showImageToMeshConversionDialog().

117 { this->_name = name; }
std::string _name
Definition: Mesh.h:169

◆ setNodesConnectedByElements()

void MeshLib::Mesh::setNodesConnectedByElements ( )
protected

Computes the element-connectivity of nodes. Two nodes i and j are connected if they are shared by an element.

Definition at line 231 of file Mesh.cpp.

References _nodes, MathLib::Point3dWithID::getID(), and MeshLib::Node::setConnectedNodes().

Referenced by Mesh().

232 {
233  // Allocate temporary space for adjacent nodes.
234  std::vector<Node*> adjacent_nodes;
235  for (Node* const node : _nodes)
236  {
237  adjacent_nodes.clear();
238 
239  // Get all elements, to which this node is connected.
240  std::vector<Element*> const& conn_elems = node->getElements();
241 
242  // And collect all elements' nodes.
243  for (Element const* const element : conn_elems)
244  {
245  Node* const* const single_elem_nodes = element->getNodes();
246  std::size_t const nnodes = element->getNumberOfNodes();
247  for (std::size_t n = 0; n < nnodes; n++)
248  {
249  adjacent_nodes.push_back(single_elem_nodes[n]);
250  }
251  }
252 
253  // Make nodes unique and sorted by their ids.
254  // This relies on the node's id being equivalent to it's address.
255  std::sort(adjacent_nodes.begin(), adjacent_nodes.end(),
256  [](Node* a, Node* b) { return a->getID() < b->getID(); });
257  auto const last = std::unique(adjacent_nodes.begin(), adjacent_nodes.end());
258  adjacent_nodes.erase(last, adjacent_nodes.end());
259 
260  node->setConnectedNodes(adjacent_nodes);
261  }
262 }
std::vector< Node * > _nodes
Definition: Mesh.h:170

Friends And Related Function Documentation

◆ ApplicationUtils::NodeWiseMeshPartitioner

Definition at line 46 of file Mesh.h.

◆ removeMeshNodes

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

Member Data Documentation

◆ _edge_length

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

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

Definition at line 166 of file Mesh.h.

Referenced by calcEdgeLengthRange().

◆ _elements

◆ _id

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

Definition at line 163 of file Mesh.h.

◆ _is_axially_symmetric

bool MeshLib::Mesh::_is_axially_symmetric = false
protected

Definition at line 175 of file Mesh.h.

◆ _mesh_dimension

unsigned MeshLib::Mesh::_mesh_dimension
protected

Definition at line 164 of file Mesh.h.

Referenced by Mesh(), and setDimension().

◆ _n_base_nodes

std::size_t MeshLib::Mesh::_n_base_nodes
protected

◆ _name

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

Definition at line 169 of file Mesh.h.

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

◆ _nodes

◆ _properties

Properties MeshLib::Mesh::_properties
protected

Definition at line 173 of file Mesh.h.


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