OGS
MeshLib::Element Class Referenceabstract

Detailed Description

Virtual base class for mesh elements.

Definition at line 32 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. More...
 
virtual double getContent () const =0
 Returns the length, area or volume of a 1D, 2D or 3D element. More...
 
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. More...
 
virtual constexpr unsigned getDimension () const =0
 Get dimension of the mesh element. More...
 
virtual const ElementgetEdge (unsigned i) const =0
 Returns the i-th edge of the element. More...
 
virtual const ElementgetFace (unsigned i) const =0
 Returns the i-th face of the element. More...
 
virtual const ElementgetBoundary (unsigned i) const =0
 
virtual std::size_t getID () const final
 Returns the ID of the element. More...
 
virtual unsigned getNumberOfBoundaries () const =0
 
virtual unsigned getNumberOfEdges () const =0
 Get the number of edges for this element. More...
 
virtual unsigned getNumberOfFaces () const =0
 Get the number of faces for this element. More...
 
virtual const ElementgetNeighbor (unsigned i) const =0
 Get the specified neighbor. More...
 
virtual unsigned getNumberOfNeighbors () const =0
 Get the number of neighbors for this element. More...
 
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. More...
 
virtual bool isPntInElement (MathLib::Point3d const &pnt, double eps=std::numeric_limits< double >::epsilon()) const =0
 
virtual ElementErrorCode validate () const =0
 
virtual ~Element ()
 Destructor. More...
 
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. More...
 
virtual bool testElementNodeOrder () const =0
 
virtual NodegetEdgeNode (unsigned edge_id, unsigned node_id) const =0
 Return a specific edge node. More...
 

Public Attributes

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

Protected Member Functions

 Element (std::size_t id)
 
virtual void setID (std::size_t id) final
 Sets the element ID. More...
 
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:197

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:195

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 const Node * getNode(unsigned idx) const =0
virtual unsigned getNumberOfBaseNodes() 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:108

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

Get the type of the element in context of the finite element method.

Returns
a value of the enum FEMElemType::type

Implemented in MeshLib::TemplateElement< ELEMENT_RULE >.

Referenced by createQuadraticElement(), and ApplicationUtils::getElementIntegerVariables().

◆ getContent()

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

◆ 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, IntegrationMethod, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerFracture< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerFracture(), addNeighbor(), MeshLib::ElementSizeMetric::calc2dQuality(), MeshLib::ElementSizeMetric::calc3dQuality(), MeshLib::calculateNormalizedSurfaceNormal(), MeshLib::SizeDifferenceMetric::calculateQuality(), ProcessLib::HeatTransportBHE::compute1Dto3DRotationMatrix(), NumLib::computeShapeMatrices(), MeshLib::createFlippedElement(), MeshLib::MeshLayerMapper::createStaticLayers(), anonymous_namespace{MeshUtils.cpp}::extractOneDimensionalElements(), MeshLib::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 MeshLib::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()

virtual std::size_t MeshLib::Element::getID ( ) const
inlinefinalvirtual

Returns the ID of the element.

Definition at line 82 of file Element.h.

82 { return _id; }

References _id.

Referenced by ProcessLib::ConstraintDirichletBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::ConstraintDirichletBoundaryConditionLocalAssembler(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::HydroMechanicsLocalAssemblerMatrix(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::LocalAssemblerData(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::PhaseFieldLocalAssembler(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::RichardsMechanicsLocalAssembler(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssembler(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerFracture< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerFracture(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerMatrixNearFracture(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationNonlocalLocalAssembler(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::TH2MLocalAssembler(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::ThermoHydroMechanicsLocalAssembler(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoMechanicalPhaseFieldLocalAssembler(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoMechanicsLocalAssembler(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::ThermoRichardsFlowLocalAssembler(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoRichardsMechanicsLocalAssembler(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleBlockMatrices(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleComponentTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleHydraulicEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleReactionEquationConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleWithJacobian(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::calculateIntPtDarcyVelocity(), NumLib::detail::checkJacobianDeterminant(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), convertLinearToQuadratic(), MeshLib::createFlippedElement(), MeshLib::anonymous_namespace{ConvertToLinearMesh.cpp}::createLinearElement(), MeshGeoToolsLib::createSubSegmentsForElement(), MeshLib::createSurfaceElementsFromElement(), anonymous_namespace{IdentifySubdomainMesh.cpp}::findElementsInMesh(), 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::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::LIE::getFractureMatrixDataInMesh(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getHeatEnergyCoefficient(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocityLocal(), ParameterLib::Parameter< T >::getNodalValuesOnElement(), ParameterLib::MeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::RandomFieldMeshElementParameter< T >::getNodalValuesOnElement(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getThermalConductivityDispersivity(), anonymous_namespace{MeshUtils.cpp}::getUniqueMaterialIds(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::initializeChemicalSystemConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::integrate(), ProcessLib::HeatTransportBHE::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataSoil, LocalAssemblerDataBHE, ConstructorArgs >::makeLocalAssemblerBuilderBHE(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::postTimestepConcrete(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::preAssemble(), MeshGeoToolsLib::resetMeshElementProperty(), MeshLib::ElementSearch::searchByNodeIDs(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::setChemicalSystemConcrete(), ElementTreeModel::setElement(), ProcessLib::LIE::setFractureProperty(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::setIPDataInitialConditions(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::setIPDataInitialConditions(), MeshLib::trackSurface(), ProcessLib::ProcessVariable::updateDeactivatedSubdomains(), 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, IntegrationMethod, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::NormalTractionBoundaryConditionLocalAssembler(), addNeighbor(), ProcessLib::PythonBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::SourceTerms::Python::PythonSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), MeshLib::calculateNormalizedSurfaceNormal(), MeshLib::anonymous_namespace{AngleSkewMetric.cpp}::checkHexahedron(), MeshLib::anonymous_namespace{AngleSkewMetric.cpp}::checkPrism(), MeshLib::anonymous_namespace{AngleSkewMetric.cpp}::checkQuad(), MeshLib::anonymous_namespace{AngleSkewMetric.cpp}::checkTetrahedron(), MeshLib::anonymous_namespace{AngleSkewMetric.cpp}::checkTriangle(), ProcessLib::LIE::computePhysicalCoordinates(), MeshLib::computeSqrNodeDistanceRange(), MeshLib::MeshRevision::constructFourNodeElement(), MeshLib::MeshRevision::constructLine(), MeshLib::MeshRevision::constructTri(), convertLinearToQuadratic(), MeshLib::copyElement(), MeshLib::createFlippedElement(), MeshLib::anonymous_namespace{ConvertToLinearMesh.cpp}::createLinearElement(), FileIO::SHPInterface::createShapeObject(), MeshLib::MeshLayerMapper::createStaticLayers(), MeshLib::extrudeElement(), MeshLib::findElementsWithinRadius(), MeshLib::MeshRevision::findPyramidTopNode(), MeshLib::getCenterOfGravity(), ApplicationUtils::getElementIntegerVariables(), MeshLib::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(), MeshLib::MeshRevision::getNumberOfUniqueNodes(), MeshLib::FaceRule::getSecondSurfaceVector(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::integrate(), MeshLib::isPointInElementXY(), MeshGeoToolsLib::mapPointOnSurfaceElement(), MeshLib::MeshRevision::reduceHex(), MeshLib::MeshRevision::reducePrism(), ElementTreeModel::setElement(), MeshGeoToolsLib::snapPointToElementNode(), MeshLib::MeshElementGrid::sortElementInGridCells(), MeshLib::MeshRevision::subdivideHex(), MeshLib::MeshRevision::subdividePrism(), MeshLib::MeshRevision::subdividePyramid(), MeshLib::MeshRevision::subdivideQuad(), and MeshLib::CellRule::testElementNodeOrder().

◆ getNode() [2/2]

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

◆ getNodes()

◆ getNumberOfBaseNodes()

◆ 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::PythonBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::LIE::computePhysicalCoordinates(), MeshLib::computeSqrNodeDistanceRange(), MeshLib::copyElement(), MeshLib::createFlippedElement(), MeshLib::findElementsWithinRadius(), ApplicationUtils::getElementIntegerVariables(), ParameterLib::Parameter< T >::getNodalValuesOnElement(), ParameterLib::MeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::MeshNodeParameter< T >::getNodalValuesOnElement(), ParameterLib::RandomFieldMeshElementParameter< T >::getNodalValuesOnElement(), ParameterLib::ConstantParameter< T >::getNodalValuesOnElement(), MeshLib::getNodeIDinElement(), MeshLib::getNodeIndex(), MeshLib::Mesh::hasNonlinearElement(), NumLib::interpolateToHigherOrderNodes(), ApplicationUtils::numberOfRegularNodes(), 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(), MeshLib::ElementStatus::setElementStatus(), MeshGeoToolsLib::snapPointToElementNode(), and MeshLib::MeshElementGrid::sortElementInGridCells().

◆ identifyFace()

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

◆ 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 {
84  [](MeshLib::Element const* const e)
85  { return e == nullptr; });
86 }
virtual unsigned getNumberOfNeighbors() const =0
Get the number of neighbors for this element.
constexpr bool any_of(List const &values)
Checks if any of the elements in the given list is true.
Definition: Algorithm.h:315

References _neighbors, BaseLib::any_of(), 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 MeshLib::MeshRevision::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 >.

◆ setID()

virtual void MeshLib::Element::setID ( std::size_t  id)
inlinefinalprotectedvirtual

Sets the element ID.

Definition at line 193 of file Element.h.

193 { _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 Function Documentation

◆ Mesh

friend class Mesh
friend

Definition at line 34 of file Element.h.

◆ operator<<

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

Definition at line 89 of file Element.cpp.

90 {
91  os << "Element #" << e._id << " @ " << &e << " with "
92  << e.getNumberOfNeighbors() << " neighbours\n";
93 
94  unsigned const nnodes = e.getNumberOfNodes();
95  MeshLib::Node* const* const nodes = e.getNodes();
96  os << "MeshElemType: "
97  << static_cast<std::underlying_type<MeshElemType>::type>(e.getGeomType())
98  << " with " << nnodes << " nodes: { ";
99  for (unsigned n = 0; n < nnodes; ++n)
100  {
101  os << nodes[n]->getID() << " @ " << nodes[n] << " ";
102  }
103  os << "}\n";
104  return os;
105 }
std::size_t getID() const
Definition: Point3dWithID.h:62

Member Data Documentation

◆ _id

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

Definition at line 195 of file Element.h.

Referenced by getID(), and setID().

◆ _neighbors

◆ space_dimension_

unsigned MeshLib::Element::space_dimension_ = 3u

Dimension of the space, where the element exists.

Definition at line 185 of file Element.h.

Referenced by MeshLib::ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(), and MeshLib::TemplateElement< ELEMENT_RULE >::TemplateElement().


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