OGS
MeshLib::Element Class Referenceabstract

Detailed Description

Virtual base class for mesh elements.

Definition at line 35 of file Element.h.

#include <Element.h>

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

Public Member Functions

std::optional< unsigned > addNeighbor (Element *e)
 Tries to add an element e as neighbour to this element. If the elements really are neighbours, the element is added to the neighbour-list and the face id of the neighbour connected to this element is returned. Otherwise the maximum value of the value type is returned.
virtual double getContent () const =0
 Returns the length, area or volume of a 1D, 2D or 3D element.
virtual const NodegetNode (unsigned idx) const =0
virtual NodegetNode (unsigned idx)=0
virtual void setNode (unsigned idx, Node *node)=0
virtual Node *const * getNodes () const =0
 Get array of element nodes.
constexpr std::span< Node *const > nodes () const
 Span of element's nodes, their pointers actually.
virtual constexpr unsigned getDimension () const =0
 Get dimension of the mesh element.
virtual const ElementgetEdge (unsigned i) const =0
 Returns the i-th edge of the element.
virtual const ElementgetFace (unsigned i) const =0
 Returns the i-th face of the element.
virtual const ElementgetBoundary (unsigned i) const =0
std::size_t getID () const
 Returns the ID of the element.
virtual unsigned getNumberOfBoundaries () const =0
virtual unsigned getNumberOfEdges () const =0
 Get the number of edges for this element.
virtual unsigned getNumberOfFaces () const =0
 Get the number of faces for this element.
virtual const ElementgetNeighbor (unsigned i) const =0
 Get the specified neighbor.
virtual unsigned getNumberOfNeighbors () const =0
 Get the number of neighbors for this element.
virtual unsigned getNumberOfBaseNodes () const =0
virtual unsigned getNumberOfNodes () const =0
virtual MeshElemType getGeomType () const =0
virtual CellType getCellType () const =0
virtual bool isBoundaryElement () const
virtual bool isEdge (unsigned i, unsigned j) const =0
 Returns true if these two indices form an edge and false otherwise.
virtual bool isPntInElement (MathLib::Point3d const &pnt, double eps=std::numeric_limits< double >::epsilon()) const =0
virtual ElementErrorCode validate () const =0
virtual ~Element ()
 Destructor.
virtual Elementclone () const =0
virtual Elementclone (Node **nodes, std::size_t id) const =0
virtual double computeVolume ()=0
virtual unsigned identifyFace (Node const *nodes[3]) const =0
 Returns the ID of a face given an array of nodes.
virtual bool testElementNodeOrder () const =0
virtual NodegetEdgeNode (unsigned edge_id, unsigned node_id) const =0
 Return a specific edge node.

Public Attributes

unsigned space_dimension_ = 3u
 Dimension of the space, where the element exists.

Protected Member Functions

 Element (std::size_t id)
void setID (std::size_t id)
 Sets the element ID.
void setNeighbor (Element *neighbor, unsigned const face_id)

Protected Attributes

std::size_t _id
Element ** _neighbors

Friends

class Mesh
std::ostream & operator<< (std::ostream &os, Element const &e)

Constructor & Destructor Documentation

◆ ~Element()

MeshLib::Element::~Element ( )
virtual

Destructor.

Definition at line 27 of file Element.cpp.

28{
29 delete[] this->_neighbors;
30}
Element ** _neighbors
Definition Element.h:204

References _neighbors.

◆ Element()

Member Function Documentation

◆ addNeighbor()

std::optional< unsigned > MeshLib::Element::addNeighbor ( Element * e)

Tries to add an element e as neighbour to this element. If the elements really are neighbours, the element is added to the neighbour-list and the face id of the neighbour connected to this element is returned. Otherwise the maximum value of the value type is returned.

Definition at line 42 of file Element.cpp.

43{
44 const unsigned dim(this->getDimension());
45 if (e == this || e == nullptr || e->getDimension() != dim)
46 {
47 return std::optional<unsigned>();
48 }
49
50 if (areNeighbors(this, e))
51 {
52 return std::optional<unsigned>();
53 }
54
55 Node const* face_nodes[3];
56 const unsigned nNodes(this->getNumberOfBaseNodes());
57 const unsigned eNodes(e->getNumberOfBaseNodes());
58 const Node* const* e_nodes = e->getNodes();
59 unsigned count(0);
60 for (unsigned i(0); i < nNodes; i++)
61 {
62 for (unsigned j(0); j < eNodes; j++)
63 {
64 if (getNode(i) == e_nodes[j])
65 {
66 face_nodes[count] = getNode(i);
67 // increment shared nodes counter and check if enough nodes are
68 // similar to be sure e is a neighbour of this
69 if ((++count) >= dim)
70 {
71 auto const this_face_id = this->identifyFace(face_nodes);
72 if (this_face_id == std::numeric_limits<unsigned>::max())
73 {
75 "Could not find face of {} for the face nodes [{}, "
76 "{}, {}].",
77 *this, *face_nodes[0], *face_nodes[1],
78 *face_nodes[2]);
79 }
80 _neighbors[this_face_id] = e;
81 auto const neighbors_face_id = e->identifyFace(face_nodes);
82 if (neighbors_face_id ==
83 std::numeric_limits<unsigned>::max())
84 {
86 "Could not find face of the neighbour {} for the "
87 "face nodes [{}, {}, {}].\n"
88 "For the {} the face id {} was identified.",
89 *e, *face_nodes[0], *face_nodes[1], *face_nodes[2],
90 *this, this_face_id);
91 }
92 return neighbors_face_id;
93 }
94 }
95 }
96 }
97
98 return std::optional<unsigned>();
99}
#define OGS_FATAL(...)
Definition Error.h:26
virtual unsigned getNumberOfBaseNodes() const =0
virtual const Node * getNode(unsigned idx) const =0
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.
virtual unsigned identifyFace(Node const *nodes[3]) const =0
Returns the ID of a face given an array of nodes.
bool areNeighbors(Element const *const element, Element const *const other)
Returns true if elem is a neighbour of this element and false otherwise.
Definition Element.cpp:124

References Element(), _neighbors, MeshLib::areNeighbors(), getDimension(), getNode(), getNodes(), getNumberOfBaseNodes(), identifyFace(), and OGS_FATAL.

◆ clone() [1/2]

◆ clone() [2/2]

◆ computeVolume()

◆ getBoundary()

◆ getCellType()

◆ getContent()

◆ getDimension()

virtual constexpr unsigned MeshLib::Element::getDimension ( ) const
constexprpure virtual

Get dimension of the mesh element.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >, MeshLib::TemplateElement< MeshLib::HexRule20 >, MeshLib::TemplateElement< MeshLib::HexRule8 >, MeshLib::TemplateElement< MeshLib::LineRule2 >, MeshLib::TemplateElement< MeshLib::LineRule3 >, MeshLib::TemplateElement< MeshLib::PrismRule15 >, MeshLib::TemplateElement< MeshLib::PrismRule6 >, MeshLib::TemplateElement< MeshLib::PyramidRule13 >, MeshLib::TemplateElement< MeshLib::PyramidRule5 >, MeshLib::TemplateElement< MeshLib::QuadRule4 >, MeshLib::TemplateElement< MeshLib::QuadRule8 >, MeshLib::TemplateElement< MeshLib::QuadRule9 >, MeshLib::TemplateElement< MeshLib::TetRule10 >, MeshLib::TemplateElement< MeshLib::TetRule4 >, MeshLib::TemplateElement< MeshLib::TriRule3 >, MeshLib::TemplateElement< MeshLib::TriRule6 >, and MeshLib::TemplateElement< PointRule1 >.

Referenced by MeshLib::CoordinateSystem::CoordinateSystem(), MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssemblerFracture(), addNeighbor(), MeshToolsLib::ElementSizeMetric::calc2dOr3dQuality(), MeshLib::calculateNormalizedSurfaceNormal(), MeshToolsLib::SizeDifferenceMetric::calculateQuality(), NumLib::detail::computeMappingMatrices(), ProcessLib::computeShapeMatrix(), MeshToolsLib::createFlippedElement(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess(), MeshToolsLib::MeshLayerMapper::createStaticLayers(), anonymous_namespace{MeshUtils.cpp}::extractOneDimensionalElements(), MeshToolsLib::extrudeElement(), ProcessLib::HeatTransportBHE::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataSoil, LocalAssemblerDataBHE, ConstructorArgs >::makeLocalAssemblerBuilder(), ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::makeLocalAssemblerBuilder(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::makeLocalAssemblerBuilder(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::operator()(), and MeshToolsLib::MeshRevision::simplifyMesh().

◆ getEdge()

◆ getEdgeNode()

◆ getFace()

◆ getGeomType()

virtual MeshElemType MeshLib::Element::getGeomType ( ) const
pure virtual

Get the type of the mesh element in geometric context (as a MeshElemType-enum).

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >, MeshLib::TemplateElement< MeshLib::HexRule20 >, MeshLib::TemplateElement< MeshLib::HexRule8 >, MeshLib::TemplateElement< MeshLib::LineRule2 >, MeshLib::TemplateElement< MeshLib::LineRule3 >, MeshLib::TemplateElement< MeshLib::PrismRule15 >, MeshLib::TemplateElement< MeshLib::PrismRule6 >, MeshLib::TemplateElement< MeshLib::PyramidRule13 >, MeshLib::TemplateElement< MeshLib::PyramidRule5 >, MeshLib::TemplateElement< MeshLib::QuadRule4 >, MeshLib::TemplateElement< MeshLib::QuadRule8 >, MeshLib::TemplateElement< MeshLib::QuadRule9 >, MeshLib::TemplateElement< MeshLib::TetRule10 >, MeshLib::TemplateElement< MeshLib::TetRule4 >, MeshLib::TemplateElement< MeshLib::TriRule3 >, MeshLib::TemplateElement< MeshLib::TriRule6 >, and MeshLib::TemplateElement< PointRule1 >.

Referenced by ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::NormalTractionBoundaryConditionLocalAssembler(), anonymous_namespace{convertMeshToGeo.cpp}::addElementToSurface(), MeshToolsLib::MeshLayerMapper::addLayerToMesh(), MeshToolsLib::createFlippedElement(), MeshToolsLib::MeshLayerMapper::createStaticLayers(), MeshToolsLib::extrudeElement(), MeshToolsLib::MeshSurfaceExtraction::getSurfaceAreaForNodes(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::getSurfaceNormal(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), MeshLib::isPointInElementXY(), operator<<, anonymous_namespace{MeshRevision.cpp}::reduceElement(), anonymous_namespace{MeshRevision.cpp}::reduceHex(), ElementTreeModel::setElement(), anonymous_namespace{MeshRevision.cpp}::subdivideElement(), and FileIO::TetGenInterface::writeElementToFacets().

◆ getID()

std::size_t MeshLib::Element::getID ( ) const
inline

Returns the ID of the element.

Definition at line 91 of file Element.h.

91{ return _id; }

References _id.

Referenced by ProcessLib::HMPhaseField::HMPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::HMPhaseFieldLocalAssembler(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssemblerMatrix(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrixNearFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssemblerMatrixNearFracture(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::PhaseFieldLocalAssembler(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerFracture< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerFracture(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrixNearFracture(), MeshLib::TemplateElement< ELEMENT_RULE >::TemplateElement(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::ThermoHydroMechanicsLocalAssembler(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicsLocalAssembler(), NumLib::detail::checkJacobianDeterminant(), convertLinearToQuadratic(), MeshToolsLib::createFlippedElement(), MeshGeoToolsLib::createSubSegmentsForElement(), MeshToolsLib::createSurfaceElementsFromElement(), MeshLib::findElementsWithinRadius(), ProcessLib::HeatTransportBHE::getBHEDataInMesh(), MeshLib::LinearEdgeReturn::getEdge(), MeshLib::QuadraticEdgeReturn::getEdge(), MeshLib::HexRule20::getFace(), MeshLib::HexRule8::getFace(), MeshLib::PrismRule15::getFace(), MeshLib::PrismRule6::getFace(), MeshLib::PyramidRule13::getFace(), MeshLib::PyramidRule5::getFace(), MeshLib::TetRule10::getFace(), MeshLib::TetRule4::getFace(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getHeatEnergyCoefficient(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getHeatEnergyCoefficient(), ParameterLib::MeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::Parameter< double >::getNodalValuesOnElement(), ParameterLib::RandomFieldMeshElementParameter< T >::getNodalValuesOnElement(), anonymous_namespace{MeshUtils.cpp}::getUniqueMaterialIds(), ProcessLib::DeactivatedSubdomain::isDeactivated(), ProcessLib::HeatTransportBHE::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataSoil, LocalAssemblerDataBHE, ConstructorArgs >::makeLocalAssemblerBuilderBHE(), MeshLib::ElementSearch::searchByNodeIDs(), ElementTreeModel::setElement(), ProcessLib::LIE::setFractureProperty(), MeshToolsLib::trackSurface(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::updateElementLevelSets(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::updateElementLevelSets(), and FileIO::TetGenInterface::write3dElements().

◆ getNeighbor()

◆ getNode() [1/2]

virtual const Node * MeshLib::Element::getNode ( unsigned idx) const
pure virtual

Get node with local index where the local index should be at most the number of nodes of the element.

Parameters
idxlocal index of node, at most the number of nodes of the element that you can obtain with Element::getNumberOfBaseNodes()
Returns
a pointer to the appropriate (and constant, i.e. not modifiable by the user) instance of class Node or a nullptr
See also
getNodeIndex()

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >, MeshLib::TemplateElement< MeshLib::HexRule20 >, MeshLib::TemplateElement< MeshLib::HexRule8 >, MeshLib::TemplateElement< MeshLib::LineRule2 >, MeshLib::TemplateElement< MeshLib::LineRule3 >, MeshLib::TemplateElement< MeshLib::PrismRule15 >, MeshLib::TemplateElement< MeshLib::PrismRule6 >, MeshLib::TemplateElement< MeshLib::PyramidRule13 >, MeshLib::TemplateElement< MeshLib::PyramidRule5 >, MeshLib::TemplateElement< MeshLib::QuadRule4 >, MeshLib::TemplateElement< MeshLib::QuadRule8 >, MeshLib::TemplateElement< MeshLib::QuadRule9 >, MeshLib::TemplateElement< MeshLib::TetRule10 >, MeshLib::TemplateElement< MeshLib::TetRule4 >, MeshLib::TemplateElement< MeshLib::TriRule3 >, MeshLib::TemplateElement< MeshLib::TriRule6 >, and MeshLib::TemplateElement< PointRule1 >.

Referenced by MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::NormalTractionBoundaryConditionLocalAssembler(), ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::WellboreSimulatorFEM(), MeshToolsLib::MeshGenerator::AddFaultToVoxelGrid::addFaultToVoxelGrid(), addNeighbor(), MeshLib::calculateNormalizedSurfaceNormal(), MeshToolsLib::anonymous_namespace{AngleSkewMetric.cpp}::checkQuad(), MeshToolsLib::anonymous_namespace{AngleSkewMetric.cpp}::checkTriangle(), anonymous_namespace{CollectAndInterpolateNodalDof.cpp}::collectDofsToMatrixSingleComponentForSomeNodes(), ProcessLib::LIE::computePhysicalCoordinates(), MeshLib::computeSqrNodeDistanceRange(), anonymous_namespace{MeshRevision.cpp}::constructFourNodeElement(), anonymous_namespace{MeshRevision.cpp}::constructLine(), anonymous_namespace{MeshRevision.cpp}::constructTri(), convertLinearToQuadratic(), MeshLib::copyElement(), MeshToolsLib::createFlippedElement(), FileIO::SHPInterface::createShapeObject(), MeshToolsLib::MeshLayerMapper::createStaticLayers(), MeshToolsLib::extrudeElement(), MeshLib::findElementsWithinRadius(), anonymous_namespace{MeshRevision.cpp}::findPyramidTopNode(), MeshLib::getCenterOfGravity(), ApplicationUtils::getElementIntegerVariables(), MeshToolsLib::ProjectPointOnMesh::getElevation(), MeshLib::HexRule20::getFace(), MeshLib::HexRule8::getFace(), MeshLib::PrismRule15::getFace(), MeshLib::PrismRule6::getFace(), MeshLib::PyramidRule13::getFace(), MeshLib::PyramidRule5::getFace(), MeshLib::TetRule10::getFace(), MeshLib::TetRule4::getFace(), MeshLib::FaceRule::getFirstSurfaceVector(), ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::getNodeCoords(), MeshLib::getNodeIDinElement(), MeshLib::getNodeIndex(), anonymous_namespace{MeshRevision.cpp}::getNumberOfUniqueNodes(), MeshLib::FaceRule::getSecondSurfaceVector(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::getSurfaceNormal(), MeshLib::isPointInElementXY(), MeshGeoToolsLib::mapPointOnSurfaceElement(), anonymous_namespace{MeshRevision.cpp}::reduceHex(), anonymous_namespace{MeshRevision.cpp}::reducePrism(), ElementTreeModel::setElement(), MeshGeoToolsLib::snapPointToElementNode(), MeshLib::MeshElementGrid::sortElementInGridCells(), and MeshLib::CellRule::testElementNodeOrder().

◆ getNode() [2/2]

◆ getNodes()

virtual Node *const * MeshLib::Element::getNodes ( ) const
pure virtual

◆ getNumberOfBaseNodes()

virtual unsigned MeshLib::Element::getNumberOfBaseNodes ( ) const
pure virtual

Returns the number of linear nodes.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >, MeshLib::TemplateElement< MeshLib::HexRule20 >, MeshLib::TemplateElement< MeshLib::HexRule8 >, MeshLib::TemplateElement< MeshLib::LineRule2 >, MeshLib::TemplateElement< MeshLib::LineRule3 >, MeshLib::TemplateElement< MeshLib::PrismRule15 >, MeshLib::TemplateElement< MeshLib::PrismRule6 >, MeshLib::TemplateElement< MeshLib::PyramidRule13 >, MeshLib::TemplateElement< MeshLib::PyramidRule5 >, MeshLib::TemplateElement< MeshLib::QuadRule4 >, MeshLib::TemplateElement< MeshLib::QuadRule8 >, MeshLib::TemplateElement< MeshLib::QuadRule9 >, MeshLib::TemplateElement< MeshLib::TetRule10 >, MeshLib::TemplateElement< MeshLib::TetRule4 >, MeshLib::TemplateElement< MeshLib::TriRule3 >, MeshLib::TemplateElement< MeshLib::TriRule6 >, and MeshLib::TemplateElement< PointRule1 >.

Referenced by addNeighbor(), MeshToolsLib::RadiusEdgeRatioMetric::calculateQuality(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrixOnBaseNodesSingleComponent(), MeshLib::computeSqrNodeDistanceRange(), anonymous_namespace{MeshRevision.cpp}::constructFourNodeElement(), anonymous_namespace{MeshRevision.cpp}::constructLine(), anonymous_namespace{MeshRevision.cpp}::constructTri(), convertLinearToQuadratic(), FileIO::SHPInterface::createShapeObject(), MeshToolsLib::MeshLayerMapper::createStaticLayers(), MeshToolsLib::extrudeElement(), anonymous_namespace{MeshRevision.cpp}::findPyramidTopNode(), MeshLib::getCenterOfGravity(), anonymous_namespace{MeshRevision.cpp}::getNumberOfUniqueNodes(), MeshLib::Mesh::hasNonlinearElement(), anonymous_namespace{BoundaryElementsAlongPolyline.cpp}::includesAllEdgeNodeIDs(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), NumLib::interpolateToHigherOrderNodes(), MeshLib::isPointInElementXY(), ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::operator()(), LayeredVolume::removeCongruentElements(), ElementTreeModel::setElement(), FileIO::FEFLOWMeshInterface::setMaterialIDs(), and MeshToolsLib::MeshRevision::simplifyMesh().

◆ getNumberOfBoundaries()

◆ getNumberOfEdges()

◆ getNumberOfFaces()

◆ getNumberOfNeighbors()

◆ getNumberOfNodes()

virtual unsigned MeshLib::Element::getNumberOfNodes ( ) const
pure virtual

Returns the number of all nodes including both linear and nonlinear nodes

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >, MeshLib::TemplateElement< MeshLib::HexRule20 >, MeshLib::TemplateElement< MeshLib::HexRule8 >, MeshLib::TemplateElement< MeshLib::LineRule2 >, MeshLib::TemplateElement< MeshLib::LineRule3 >, MeshLib::TemplateElement< MeshLib::PrismRule15 >, MeshLib::TemplateElement< MeshLib::PrismRule6 >, MeshLib::TemplateElement< MeshLib::PyramidRule13 >, MeshLib::TemplateElement< MeshLib::PyramidRule5 >, MeshLib::TemplateElement< MeshLib::QuadRule4 >, MeshLib::TemplateElement< MeshLib::QuadRule8 >, MeshLib::TemplateElement< MeshLib::QuadRule9 >, MeshLib::TemplateElement< MeshLib::TetRule10 >, MeshLib::TemplateElement< MeshLib::TetRule4 >, MeshLib::TemplateElement< MeshLib::TriRule3 >, MeshLib::TemplateElement< MeshLib::TriRule6 >, and MeshLib::TemplateElement< PointRule1 >.

Referenced by MeshLib::CoordinateSystem::CoordinateSystem(), MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrix(), ProcessLib::LIE::computePhysicalCoordinates(), ProcessLib::computeShapeMatrix(), MeshLib::computeSqrNodeDistanceRange(), MeshLib::copyElement(), MeshToolsLib::createFlippedElement(), MeshLib::findElementsWithinRadius(), ApplicationUtils::getElementIntegerVariables(), ParameterLib::ConstantParameter< T >::getNodalValuesOnElement(), ParameterLib::MeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::MeshNodeParameter< T >::getNodalValuesOnElement(), ParameterLib::Parameter< double >::getNodalValuesOnElement(), ParameterLib::RandomFieldMeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::RasterParameter::getNodalValuesOnElement(), MeshLib::getNodeIDinElement(), MeshLib::getNodeIndex(), MeshLib::Mesh::hasNonlinearElement(), NumLib::interpolateToHigherOrderNodes(), nodes(), ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::operator()(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::operator()(), operator<<, MeshLib::VtkMappedMeshSource::RequestData(), MeshGeoToolsLib::snapPointToElementNode(), and MeshLib::MeshElementGrid::sortElementInGridCells().

◆ identifyFace()

◆ isBoundaryElement()

bool MeshLib::Element::isBoundaryElement ( ) const
virtual

Returns true if the element is located at a boundary (i.e. has at least one face without neighbour)

Definition at line 101 of file Element.cpp.

102{
103 return std::any_of(_neighbors, _neighbors + this->getNumberOfNeighbors(),
104 [](MeshLib::Element const* const e)
105 { return e == nullptr; });
106}
virtual unsigned getNumberOfNeighbors() const =0
Get the number of neighbors for this element.

References _neighbors, and getNumberOfNeighbors().

◆ isEdge()

◆ isPntInElement()

◆ nodes()

◆ setID()

void MeshLib::Element::setID ( std::size_t id)
inlineprotected

Sets the element ID.

Definition at line 200 of file Element.h.

200{ _id = id; }

References _id.

◆ setNeighbor()

void MeshLib::Element::setNeighbor ( Element * neighbor,
unsigned const face_id )
protected

Sets the neighbor over the face with face_id to the given neighbor.

Definition at line 32 of file Element.cpp.

33{
34 if (neighbor == this)
35 {
36 return;
37 }
38
39 this->_neighbors[face_id] = neighbor;
40}

References Element(), and _neighbors.

Referenced by MeshLib::Mesh::setElementNeighbors().

◆ setNode()

◆ testElementNodeOrder()

◆ validate()

◆ Mesh

friend class Mesh
friend

Definition at line 37 of file Element.h.

References Element(), and Mesh.

Referenced by Mesh.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Element const & e )
friend

Definition at line 108 of file Element.cpp.

109{
110 os << "element #" << e._id << " @ " << &e << " with "
111 << e.getNumberOfNeighbors() << " neighbours\n";
112
113 unsigned const nnodes = e.getNumberOfNodes();
114 MeshLib::Node* const* const nodes = e.getNodes();
115 os << "MeshElemType: " << MeshLib::MeshElemType2String(e.getGeomType())
116 << " with " << nnodes << " nodes: {\n";
117 for (unsigned n = 0; n < nnodes; ++n)
118 {
119 os << " " << *nodes[n] << " @ " << nodes[n] << '\n';
120 }
121 return os << '}';
122}
constexpr std::span< Node *const > nodes() const
Span of element's nodes, their pointers actually.
Definition Element.h:74
std::string MeshElemType2String(const MeshElemType t)
Given a MeshElemType this returns the appropriate string.
Definition MeshEnums.cpp:21

References Element(), _id, getGeomType(), getNodes(), getNumberOfNeighbors(), getNumberOfNodes(), MeshLib::MeshElemType2String(), and nodes().

Member Data Documentation

◆ _id

std::size_t MeshLib::Element::_id
protected

Definition at line 202 of file Element.h.

Referenced by Element(), getID(), operator<<, and setID().

◆ _neighbors

◆ space_dimension_


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