To store and treat finite element geometric information. More...
Public Member Functions | |
| Element () | |
| Default constructor. | |
| Element (size_t label, const string &shape) | |
| Constructor initializing label, shape of element. | |
| Element (size_t label, int shape) | |
| Constructor initializing label, shape of element. | |
| Element (size_t label, const string &shape, int c) | |
| Constructor initializing label, shape and code of element. | |
| Element (size_t label, int shape, int c) | |
| Constructor initializing label, shape and code of element. | |
| Element (const Element &el) | |
| Copy constructor. | |
| ~Element () | |
| Destructor. | |
| void | setLabel (size_t i) |
| Define label of element. | |
| void | setCode (int c) |
| Define code of element. | |
| void | setCode (const string &exp, int code) |
| void | Add (Node *node) |
| Insert a node at end of list of nodes of element. | |
| void | Add (Node *node, int n) |
| Insert a node and set its local node number. | |
| void | Replace (size_t label, Node *node) |
| Replace a node at a given local label. | |
| void | Replace (size_t label, Side *side) |
| Replace a side at a given local label. | |
| void | Add (Side *sd) |
| Assign Side to Element. | |
| void | Add (Side *sd, int k) |
| Assign Side to Element with assigned local label. | |
| void | Add (Element *el) |
| Add a neighbor element. | |
| void | set (Element *el, int n) |
| Add a neighbor element and set its label. | |
| void | setDOF (size_t i, size_t dof) |
| Define label of DOF. | |
| void | setCode (size_t dof, int code) |
| Assign code to a DOF. | |
| void | setNode (size_t i, Node *node) |
| Assign a node given by its pointer as the i-th node of element. | |
| int | getShape () const |
| Return element shape. | |
| size_t | getLabel () const |
| Return label of element. | |
| size_t | n () const |
| Return label of element. | |
| int | getCode () const |
| Return code of element. | |
| size_t | getNbNodes () const |
| Return number of element nodes. | |
| size_t | getNbVertices () const |
| Return number of element vertices. | |
| size_t | getNbSides () const |
| Return number of element sides (Constant version) | |
| size_t | getNbEq () const |
| Return number of element equations. | |
| size_t | getNbDOF () const |
| return element nb of d.DOF (fixed at 1) | |
| size_t | getDOF () const |
| Return element DOF label. | |
| size_t | getNodeLabel (size_t n) const |
| Return global label of node of local label i. | |
| size_t | getSideLabel (size_t n) const |
| Return global label of side of local label i. | |
| Node * | getPtrNode (size_t i) const |
| Return pointer to node of label i (Local labelling). | |
| Node * | operator() (size_t i) const |
| Operator (). | |
| Side * | getPtrSide (size_t i) const |
| Return pointer to side of label i (Local labelling). | |
| int | Contains (const Node *n) const |
| Say if element contains given node. | |
| int | Contains (const Side *s) const |
| Say if element contains given side. | |
| Element * | getNeighborElement (size_t i) const |
| Return pointer to element Neighboring element. | |
| size_t | getNbNeigElements () const |
| Return number of neigboring elements. | |
| double | getMeasure () const |
| Return measure of element. | |
| Point< double > | getUnitNormal (size_t i) const |
| Return outward unit normal to i-th side of element. | |
| bool | isOnBoundary () const |
| Say if current element is a boundary element or not. | |
| Node * | operator() (size_t i) |
| Operator (). | |
| int | setSide (size_t n, size_t *nd) |
| Initialize information on element sides. | |
| bool | isActive () const |
Return true or false whether element is active or not. | |
| int | getLevel () const |
| void | setChild (Element *el) |
| Assign element as child of current one and assign current element as father This function is principally used when refining is invoked (e.g. for mesh adaption) | |
| Element * | getChild (size_t i) const |
| size_t | getNbChilds () const |
| Return number of children of element. | |
| Element * | getParent () const |
| size_t | IsIn (const Node *nd) |
Detailed Description
To store and treat finite element geometric information.
Class Element enables defining an element of a finite element mesh. The element is given in particular by its shape and a list of nodes. Each node can be accessed by the member function getPtrNode. Moreover, class Mesh can generate for each element its list of sides. The string that defines the element shape must be chosen according to the following list :
| Shape | Shape Name | Dimension | Min. Number of nodes |
| Line | line | 2 | 2 |
| Triangle | tria | 2 | 3 |
| Quadrilateral | quad | 2 | 4 |
| Tetrahedron | tetra | 3 | 4 |
| Hexahedron | hexa | 3 | 8 |
Constructor & Destructor Documentation
| Element | ( | size_t | label, |
| const string & | shape | ||
| ) |
Constructor initializing label, shape of element.
- Parameters:
-
[in] label Label to assign to element. [in] shape Shape of element (See class description).
| Element | ( | size_t | label, |
| int | shape | ||
| ) |
Constructor initializing label, shape of element.
- Parameters:
-
[in] label Label to assign to element. [in] shape Shape of element (See enum ElementShape in Mesh)
| Element | ( | size_t | label, |
| const string & | shape, | ||
| int | c | ||
| ) |
Constructor initializing label, shape and code of element.
- Parameters:
-
[in] label Label to assign to element. [in] shape Shape of element (See class description). [in] c Code to assign to element (useful for media properties).
| Element | ( | size_t | label, |
| int | shape, | ||
| int | c | ||
| ) |
Constructor initializing label, shape and code of element.
- Parameters:
-
[in] label Label to assign to element. [in] shape Shape of element (See enum ElementShape in Mesh). [in] c Code to assign to element (useful for media properties).
Member Function Documentation
| void setLabel | ( | size_t | i | ) |
Define label of element.
- Parameters:
-
[in] i Label to assign to element
| void setCode | ( | int | c | ) |
Define code of element.
- Parameters:
-
[in] c Code to assign to element.
| void setCode | ( | const string & | exp, |
| int | code | ||
| ) |
Define code by a boolean algebraic expression invoking coordinates of element nodes
- Parameters:
-
[in] exp Boolean algebraic expression as required by fparser [in] code Code to assign to node if the algebraic expression is true
Insert a node at end of list of nodes of element.
- Parameters:
-
[in] node Pointer to Node instance.
Add a neighbor element and set its label.
- Parameters:
-
[in] el Pointer to Element instance [in] n Neighbor element number to assign
| void setDOF | ( | size_t | i, |
| size_t | dof | ||
| ) |
Define label of DOF.
- Parameters:
-
[in] i Index of DOF. [in] dof Label of DOF to assign.
| void setCode | ( | size_t | dof, |
| int | code | ||
| ) |
Assign code to a DOF.
- Parameters:
-
[in] dof Index of dof for assignment. [in] code Code to assign.
| Node* operator() | ( | size_t | i | ) | const |
Operator ().
Return pointer to node of local label i.
Say if element contains given node.
- Parameters:
-
[in] n Pointer to Node instance.
Say if element contains given side.
- Parameters:
-
[in] s Pointer to Side instance.
| Element* getNeighborElement | ( | size_t | i | ) | const |
Return pointer to element Neighboring element.
- Parameters:
-
[in] i Index of element to look for.
- Note:
- This method returns valid information only if the Mesh member function Mesh::getElementNeighborElements() has been called before.
| size_t getNbNeigElements | ( | ) | const |
Return number of neigboring elements.
- Note:
- This method returns valid information only if the Mesh member function Mesh::getElementNeighborElements() has been called before.
| double getMeasure | ( | ) | const |
Return measure of element.
This member function returns length, area or volume of element. In case of quadrilaterals and hexahedrals it returns determinant of Jacobian of mapping between reference and actual element
| Point<double> getUnitNormal | ( | size_t | i | ) | const |
Return outward unit normal to i-th side of element.
Sides are ordered [node_1,node_2], [node_2,node_3], ...
| bool isOnBoundary | ( | ) | const |
Say if current element is a boundary element or not.
- Note:
- this information is available only if boundary elements were determined i.e., if Member function Mesh::getBoundarySides or Mesh::getAllSides has been invoked before.
| Node* operator() | ( | size_t | i | ) |
Operator ().
Return pointer to node of local label i.
| int setSide | ( | size_t | n, |
| size_t * | nd | ||
| ) |
Initialize information on element sides.
This function is to be used to initialize loops over sides.
- Parameters:
-
[in] n Label of side. [in] nd Array of pointers to nodes of the side ( nd[0],nd[1], ... point to first, second nodes, ...
| int getLevel | ( | ) | const |
Return element level Element level decreases when element is refined (starting from 0). If the level is 0, then the element has no father
Assign element as child of current one and assign current element as father This function is principally used when refining is invoked (e.g. for mesh adaption)
- Parameters:
-
[in] el Pointer to element to assign
Return pointer to i-th child element Returns null pointer is no childs
- OFELI
- Element