    

 ## On this page

  

 

 # Element Class Reference

 Last update: 16.07.2025 

Repesents the geometry of a finite element within a mesh. [More...](class_element.xhtml#details)

## <a name="pub-types"></a>Public Types

<a id="ace35addae6fb3e124dac4815a1f64fc8"></a>typedef size\_t [count\_type](class_element.xhtml#ace35addae6fb3e124dac4815a1f64fc8) a large numbereger for index algebra   
 <a id="ab5c8f4002db20163549090ce34e235e2"></a>typedef std::vector&lt; Edge \*&gt; [edge\_ptr\_vector\_type](class_element.xhtml#ab5c8f4002db20163549090ce34e235e2) a *Edge* pointer vector   
 <a id="a6ea0951108d01e59ea59cafe4f639e03"></a>typedef [Element](class_element.xhtml) \* [element\_ptr\_type](class_element.xhtml#a6ea0951108d01e59ea59cafe4f639e03) a pointer to *[Element](class_element.xhtml "Repesents the geometry of a finite element within a mesh. ")*   
 <a id="a0d16b56c12710f1a510e3f39c0aa1b02"></a>typedef element::ElementData \* [elementdata\_const\_ptr\_type](class_element.xhtml#a0d16b56c12710f1a510e3f39c0aa1b02) a pointer to a const-address of *ElementData*   
 <a id="a33133509c918336b6be12d2ee65bb9d0"></a>typedef element::ElementData \* [elementdata\_ptr\_type](class_element.xhtml#a33133509c918336b6be12d2ee65bb9d0) a pointer to *ElementData*   
 <a id="ac5dc1cdb71455f062cd6a1b1ef8b2eb4"></a>typedef element::ET \* [elementtype\_const\_ptr\_type](class_element.xhtml#ac5dc1cdb71455f062cd6a1b1ef8b2eb4) a pointer to element types *ET*   
 <a id="a0ec8ff821248940465b7f41205bb9a49"></a>typedef std::vector&lt; Face \*&gt; [face\_ptr\_vector\_type](class_element.xhtml#a0ec8ff821248940465b7f41205bb9a49) a *Face* pointer vector   
 <a id="a09c479e08416cdc288b05648e59dabda"></a>typedef number [float\_type](class_element.xhtml#a09c479e08416cdc288b05648e59dabda) floating point number type for algebra   
 <a id="a1745e2fb27a3a3783ac48a53630635aa"></a>typedef number [index\_type](class_element.xhtml#a1745e2fb27a3a3783ac48a53630635aa) unsigned index type   
 <a id="a5625d94f603e3a8e2192980fd1f77128"></a>typedef Point \* [point\_ptr\_type](class_element.xhtml#a5625d94f603e3a8e2192980fd1f77128) a pointer of *Point*   
 <a id="a17cb737c35782749b46d495181a6400f"></a>typedef std::vector&lt; [point\_ptr\_type](class_element.xhtml#a5625d94f603e3a8e2192980fd1f77128) &gt; [point\_ptr\_vector\_type](class_element.xhtml#a17cb737c35782749b46d495181a6400f) a *Point* pointer vector   
 <a id="a884f8c89c3e02a91b0ec3f3759972156"></a>typedef std::vector&lt; unsigned short &gt; [small\_index\_vector\_type](class_element.xhtml#a884f8c89c3e02a91b0ec3f3759972156) a vector of small unsigned index types   
 <a id="a2c83b7348a2acedf114ab5847ad3ffcd"></a>typedef number [uint](class_element.xhtml#a2c83b7348a2acedf114ab5847ad3ffcd) number type   
 ## <a name="pub-methods"></a>Public Member Functions

 [computeLinearNodeCoordinates](class_element.xhtml#a47f2e02383929d07eb975a848ea01356) (Eigen::MatrixXd input\_coors, Eigen::MatrixXd output\_coors) number [computeSurfaceArea](class_element.xhtml#a3e5ccd0faa3aedb8a9f9d0ae7f5f9297) () Computes the surface area of the element Collects all the element faces, checks which of them are on the elements surface, gets the triangulation of these faces and computes the sum of these triangle areas. [More...](#a3e5ccd0faa3aedb8a9f9d0ae7f5f9297)  
 <a id="ab6edd5ea4f400b450f07203f432d1c81"></a> [Element](class_element.xhtml#ab6edd5ea4f400b450f07203f432d1c81) () default constructor, DO NOT USE - provided for SWIG   
 [edge\_ptr\_vector\_type](class_element.xhtml#ab5c8f4002db20163549090ce34e235e2) [elementEdges](class_element.xhtml#aa35c3670a02548beed064776203aa0ca) () const returns the edges of the element [More...](#aa35c3670a02548beed064776203aa0ca)  
 [face\_ptr\_vector\_type](class_element.xhtml#a0ec8ff821248940465b7f41205bb9a49) [elementFaces](class_element.xhtml#abb46a6ca856f3f251832897c0419d056) () const returns the faces of the element [More...](#abb46a6ca856f3f251832897c0419d056)  
 [point\_ptr\_vector\_type](class_element.xhtml#a17cb737c35782749b46d495181a6400f) [elementNodes](class_element.xhtml#a014c5ec371249375b31d6378ff93eba7) () const returns the nodes of the element [More...](#a014c5ec371249375b31d6378ff93eba7)  
 element::ET [elementType](class_element.xhtml#aa9dbef11fb7319aa9b3444c9aa3d73fd) () const returns the element type: [More...](#aa9dbef11fb7319aa9b3444c9aa3d73fd)  
 string [elementTypeString](class_element.xhtml#abae7f86c1e3df38d6b23c7e56d1d3d50) () returns the element type: [More...](#abae7f86c1e3df38d6b23c7e56d1d3d50)  
  [getNormal](class_element.xhtml#acff0007b5fcfc9d757bf7f27581589cd) (Eigen::Vector3d output\_normal) [index\_type](class_element.xhtml#a1745e2fb27a3a3783ac48a53630635aa) [index](class_element.xhtml#a5c8a964dee50273444cc6f3890a93458) () returns the element index: [More...](#a5c8a964dee50273444cc6f3890a93458)  
 bool [isDegenerated](class_element.xhtml#a9504141fc8f8598f2336e3dbc26955d3) () [small\_index\_vector\_type](class_element.xhtml#a884f8c89c3e02a91b0ec3f3759972156) [localElementAtNode](class_element.xhtml#a6e72cb8299f6b4d213df02a198b02b38) () a getter for m\_local\_element\_at\_node [More...](#a6e72cb8299f6b4d213df02a198b02b38)  
 [small\_index\_vector\_type](class_element.xhtml#a884f8c89c3e02a91b0ec3f3759972156) [localElementAtNodeRef](class_element.xhtml#a92d374554c062ca6f9a8f8165946b7ae) () a setter for m\_local\_element\_at\_node [More...](#a92d374554c062ca6f9a8f8165946b7ae)  
 Point [nodeAt](class_element.xhtml#a517d742794bc4eb1f10038ebc9497544) (number id) accesses inidividual connected nodes [More...](#a517d742794bc4eb1f10038ebc9497544)  
 number [numNodes](class_element.xhtml#aee2c59027bd4da1512c12b2cc36e3d9f) () const [index\_type](class_element.xhtml#a1745e2fb27a3a3783ac48a53630635aa) [part\_index](class_element.xhtml#afcb99d683aa8cefa53d9410e03372c17) () returns the part index: [More...](#afcb99d683aa8cefa53d9410e03372c17)  
  [recomputeNodeCoordinatesMidEdge](class_element.xhtml#a1129b572ed4e9f2aad058ad02291832b) (Eigen::MatrixXd input\_coors, Eigen::MatrixXd output\_coors) Section [section](class_element.xhtml#af609878599acc1e49f529281ee7af924) () const a getter for the element section: [More...](#af609878599acc1e49f529281ee7af924)  
 <a id="details" name="details"></a>## Detailed Description

Repesents the geometry of a finite element within a mesh.

This class represents the geometrical instance of a finite element contained in a FEM mesh. The class associates the geometry and the topology of the mesh (and the finite element type). It does not provide information/methods on the underlying physical process.



## Member Function Documentation

<a id="a47f2e02383929d07eb975a848ea01356"></a>## [◆ ](#a47f2e02383929d07eb975a848ea01356)computeLinearNodeCoordinates()

 computeLinearNodeCoordinates  ( Eigen::MatrixXd  *input\_coors*,    Eigen::MatrixXd  *output\_coors*   ) 

recomputes the given node coordinates by linear shape functions The computation is done by assumption of an isoparametric approach.

Parameters input\_coorsa 3\*n matrix containing the coordinates output\_coorsa 3\*n matrix containing the new coordinates 



<a id="a3e5ccd0faa3aedb8a9f9d0ae7f5f9297"></a>## [◆ ](#a3e5ccd0faa3aedb8a9f9d0ae7f5f9297)computeSurfaceArea()

 number computeSurfaceArea  ( ) 

Computes the surface area of the element Collects all the element faces, checks which of them are on the elements surface, gets the triangulation of these faces and computes the sum of these triangle areas.

ReturnsThe surface area. Note[Element](class_element.xhtml "Repesents the geometry of a finite element within a mesh. ") surface: An element face is recognized as a surface if the face in question reports to be onSurface() and the ident of the [elementType()](class_element.xhtml#aa9dbef11fb7319aa9b3444c9aa3d73fd "returns the element type: ") face in question is not SNEG 



<a id="aa35c3670a02548beed064776203aa0ca"></a>## [◆ ](#aa35c3670a02548beed064776203aa0ca)elementEdges()

 [edge\_ptr\_vector\_type](class_element.xhtml#ab5c8f4002db20163549090ce34e235e2) elementEdges  ( )  const

returns the edges of the element

Returnsa reference to m\_edges 



<a id="abb46a6ca856f3f251832897c0419d056"></a>## [◆ ](#abb46a6ca856f3f251832897c0419d056)elementFaces()

 [face\_ptr\_vector\_type](class_element.xhtml#a0ec8ff821248940465b7f41205bb9a49) elementFaces  ( )  const

returns the faces of the element

Returnsa reference to m\_faces 



<a id="a014c5ec371249375b31d6378ff93eba7"></a>## [◆ ](#a014c5ec371249375b31d6378ff93eba7)elementNodes()

 [point\_ptr\_vector\_type](class_element.xhtml#a17cb737c35782749b46d495181a6400f) elementNodes  ( )  const

returns the nodes of the element

Returnsa reference to m\_nodes 



<a id="aa9dbef11fb7319aa9b3444c9aa3d73fd"></a>## [◆ ](#aa9dbef11fb7319aa9b3444c9aa3d73fd)elementType()

 element::ET elementType  ( )  const

returns the element type:

Returnsa reference to \*m\_type 



<a id="abae7f86c1e3df38d6b23c7e56d1d3d50"></a>## [◆ ](#abae7f86c1e3df38d6b23c7e56d1d3d50)elementTypeString()

 string elementTypeString  ( ) 

returns the element type:

Returnsa string describing the element number 



<a id="acff0007b5fcfc9d757bf7f27581589cd"></a>## [◆ ](#acff0007b5fcfc9d757bf7f27581589cd)getNormal()

 getNormal  ( Eigen::Vector3d  *output\_normal*) 

define the normal by average of triangles defined on the element

Returnsthe normalized vector 



<a id="a5c8a964dee50273444cc6f3890a93458"></a>## [◆ ](#a5c8a964dee50273444cc6f3890a93458)index()

 [index\_type](class_element.xhtml#a1745e2fb27a3a3783ac48a53630635aa) index  ( ) 

returns the element index:

Returnsa reference to m\_index 



<a id="a9504141fc8f8598f2336e3dbc26955d3"></a>## [◆ ](#a9504141fc8f8598f2336e3dbc26955d3)isDegenerated()

 bool isDegenerated  ( ) 

Returnstrue if the element is degenerated An element is degenerated if there are at most 3 non degenerated faces (in this case, there is no volume being spanned). 



<a id="a6e72cb8299f6b4d213df02a198b02b38"></a>## [◆ ](#a6e72cb8299f6b4d213df02a198b02b38)localElementAtNode()

 [small\_index\_vector\_type](class_element.xhtml#a884f8c89c3e02a91b0ec3f3759972156) localElementAtNode  ( ) 

a getter for m\_local\_element\_at\_node

Returnsa reference to m\_local\_element\_at\_node 



<a id="a92d374554c062ca6f9a8f8165946b7ae"></a>## [◆ ](#a92d374554c062ca6f9a8f8165946b7ae)localElementAtNodeRef()

 [small\_index\_vector\_type](class_element.xhtml#a884f8c89c3e02a91b0ec3f3759972156) localElementAtNodeRef  ( ) 

a setter for m\_local\_element\_at\_node

Returnsa reference to m\_local\_element\_at\_node 



<a id="a517d742794bc4eb1f10038ebc9497544"></a>## [◆ ](#a517d742794bc4eb1f10038ebc9497544)nodeAt()

 Point nodeAt  ( number  *id*) 

accesses inidividual connected nodes

Parameters idthe index 0..[numNodes()](class_element.xhtml#aee2c59027bd4da1512c12b2cc36e3d9f)-1 Returnsa const-reference to the connected node 



<a id="aee2c59027bd4da1512c12b2cc36e3d9f"></a>## [◆ ](#aee2c59027bd4da1512c12b2cc36e3d9f)numNodes()

 number numNodes  ( )  const

Returnsthe number of connected nodes 



<a id="afcb99d683aa8cefa53d9410e03372c17"></a>## [◆ ](#afcb99d683aa8cefa53d9410e03372c17)part\_index()

 [index\_type](class_element.xhtml#a1745e2fb27a3a3783ac48a53630635aa) part\_index  ( ) 

returns the part index:

Returnsa reference to m\_part\_index 



<a id="a1129b572ed4e9f2aad058ad02291832b"></a>## [◆ ](#a1129b572ed4e9f2aad058ad02291832b)recomputeNodeCoordinatesMidEdge()

 recomputeNodeCoordinatesMidEdge  ( Eigen::MatrixXd  *input\_coors*,    Eigen::MatrixXd  *output\_coors*   ) 

recomputes the given node coordinates by placing the mid-edge nodes in the center of the edges The computation is done by assumption of an isoparametric approach.

Parameters input\_coorsa 3\*n matrix containing the coordinates output\_coorsa 3\*n matrix containing the new coordinates 



<a id="af609878599acc1e49f529281ee7af924"></a>## [◆ ](#af609878599acc1e49f529281ee7af924)section()

 Section section  ( )  const

a getter for the element section:

Returnsa reference to m\_section