OGS
MeshLib::Element Class Referenceabstract

Detailed Description

Virtual base class for mesh elements.

Definition at line 33 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:202

References _neighbors.

◆ Element()

MeshLib::Element::Element ( std::size_t id)
explicitprotected

Constructor for a generic mesh element without an array of mesh nodes.

Parameters
idelement id

Definition at line 25 of file Element.cpp.

25: _id(id), _neighbors(nullptr) {}
std::size_t _id
Definition Element.h:200

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 _neighbors[this->identifyFace(face_nodes)] = e;
72 return std::optional<unsigned>(e->identifyFace(face_nodes));
73 }
74 }
75 }
76 }
77
78 return std::optional<unsigned>();
79}
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:106

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

◆ clone() [1/2]

virtual Element * MeshLib::Element::clone ( ) const
pure virtual

Method clone is a pure virtual method in the abstract base class Element. It has to be implemented in the derived classes (for instance in class Hex).

Returns
an exact copy of the object

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by MeshLib::cloneElements().

◆ clone() [2/2]

virtual Element * MeshLib::Element::clone ( Node ** nodes,
std::size_t id ) const
pure virtual

Constructs a new object polymorphically. This is similar to clone, but accepts new nodes and id.

Precondition
The length of the nodes vector is equal to the derived element's total number of nodes.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

◆ computeVolume()

virtual double MeshLib::Element::computeVolume ( )
pure virtual

Computes the length / area / volumen of this element. This is automatically done at initialisation time but can be repeated by calling this function at any time.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

◆ getBoundary()

virtual const Element * MeshLib::Element::getBoundary ( unsigned i) const
pure virtual

◆ getCellType()

virtual CellType MeshLib::Element::getCellType ( ) const
pure virtual

◆ getContent()

virtual double MeshLib::Element::getContent ( ) const
pure virtual

Returns the length, area or volume of a 1D, 2D or 3D element.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by MeshToolsLib::SizeDifferenceMetric::calculateQuality(), MeshLib::hasZeroVolume(), and ElementTreeModel::setElement().

◆ getDimension()

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

Get dimension of the mesh element.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by MeshLib::CoordinateSystem::CoordinateSystem(), MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::LiquidFlowLocalAssembler(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerFracture< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerFracture(), addNeighbor(), MeshToolsLib::ElementSizeMetric::calc2dOr3dQuality(), MeshLib::calculateNormalizedSurfaceNormal(), MeshToolsLib::SizeDifferenceMetric::calculateQuality(), NumLib::detail::computeMappingMatrices(), MeshToolsLib::createFlippedElement(), 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, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), and MeshToolsLib::MeshRevision::simplifyMesh().

◆ getEdge()

virtual const Element * MeshLib::Element::getEdge ( unsigned i) const
pure virtual

◆ getEdgeNode()

virtual Node * MeshLib::Element::getEdgeNode ( unsigned edge_id,
unsigned node_id ) const
pure virtual

◆ getFace()

◆ getGeomType()

◆ getID()

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

Returns the ID of the element.

Definition at line 89 of file Element.h.

89{ return _id; }

References _id.

Referenced by ProcessLib::ConstraintDirichletBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::ConstraintDirichletBoundaryConditionLocalAssembler(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::HTFEM(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerMatrix(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::LiquidFlowLocalAssembler(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::LocalAssemblerData(), 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(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::SmallDeformationNonlocalLocalAssembler(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::ThermoHydroMechanicsLocalAssembler(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicalPhaseFieldLocalAssembler(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicsLocalAssembler(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler(), ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::WellboreSimulatorFEM(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, GlobalDim >::assemble(), ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleBlockMatrices(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleComponentTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleHydraulicEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleKCmCn(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleReactionEquationConcrete(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobianComponentTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobianHydraulicEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::calculateIntPtDarcyVelocity(), NumLib::detail::checkJacobianDeterminant(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), 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 >::getFlux(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getHeatEnergyCoefficient(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getHeatEnergyCoefficient(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocityLocal(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtHeatFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtMolarFlux(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::getMaterialID(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getMaterialID(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::getMaterialID(), ProcessLib::TH2M::LocalAssemblerInterface< DisplacementDim >::getMaterialID(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getMaterialID(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::getMaterialID(), ParameterLib::MeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::Parameter< T >::getNodalValuesOnElement(), ParameterLib::RandomFieldMeshElementParameter< T >::getNodalValuesOnElement(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getThermalConductivityDispersivity(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getThermalConductivityDispersivity(), anonymous_namespace{MeshUtils.cpp}::getUniqueMaterialIds(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::initializeChemicalSystemConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::initializeConcrete(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, GlobalDim >::integrate(), ProcessLib::DeactivatedSubdomain::isDeactivated(), ProcessLib::HeatTransportBHE::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataSoil, LocalAssemblerDataBHE, ConstructorArgs >::makeLocalAssemblerBuilderBHE(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::preAssemble(), MeshGeoToolsLib::resetMeshElementProperty(), MeshLib::ElementSearch::searchByNodeIDs(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::setChemicalSystemConcrete(), ElementTreeModel::setElement(), ProcessLib::LIE::setFractureProperty(), ProcessLib::LargeDeformation::LargeDeformationLocalAssemblerInterface< DisplacementDim >::setIPDataInitialConditions(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::setIPDataInitialConditions(), ProcessLib::SmallDeformation::SmallDeformationLocalAssemblerInterface< DisplacementDim >::setIPDataInitialConditions(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::setIPDataInitialConditions(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::setIPDataInitialConditions(), MeshToolsLib::trackSurface(), and FileIO::TetGenInterface::write3dElements().

◆ getNeighbor()

virtual const Element * MeshLib::Element::getNeighbor ( unsigned i) const
pure virtual

◆ 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 >.

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(), 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]

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

◆ getNodes()

◆ getNumberOfBaseNodes()

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

◆ getNumberOfBoundaries()

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

◆ getNumberOfEdges()

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

◆ getNumberOfFaces()

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

Get the number of faces for this element.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by MeshLib::CellRule::testElementNodeOrder().

◆ getNumberOfNeighbors()

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

◆ 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 >.

Referenced by MeshLib::CoordinateSystem::CoordinateSystem(), MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrix(), ProcessLib::LIE::computePhysicalCoordinates(), MeshLib::computeSqrNodeDistanceRange(), MeshLib::copyElement(), MeshToolsLib::createFlippedElement(), MeshLib::findElementsWithinRadius(), ApplicationUtils::getElementIntegerVariables(), ParameterLib::ConstantParameter< T >::getNodalValuesOnElement(), ParameterLib::MeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::MeshNodeParameter< T >::getNodalValuesOnElement(), ParameterLib::Parameter< T >::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, GlobalDim, ConstructorArgs >::operator()(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), MeshLib::VtkMappedMeshSource::RequestData(), MeshGeoToolsLib::resetMeshElementProperty(), MeshGeoToolsLib::snapPointToElementNode(), and MeshLib::MeshElementGrid::sortElementInGridCells().

◆ identifyFace()

virtual unsigned MeshLib::Element::identifyFace ( Node const * nodes[3]) const
pure virtual

Returns the ID of a face given an array of nodes.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by addNeighbor().

◆ 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 81 of file Element.cpp.

82{
83 return std::any_of(_neighbors, _neighbors + this->getNumberOfNeighbors(),
84 [](MeshLib::Element const* const e)
85 { return e == nullptr; });
86}
virtual unsigned getNumberOfNeighbors() const =0
Get the number of neighbors for this element.

References _neighbors, and getNumberOfNeighbors().

◆ isEdge()

virtual bool MeshLib::Element::isEdge ( unsigned i,
unsigned j ) const
pure virtual

Returns true if these two indices form an edge and false otherwise.

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by anonymous_namespace{MeshRevision.cpp}::reduceHex().

◆ isPntInElement()

virtual bool MeshLib::Element::isPntInElement ( MathLib::Point3d const & pnt,
double eps = std::numeric_limits< double >::epsilon() ) const
pure virtual

Checks if a point is inside the element.

Parameters
pnta 3D MathLib::Point3d object
epstolerance for numerical algorithm used or computing the property
Returns
true if the point is not outside the element, false otherwise

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

◆ nodes()

◆ setID()

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

Sets the element ID.

Definition at line 198 of file Element.h.

198{ _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 _neighbors.

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

◆ setNode()

virtual void MeshLib::Element::setNode ( unsigned idx,
Node * node )
pure virtual

(Re)Sets the node of the element.

Parameters
idxthe index of the pointer to a node within the element
nodea pointer to a node

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by ProcessLib::LIE::PostProcessTool::PostProcessTool(), and LayeredVolume::removeCongruentElements().

◆ testElementNodeOrder()

virtual bool MeshLib::Element::testElementNodeOrder ( ) const
pure virtual

◆ validate()

virtual ElementErrorCode MeshLib::Element::validate ( ) const
pure virtual

Friends And Related Symbol Documentation

◆ Mesh

friend class Mesh
friend

Definition at line 35 of file Element.h.

◆ operator<<

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

Definition at line 88 of file Element.cpp.

89{
90 os << "Element #" << e._id << " @ " << &e << " with "
91 << e.getNumberOfNeighbors() << " neighbours\n";
92
93 unsigned const nnodes = e.getNumberOfNodes();
94 MeshLib::Node* const* const nodes = e.getNodes();
95 os << "MeshElemType: "
96 << static_cast<std::underlying_type<MeshElemType>::type>(e.getGeomType())
97 << " with " << nnodes << " nodes: {\n";
98 for (unsigned n = 0; n < nnodes; ++n)
99 {
100 os << " #" << nodes[n]->getID() << " @ " << nodes[n] << " coords ["
101 << *nodes[n] << "]\n";
102 }
103 return os << '}';
104}
constexpr std::span< Node *const > nodes() const
Span of element's nodes, their pointers actually.
Definition Element.h:72

Member Data Documentation

◆ _id

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

Definition at line 200 of file Element.h.

Referenced by getID(), and setID().

◆ _neighbors

◆ space_dimension_


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