Mesh management classes More...
Classes | |
class | Domain |
To store and treat finite element geometric information. More... | |
class | Edge |
To describe an edge. More... | |
class | Element |
To store and treat finite element geometric information. More... | |
class | Figure |
To store and treat a figure (or shape) information. More... | |
class | Rectangle |
To store and treat a rectangular figure. More... | |
class | Brick |
To store and treat a brick (parallelepiped) figure. More... | |
class | Circle |
To store and treat a circular figure. More... | |
class | Sphere |
To store and treat a sphere. More... | |
class | Ellipse |
To store and treat an ellipsoidal figure. More... | |
class | Triangle |
To store and treat a triangle. More... | |
class | Polygon |
To store and treat a polygonal figure. More... | |
class | Grid |
To manipulate structured grids. More... | |
class | Mesh |
To store and manipulate finite element meshes. More... | |
class | MeshAdapt |
To adapt mesh in function of given solution. More... | |
class | NodeList |
Class to construct a list of nodes having some common properties. More... | |
class | ElementList |
Class to construct a list of elements having some common properties. More... | |
class | SideList |
Class to construct a list of sides having some common properties. More... | |
class | EdgeList |
Class to construct a list of edges having some common properties. More... | |
class | Node |
To describe a node. More... | |
class | Partition |
To partition a finite element mesh into balanced submeshes. More... | |
class | Side |
To store and treat finite element sides (edges in 2-D or faces in 3-D) More... | |
Macros | |
#define | GRAPH_MEMORY 1000000 |
Memory necessary to store matrix graph. More... | |
#define | MAX_NB_ELEMENTS 10000 |
Maximal Number of elements. | |
#define | MAX_NB_NODES 10000 |
Maximal number of nodes. | |
#define | MAX_NB_SIDES 30000 |
Maximal number of sides in. | |
#define | MAX_NB_EDGES 30000 |
Maximal Number of edges. | |
#define | MAX_NBDOF_NODE 6 |
Maximum number of DOF supported by each node. | |
#define | MAX_NBDOF_SIDE 6 |
Maximum number of DOF supported by each side. | |
#define | MAX_NBDOF_EDGE 2 |
Maximum number of DOF supported by each edge. | |
#define | MAX_NB_ELEMENT_NODES 20 |
Maximum number of nodes by element. | |
#define | MAX_NB_ELEMENT_EDGES 10 |
Maximum number of edges by element. | |
#define | MAX_NB_SIDE_NODES 9 |
Maximum number of nodes by side. | |
#define | MAX_NB_ELEMENT_SIDES 8 |
Maximum number of sides by element. | |
#define | MAX_NB_ELEMENT_DOF 27 |
Maximum number of dof by element. | |
#define | MAX_NB_SIDE_DOF 4 |
Maximum number of dof by side. | |
#define | MAX_NB_INT_PTS 20 |
Maximum number of integration points in element. | |
#define | MAX_NB_MATERIALS 10 |
Maximum number of materials. | |
#define | TheNode (*theNode) |
#define | TheElement (*theElement) |
#define | TheSide (*theSide) |
#define | TheEdge (*theEdge) |
#define | ElementLoop(m) for ((m).topElement(); (theElement=(m).getElement());) |
#define | ActiveElementLoop(m) for ((m).topElement(); (theElement=(m).getActiveElement());) |
#define | SideLoop(m) for ((m).topSide(); (theSide=(m).getSide());) |
#define | EdgeLoop(m) for ((m).topEdge(); (theEdge=(m).getEdge());) |
#define | NodeLoop(m) for ((m).topNode(); (theNode=(m).getNode());) |
#define | BoundaryNodeLoop(m) for ((m).topBoundaryNode(); (theNode=(m).getBoundaryNode());) |
#define | BoundarySideLoop(m) for ((m).topBoundarySide(); (theSide=(m).getBoundarySide());) |
#define | theNodeLabel theNode->n() |
#define | theSideLabel theSide->n() |
A macro that returns side label in a loop using macro MeshSides | |
#define | theSideNodeLabel(i) theSide->getNodeLabel(i) |
A macro that returns label of i -th node of side using macro MeshSides | |
#define | theElementLabel theElement->n() |
A macro that returns element label in a loop using macro MeshElements | |
#define | theElementNodeLabel(i) theElement->getNodeLabel(i) |
A macro that returns label of i -th node of element using macro MeshElements | |
Functions | |
ostream & | operator<< (ostream &s, const Edge &ed) |
Output edge data. | |
ostream & | operator<< (ostream &s, const Element &el) |
Output element data. | |
Figure | operator&& (const Figure &f1, const Figure &f2) |
Function to define a Figure instance as the intersection of two Figure instances. More... | |
Figure | operator|| (const Figure &f1, const Figure &f2) |
Function to define a Figure instance as the union of two Figure instances. More... | |
Figure | operator- (const Figure &f1, const Figure &f2) |
Function to define a Figure instance as the set subtraction of two Figure instances. More... | |
ostream & | operator<< (ostream &s, const Material &m) |
Output material data. | |
ostream & | operator<< (ostream &s, const Mesh &ms) |
Output mesh data. More... | |
ostream & | operator<< (ostream &s, const MeshAdapt &a) |
Output MeshAdapt class data. | |
ostream & | operator<< (ostream &s, const NodeList &nl) |
Output NodeList instance. More... | |
ostream & | operator<< (ostream &s, const ElementList &el) |
Output ElementList instance. More... | |
ostream & | operator<< (ostream &s, const SideList &sl) |
Output SideList instance. More... | |
ostream & | operator<< (ostream &s, const EdgeList &el) |
Output EdgeList instance. More... | |
size_t | Label (const Node &nd) |
Return label of a given node. More... | |
size_t | Label (const Element &el) |
Return label of a given element. More... | |
size_t | Label (const Side &sd) |
Return label of a given side. More... | |
size_t | Label (const Edge &ed) |
Return label of a given edge. More... | |
size_t | NodeLabel (const Element &el, size_t n) |
Return global label of node local label in element. More... | |
size_t | NodeLabel (const Side &sd, size_t n) |
Return global label of node local label in side. More... | |
Point< real_t > | Coord (const Node &nd) |
Return coordinates of a given node. More... | |
int | Code (const Node &nd, size_t i=1) |
Return code of a given (degree of freedom of) node. More... | |
int | Code (const Element &el) |
Return code of a given element. More... | |
int | Code (const Side &sd, size_t i=1) |
Return code of a given (degree of freedom of) side. More... | |
bool | operator== (const Element &el1, const Element &el2) |
Check equality between 2 elements. More... | |
bool | operator== (const Side &sd1, const Side &sd2) |
Check equality between 2 sides. More... | |
void | DeformMesh (Mesh &mesh, const Vect< real_t > &u, real_t rate=0.2) |
Calculate deformed mesh using a displacement field. More... | |
void | MeshToMesh (Mesh &m1, Mesh &m2, const Vect< real_t > &u1, Vect< real_t > &u2, size_t nx, size_t ny=0, size_t nz=0, size_t dof=1) |
Function to redefine a vector defined on a mesh to a new mesh. More... | |
void | MeshToMesh (const Vect< real_t > &u1, Vect< real_t > &u2, size_t nx, size_t ny=0, size_t nz=0, size_t dof=1) |
Function to redefine a vector defined on a mesh to a new mesh. More... | |
void | MeshToMesh (Mesh &m1, Mesh &m2, const Vect< real_t > &u1, Vect< real_t > &u2, const Point< real_t > &xmin, const Point< real_t > &xmax, size_t nx, size_t ny, size_t nz, size_t dof=1) |
Function to redefine a vector defined on a mesh to a new mesh. More... | |
real_t | getMaxSize (const Mesh &m) |
Return maximal size of element edges for given mesh. More... | |
real_t | getMinSize (const Mesh &m) |
Return minimal size of element edges for given mesh. More... | |
real_t | getMinElementMeasure (const Mesh &m) |
Return minimal measure (length, area or volume) of elements of given mesh. More... | |
real_t | getMaxElementMeasure (const Mesh &m) |
Return maximal measure (length, area or volume) of elements of given mesh. More... | |
real_t | getMinSideMeasure (const Mesh &m) |
Return minimal measure (length or area) of sides of given mesh. More... | |
real_t | getMaxSideMeasure (const Mesh &m) |
Return maximal measure (length or area) of sides of given mesh. More... | |
real_t | getMeanElementMeasure (const Mesh &m) |
Return average measure (length, area or volume) of elements of given mesh. More... | |
real_t | getMeanSideMeasure (const Mesh &m) |
Return average measure (length or area) of sides of given mesh. More... | |
void | setNodeCodes (Mesh &m, const string &exp, int code, size_t dof=1) |
Assign a given code to all nodes satisfying a boolean expression using node coordinates. More... | |
void | setBoundaryNodeCodes (Mesh &m, const string &exp, int code, size_t dof=1) |
Assign a given code to all nodes on boundary that satisfy a boolean expression using node coordinates. More... | |
int | NodeInElement (const Node *nd, const Element *el) |
Say if a given node belongs to a given element. More... | |
int | NodeInSide (const Node *nd, const Side *sd) |
Say if a given node belongs to a given side. More... | |
int | SideInElement (const Side *sd, const Element *el) |
Say if a given side belongs to a given element. More... | |
ostream & | operator<< (ostream &s, const Node &nd) |
Output node data. More... | |
ostream & | operator<< (ostream &s, const Side &sd) |
Output side data. More... | |
Detailed Description
Mesh management classes
Macro Definition Documentation
◆ ActiveElementLoop
#define ActiveElementLoop | ( | m | ) | for ((m).topElement(); (theElement=(m).getActiveElement());) |
A macro to loop on mesh active elements m : Instance of Mesh
- Note
- : Each iteration updates the pointer
theElement
to current Element - : This macro is necessary only if adaptive meshing is used
◆ BoundaryNodeLoop
#define BoundaryNodeLoop | ( | m | ) | for ((m).topBoundaryNode(); (theNode=(m).getBoundaryNode());) |
A macro to loop on mesh nodes m
: Instance of Mesh
- Note
- : Each iteration updates the pointer
theNode
to current Node
◆ BoundarySideLoop
#define BoundarySideLoop | ( | m | ) | for ((m).topBoundarySide(); (theSide=(m).getBoundarySide());) |
A macro to loop on mesh boundary sides m
: Instance of Mesh
- Note
- : Each iteration updates the pointer
theSide
to current Node
◆ EdgeLoop
#define EdgeLoop | ( | m | ) | for ((m).topEdge(); (theEdge=(m).getEdge());) |
A macro to loop on mesh edges m : Instance of Mesh
- Note
- : Each iteration updates the pointer
theEdge
to current Edge
◆ ElementLoop
#define ElementLoop | ( | m | ) | for ((m).topElement(); (theElement=(m).getElement());) |
A macro to loop on mesh elements m : Instance of Mesh
- Note
- : Each iteration updates the pointer
theElement
to current Element
◆ GRAPH_MEMORY
#define GRAPH_MEMORY 1000000 |
Memory necessary to store matrix graph.
This value is necessary only if nodes are to be renumbered.
◆ NodeLoop
#define NodeLoop | ( | m | ) | for ((m).topNode(); (theNode=(m).getNode());) |
A macro to loop on mesh nodes m : Instance of Mesh
- Note
- : Each iteration updates the pointer theNode to current Node
◆ SideLoop
#define SideLoop | ( | m | ) | for ((m).topSide(); (theSide=(m).getSide());) |
A macro to loop on mesh sides m : Instance of Mesh
- Note
- : Each iteration updates the pointer
theSide
to current Element
◆ TheEdge
#define TheEdge (*theEdge) |
A macro that gives the instance pointed by theEdge
◆ TheElement
#define TheElement (*theElement) |
A macro that gives the instance pointed by theElement
◆ TheNode
#define TheNode (*theNode) |
A macro that gives the instance pointed by theNode
◆ theNodeLabel
#define theNodeLabel theNode->n() |
A macro that returns node label in a loop using macro MeshNodes
◆ TheSide
#define TheSide (*theSide) |
A macro that gives the instance pointed by theSide
Function Documentation
◆ Code() [1/3]
int Code | ( | const Element & | el | ) |
Return code of a given element.
- Parameters
-
[in] el Reference to Element instance
- Returns
- Code of element
- Copyright
- GNU Lesser Public License
◆ Code() [2/3]
int Code | ( | const Node & | nd, |
size_t | i = 1 |
||
) |
Return code of a given (degree of freedom of) node.
- Parameters
-
[in] nd Reference to Node instance [in] i Label of dof [Default: 1
]
- Returns
- Code of dof of node
- Copyright
- GNU Lesser Public License
◆ Code() [3/3]
int Code | ( | const Side & | sd, |
size_t | i = 1 |
||
) |
Return code of a given (degree of freedom of) side.
- Parameters
-
[in] sd Reference to Side instance [in] i Label of dof [Default: 1
]
- Returns
- Code of dof of side
- Copyright
- GNU Lesser Public License
◆ Coord()
Return coordinates of a given node.
- Parameters
-
[in] nd Reference to Node instance
- Returns
- Coordinates of node
- Copyright
- GNU Lesser Public License
◆ DeformMesh()
Calculate deformed mesh using a displacement field.
- Parameters
-
[in,out] mesh Mesh instance. On output, node coordinates are modified to take into account the displacement [in] u Displacement field at nodes [in] a Maximal deformation rate. [Default: 1
]. A typical value is 0.2 (i.e. 20%).
- Copyright
- GNU Lesser Public License
◆ getMaxElementMeasure()
Return maximal measure (length, area or volume) of elements of given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Copyright
- GNU Lesser Public License
◆ getMaxSideMeasure()
Return maximal measure (length or area) of sides of given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Note
- Use this function only if sides are present in the mesh and for 2-D meshes
- Copyright
- GNU Lesser Public License
◆ getMaxSize()
Return maximal size of element edges for given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Copyright
- GNU Lesser Public License
◆ getMeanElementMeasure()
Return average measure (length, area or volume) of elements of given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Copyright
- GNU Lesser Public License
◆ getMeanSideMeasure()
Return average measure (length or area) of sides of given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Note
- Use this function only if sides are present in the mesh and for 2-D meshes
- Copyright
- GNU Lesser Public License
◆ getMinElementMeasure()
Return minimal measure (length, area or volume) of elements of given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Copyright
- GNU Lesser Public License
◆ getMinSideMeasure()
Return minimal measure (length or area) of sides of given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Note
- Use this function only if sides are present in the mesh and for 2-D meshes
- Copyright
- GNU Lesser Public License
◆ getMinSize()
Return minimal size of element edges for given mesh.
- Parameters
-
[in] m Reference to mesh instance
- Copyright
- GNU Lesser Public License
◆ Label() [1/4]
size_t Label | ( | const Edge & | ed | ) |
Return label of a given edge.
- Parameters
-
[in] ed Reference to Edge instance
- Returns
- Label of edge
- Copyright
- GNU Lesser Public License
◆ Label() [2/4]
size_t Label | ( | const Element & | el | ) |
Return label of a given element.
- Parameters
-
[in] el Reference to Element instance
- Returns
- Label of element
- Copyright
- GNU Lesser Public License
◆ Label() [3/4]
size_t Label | ( | const Node & | nd | ) |
Return label of a given node.
- Parameters
-
[in] nd Reference to Node instance
- Returns
- Label of node
- Copyright
- GNU Lesser Public License
◆ Label() [4/4]
size_t Label | ( | const Side & | sd | ) |
Return label of a given side.
- Parameters
-
[in] sd Reference to Side instance
- Returns
- Label of side
- Copyright
- GNU Lesser Public License
◆ MeshToMesh() [1/3]
void MeshToMesh | ( | const Vect< real_t > & | u1, |
Vect< real_t > & | u2, | ||
size_t | nx, | ||
size_t | ny = 0 , |
||
size_t | nz = 0 , |
||
size_t | dof = 1 |
||
) |
Function to redefine a vector defined on a mesh to a new mesh.
The program interpolates (piecewise linear) first the vector on a finer structured grid. Then the values on the new mesh nodes are computed.
- Remarks
- For efficiency the number of grid cells must be large enough so that interpolation provides efficient accuracy
- Parameters
-
[in] u1 Input vector of nodal values defined on first mesh. This vector instance must contain Mesh instance [out] u2 Output vector of nodal values defined on second mesh. This vector instance must contain Mesh instance [in] nx Number of cells in the x
-direction in the fine structured grid[in] ny Number of cells in the y
-direction in the fine structured grid The default value ofny
is0
, i.e. a 1-D grid[in] nz Number of cells in the z
-direction in the fine structured grid The default value ofnz
is0
, i.e. a 1-D or 2-D grid[in] dof Label of degree of freedom of vector u
. Only this dof is considered. [Default:1
]
- Note
- The input vector
u1
is a one degree of freedom per node vector, i.e. its size must be equal (or greater than) the total number of nodes of meshm1
. The size of vectoru2
is deduced from the meshm2
- Copyright
- GNU Lesser Public License
◆ MeshToMesh() [2/3]
void MeshToMesh | ( | Mesh & | m1, |
Mesh & | m2, | ||
const Vect< real_t > & | u1, | ||
Vect< real_t > & | u2, | ||
const Point< real_t > & | xmin, | ||
const Point< real_t > & | xmax, | ||
size_t | nx, | ||
size_t | ny, | ||
size_t | nz, | ||
size_t | dof = 1 |
||
) |
Function to redefine a vector defined on a mesh to a new mesh.
The program interpolates (piecewise linear) first the vector on a finer structured grid. Then the values on the new mesh nodes are computed. In this function the grid rectangle is defined so that this one can cover only a submesh of m1
.
- Remarks
- For efficiency the number of grid cells must be large enough so that interpolation provides efficient accuracy
- Parameters
-
[in] m1 Reference to the first mesh instance [out] m2 Reference to the second mesh instance [in] u1 Input vector of nodal values defined on first mesh [out] u2 Output vector of nodal values defined on second mesh [in] xmin Point instance containing minimal coordinates of the rectangle that defines the grid [in] xmax Point instance containing maximal coordinates of the rectangle that defines the grid [in] nx Number of cells in the x
-direction in the fine structured grid[in] ny Number of cells in the y
-direction in the fine structured grid The default value ofny
is0
, i.e. a 1-D grid[in] nz Number of cells in the z
-direction in the fine structured grid The default value ofnz
is0
, i.e. a 1-D or 2-D grid[in] dof Label of degree of freedom of vector u
. Only this dof is considered. [Default:1
]
- Note
- The input vector
u1
is a one degree of freedom per node vector, i.e. its size must be equal (or greater than) the total number of nodes of meshm1
. The size of vectoru2
is deduced from the meshm2
- Copyright
- GNU Lesser Public License
◆ MeshToMesh() [3/3]
void MeshToMesh | ( | Mesh & | m1, |
Mesh & | m2, | ||
const Vect< real_t > & | u1, | ||
Vect< real_t > & | u2, | ||
size_t | nx, | ||
size_t | ny = 0 , |
||
size_t | nz = 0 , |
||
size_t | dof = 1 |
||
) |
Function to redefine a vector defined on a mesh to a new mesh.
The program interpolates (piecewise linear) first the vector on a finer structured grid. Then the values on the new mesh nodes are computed.
- Remarks
- For efficiency the number of grid cells must be large enough so that interpolation provides efficient accuracy
- Parameters
-
[in] m1 Reference to the first mesh instance [out] m2 Reference to the second mesh instance [in] u1 Input vector of nodal values defined on first mesh [out] u2 Output vector of nodal values defined on second mesh [in] nx Number of cells in the x
-direction in the fine structured grid[in] ny Number of cells in the y
-direction in the fine structured grid The default value ofny
is0
, i.e. a 1-D grid[in] nz Number of cells in the z
-direction in the fine structured grid The default value ofnz
is0
, i.e. a 1-D or 2-D grid[in] dof Label of degree of freedom of vector u
. Only this dof is considered. [Default:1
]
- Note
- The input vector
u1
is a one degree of freedom per node vector, i.e. its size must be equal (or greater than) the total number of nodes of meshm1
. The size of vectoru2
is deduced from the meshm2
- Copyright
- GNU Lesser Public License
◆ NodeInElement()
◆ NodeInSide()
◆ NodeLabel() [1/2]
size_t NodeLabel | ( | const Element & | el, |
size_t | n | ||
) |
Return global label of node local label in element.
- Parameters
-
[in] el Reference to Element instance [in] n Local label of node in element
- Returns
- Global label of node
- Copyright
- GNU Lesser Public License
◆ NodeLabel() [2/2]
size_t NodeLabel | ( | const Side & | sd, |
size_t | n | ||
) |
Return global label of node local label in side.
- Parameters
-
[in] sd Reference to Side instance [in] n Local label of node in side
- Returns
- Global label of node
- Copyright
- GNU Lesser Public License
◆ operator&&()
◆ operator-()
◆ operator<<() [1/7]
ostream & operator<< | ( | ostream & | s, |
const EdgeList & | el | ||
) |
Output EdgeList instance.
- Copyright
- GNU Lesser Public License
◆ operator<<() [2/7]
ostream & operator<< | ( | ostream & | s, |
const ElementList & | el | ||
) |
Output ElementList instance.
- Copyright
- GNU Lesser Public License
◆ operator<<() [3/7]
ostream & operator<< | ( | ostream & | s, |
const Mesh & | ms | ||
) |
Output mesh data.
Level of mesh output depends on the global variable Verbosity
- If Verbosity=0 or Verbosity=1, this function outputs only principal mesh parameters: number of nodes, number of elements, ...
- If Verbosity>1, this function outputs in addition the list of 10 first nodes, elements and sides
- If Verbosity>2, this function outputs in addition the list of 50 first nodes, elements and sides
- If Verbosity>3, this function outputs all mesh data
◆ operator<<() [4/7]
ostream & operator<< | ( | ostream & | s, |
const Node & | nd | ||
) |
Output node data.
- Copyright
- GNU Lesser Public License
◆ operator<<() [5/7]
ostream & operator<< | ( | ostream & | s, |
const NodeList & | nl | ||
) |
Output NodeList instance.
- Copyright
- GNU Lesser Public License
◆ operator<<() [6/7]
ostream & operator<< | ( | ostream & | s, |
const Side & | sd | ||
) |
Output side data.
- Copyright
- GNU Lesser Public License
◆ operator<<() [7/7]
ostream & operator<< | ( | ostream & | s, |
const SideList & | sl | ||
) |
Output SideList instance.
- Copyright
- GNU Lesser Public License
◆ operator==() [1/2]
◆ operator==() [2/2]
◆ operator||()
◆ setBoundaryNodeCodes()
void setBoundaryNodeCodes | ( | Mesh & | m, |
const string & | exp, | ||
int | code, | ||
size_t | dof = 1 |
||
) |
Assign a given code to all nodes on boundary that satisfy a boolean expression using node coordinates.
- Parameters
-
[in] m Reference to mesh instance [in] exp Regular expression using x
,y
, andz
coordinates of nodes, according toexprtk
parser[in] code Code to assign [in] dof Degree of freedom for which code is assigned [Default: 1
]
- Copyright
- GNU Lesser Public License
◆ setNodeCodes()
void setNodeCodes | ( | Mesh & | m, |
const string & | exp, | ||
int | code, | ||
size_t | dof = 1 |
||
) |
Assign a given code to all nodes satisfying a boolean expression using node coordinates.
- Parameters
-
[in] m Reference to mesh instance [in] exp Regular expression using x
,y
, andz
coordinates of nodes, according toexprtk
parser[in] code Code to assign [in] dof Degree of freedom for which code is assigned [Default: 1
]