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. | |
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 3 2 Triangle tria 3 3 Quadrilateral quad 3 4
enum SideType |
Side | ( | size_t | label, |
const string & | shape | ||
) |
Constructor initializing side label and shape.
[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.
[in] | label | to assign to side. |
[in] | shape | of side (See enum ElementShape in Mesh). |
void Add | ( | Element * | el | ) |
Set pointer to neighbor element.
[in] | el | Pointer to element to add as a neigbor element |
el
only if this one is not a null pointer size_t Contains | ( | const Node * | nd | ) | const |
Say if a given node belongs to current side.
[in] | nd | Pointer to searched node |
0
if not void DOF | ( | size_t | i, |
size_t | dof | ||
) |
Define label of DOF.
[in] | i | DOF index |
[in] | dof | Its label |
int getCode | ( | size_t | dof = 1 | ) | const |
Return code for a given DOF of node.
[in] | dof | Local label of degree of freedom. [Default: 1 ] |
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
Element* getNeighborElement | ( | size_t | i | ) | const |
Return pointer to i-th side neighboring element.
[in] | i | Local label of neighbor element (must be equal to 1 or 2 ). |
Return normal vector to side.
The normal vector is oriented from the first neighbor element to the second one.
Return pointer to other neighboring element than given one.
[in] | el | Pointer to a given neighbor element |
Return unit normal vector to side.
The unit normal vector is oriented from the first neighbor element to the second 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
Node* operator() | ( | size_t | i | ) | const |
Operator ().
Return pointer to node of local label i
.
void set | ( | Element * | el, |
size_t | i | ||
) |
Set pointer to neighbor element.
[in] | el | Pointer to element to set as a neighbor element |
[in] | i | Local number of neighbor element |
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)
[in] | sd | Pointer to side to assign |
void setCode | ( | size_t | dof, |
int | code | ||
) |
Assign code to a DOF.
[in] | dof | DOF to which code is assigned |
[in] | code | Code to assign |
void setDOF | ( | size_t & | first_dof, |
size_t | nb_dof | ||
) |
Define number of DOF.
[in,out] | first_dof | Label of the first DOF in input that is actualized |
[in] | nb_dof | Number of DOF |