To store and treat finite element sides (edges in 2-D or faces in 3-D) More...
Public Types | |
enum | SideType { INTERNAL_SIDE = 0, EXTERNAL_BOUNDARY = 1, INTERNAL_BOUNDARY = 2 } |
Public Member Functions | |
Side () | |
Default Constructor. | |
Side (size_t label, const string &shape) | |
Constructor initializing side label and shape. More... | |
Side (size_t label, int shape) | |
Constructor initializing side label and shape. More... | |
Side (const Side &sd) | |
Copy constructor. | |
~Side () | |
Destructor. | |
void | Add (Node *node) |
Insert a node at end of list of nodes of side. | |
void | Add (Edge *edge) |
Insert an edge at end of list of edges of side. | |
void | setLabel (size_t i) |
Define label of side. | |
void | setFirstDOF (size_t n) |
Define First DOF. | |
void | setNbDOF (size_t nb_dof) |
Set number of degrees of freedom (DOF). | |
void | DOF (size_t i, size_t dof) |
Define label of DOF. More... | |
void | setDOF (size_t &first_dof, size_t nb_dof) |
Define number of DOF. More... | |
void | setCode (size_t dof, int code) |
Assign code to a DOF. More... | |
void | Replace (size_t label, Node *node) |
Replace a node at a given local label. | |
void | Add (Element *el) |
Set pointer to neighbor element. More... | |
void | set (Element *el, size_t i) |
Set pointer to neighbor element. More... | |
void | setNode (size_t i, Node *node) |
Assign a node given by its pointer as the i -th node of side. | |
void | setOnBoundary () |
Say that the side is on the boundary. | |
int | getShape () const |
Return side's shape. | |
size_t | getLabel () const |
Return label of side. | |
size_t | n () const |
Return label of side. | |
size_t | getNbNodes () const |
Return number of side nodes. | |
size_t | getNbVertices () const |
Return number of side vertices. | |
size_t | getNbEq () const |
Return number of side equations. | |
size_t | getNbDOF () const |
Return number of DOF. | |
int | getCode (size_t dof=1) const |
Return code for a given DOF of node. More... | |
size_t | getDOF (size_t i) const |
Return label of i -th dof. | |
size_t | getFirstDOF () const |
Return label of first dof of node. | |
Node * | getPtrNode (size_t i) const |
Return pointer to node of local label i . | |
Node * | operator() (size_t i) const |
Operator (). More... | |
size_t | getNodeLabel (size_t i) const |
Return global label of node with given local label. | |
Element * | getNeighborElement (size_t i) const |
Return pointer to i-th side neighboring element. More... | |
Element * | getOtherNeighborElement (Element *el) const |
Return pointer to other neighboring element than given one. More... | |
Point< real_t > | getNormal () const |
Return normal vector to side. More... | |
Point< real_t > | getUnitNormal () const |
Return unit normal vector to side. More... | |
int | isOnBoundary () const |
Boundary side or not. More... | |
int | isReferenced () |
Say if side has a nonzero code or not. | |
real_t | getMeasure () const |
Return measure of side. More... | |
Point< real_t > | getCenter () const |
Return coordinates of center of side. | |
size_t | Contains (const Node *nd) const |
Say if a given node belongs to current side. More... | |
void | setActive (bool opt=true) |
Set side is active (default) or not if argument is false | |
bool | isActive () const |
Return true or false whether side is active or not. | |
int | getLevel () const |
Return side level Side level increases when side is refined (starting from 0 ). If the level is 0 , then the element has no father. | |
void | setChild (Side *sd) |
Assign side as child of current one and assign current side as father. More... | |
Side * | getParent () const |
Return pointer to parent side Return null if no parent. | |
Side * | getChild (size_t i) const |
Return pointer to i -th child side Returns null pointer is no childs. | |
size_t | getNbChilds () const |
Return number of children of side. | |
Detailed Description
To store and treat finite element sides (edges in 2-D or faces in 3-D)
Defines a side of a finite element mesh. The sides are given in particular by their shapes and a list of nodes. Each node can be accessed by the member function getPtrNode(). The string defining 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 | 3 | 3 |
Quadrilateral | quad | 3 | 4 |
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Member Enumeration Documentation
enum SideType |
Constructor & Destructor Documentation
Side | ( | size_t | label, |
const string & | shape | ||
) |
Constructor initializing side label and shape.
- Parameters
-
[in] label Label to assign to side. [in] shape Shape of side (See class description).
Side | ( | size_t | label, |
int | shape | ||
) |
Constructor initializing side label and shape.
- Parameters
-
[in] label to assign to side. [in] shape of side (See enum ElementShape in Mesh).
Member Function Documentation
void DOF | ( | size_t | i, |
size_t | dof | ||
) |
Define label of DOF.
- Parameters
-
[in] i DOF index [in] dof Its label
void setDOF | ( | size_t & | first_dof, |
size_t | nb_dof | ||
) |
Define number of DOF.
- Parameters
-
[in,out] first_dof Label of the first DOF in input that is actualized [in] nb_dof Number of DOF
void setCode | ( | size_t | dof, |
int | code | ||
) |
Assign code to a DOF.
- Parameters
-
[in] dof DOF to which code is assigned [in] code Code to assign
void Add | ( | Element * | el | ) |
Set pointer to neighbor element.
- Parameters
-
[in] el Pointer to element to add as a neigbor element
- Remarks
- This function adds the pointer
el
only if this one is not a null pointer
void set | ( | Element * | el, |
size_t | i | ||
) |
Set pointer to neighbor element.
- Parameters
-
[in] el Pointer to element to set as a neighbor element [in] i Local number of neighbor element
- Remarks
- This function differs from the Add by the fact that the local label of neighbor element is given
int getCode | ( | size_t | dof = 1 | ) | const |
Return code for a given DOF of node.
- Parameters
-
[in] dof Local label of degree of freedom. [Default: 1
]
Node* operator() | ( | size_t | i | ) | const |
Operator ().
Return pointer to node of local label i
.
Element* getNeighborElement | ( | size_t | i | ) | const |
Return pointer to i-th side neighboring element.
- Parameters
-
[in] i Local label of neighbor element (must be equal to 1
or2
).
Return pointer to other neighboring element than given one.
- Parameters
-
[in] el Pointer to a given neighbor element
- Remarks
- If the side is on the boundary this function returns null pointer
Return normal vector to side.
The normal vector is oriented from the first neighbor element to the second one.
- Warning
- The norm of this vector is equal to the measure of the side (length of the edge in 2-D and area of the face in 3-D), and To get the unit normal, use rather the member function getUnitNormal.
Return unit normal vector to side.
The unit normal vector is oriented from the first neighbor element to the second one.
- Remarks
- The norm of this vector is equal to one.
int isOnBoundary | ( | ) | const |
Boundary side or not.
Returns 1
or -1
if side is on boundary Depending on whether the first or the second neighbor element is defined Returns 0
if side is an inner one
- Remarks
- This member function is valid only if member function Mesh::getAllSides() or Mesh::getBoundarySides() has been called before.
real_t getMeasure | ( | ) | const |
Return measure of side.
This member function returns length or area of side. In case of quadrilaterals it returns determinant of Jacobian of mapping between reference and actual side
size_t Contains | ( | const Node * | nd | ) | const |
Say if a given node belongs to current side.
- Parameters
-
[in] nd Pointer to searched node
- Returns
- index (local label) of node if found,
0
if not
void setChild | ( | Side * | sd | ) |
Assign side as child of current one and assign current side as father.
This function is principally used when refining is invoked (e.g. for mesh adaption)
- Parameters
-
[in] sd Pointer to side to assign