hp2FEM
0.1
|
This class store the information for the elements including shape, mesh type, element order distribution, maximum element order, element order/incidence/nodal coordinates/dof numbering for each element and the local topological indices. The main purpose of this class is to collect all mesh data used during the generation of high-order nodes, solution and post-processing. More...
#include <Mesh.h>
Public Member Functions | |
Mesh () | |
Default constructor. | |
Mesh (MeshID_E MshID) | |
The constructo to set the mesh ID. | |
Mesh (unsigned long NumberElements, ElementShape_E ElementShape, MeshType_E MeshType, pMesh_E pDistribution, unsigned long MaxPolyOrder=0) | |
Constructor with parameters. | |
Mesh (Mesh &Instance) | |
Copy-initializer constructor. Copies the contents of Instance for the object. | |
~Mesh () | |
Destructor. | |
Mesh & | operator= (Mesh &Instance) |
Copies the contents of Instance for the object. | |
operator ElementTopologicalIndices & () | |
Cast operation for the instance LocTopInd of type LocalTopolgicalIndices. | |
ElementTopologicalIndices & | GetElementLocalTopIndices () |
Cast operation for the instance LocTopInd of type LocalTopolgicalIndices. | |
MeshID_E | GetMeshID () |
Returns the mesh ID. | |
MeshType_E | GetMeshType () |
Returns the mesh type. | |
unsigned long | GetDimension () |
Returns the element dimension (1, 2, 3) | |
pMesh_E | GetpDistribution () |
Returns the type of polynomial order distribution on the mesh. | |
ElementShape_E | GetElementShape () |
Returns the element shape. | |
unsigned long | GetMaxPolyOrder () |
Returns the maximmum polynomial order for the elements of the mesh. | |
unsigned long | GetNumberElements () |
Returns the number of elements of the mesh. | |
unsigned long | GetElementOrder (unsigned long ElementNumber) |
Returns the element order for the given element number. | |
long * | GetElementIncidence (unsigned long ElementNumber, unsigned long &NumberNodes) |
Returns the incidence of the element given in the parameter ElementNumber. | |
long * | GetElementEquations (unsigned long ElementNumber, unsigned long &NumberEquations) |
Returns the equations (dof numbering) of the element given in the parameter ElementNumber. | |
double * | GetElementCoordinates (unsigned long ElementNumber, unsigned long &NumberCoords) |
Returns the nodal coordinates of the element given in the parameter ElementNumber. | |
double * | GetNodeCoordinates (unsigned long LocalElementNumber, unsigned long NodeNumber, unsigned long &NumberDofs) |
Returns the nodal coordinates of the node given in the parameter NodeNumber. | |
double * | GetElementDeformedCoordinates (unsigned long ElementNumber, unsigned long &NumberCoords) |
Returns the deformed nodal coordinates of the element given in the parameter ElementNumber. | |
void | GetEdgeCoordinates (unsigned long ElemNumber, unsigned long EdgeNumber, double *EdgeCoords, unsigned long &NumEdgeCoords) |
Gets the edge coordinates for a given element. | |
void | GetFaceCoordinates (unsigned long ElemNumber, unsigned long FaceNumber, double *FaceCoords, unsigned long &NumFaceCoords) |
Gets the face coordinates for a given element. | |
unsigned long | GetNumberTopologicalEntities (Entity_E TopoEntity) |
Returns the number of topological entities for the element shape. | |
unsigned long | GetNumberNodesOnTopologicalEntities (unsigned long ElementNumber, Entity_E TopoEntity) |
Returns the number of nodes/modes on the topological entity for the given element number. | |
BuiltInArray< unsigned long > & | GetElementOrder () |
Returns the element orders. | |
BuiltInArray< long > & | GetPolynomialOrders () |
Returns the polynomial orders. | |
OneIndexTable< long > & | GetIncidence () |
Returns the incidence of all elements of the mesh. | |
OneIndexTable< double > & | GetCoordinates () |
Returns the nodal coordinates of all elements of the mesh. | |
OneIndexTable< double > & | GetDeformCoordinates () |
Returns the nodal coordinates of all elements of the deformed mesh. | |
OneIndexTable< long > & | GetEquations () |
Returns the equations/dof numbering of all elements of the mesh. | |
BuiltInArray< unsigned long > & | GetNumberElementNodes () |
Returns the number of element nodes. | |
unsigned long | GetPosTotalNumberDOFsByGroup () |
Returns the total number of the DOFs by group of the post processing mesh. | |
void | SetMeshType (MeshType_E MeshType) |
Sets the mesh type. | |
void | SetDimension (unsigned long Dimension) |
Sets the element dimension (1, 2, 3) | |
void | SetpDistribution (pMesh_E pMsh) |
Sets the type of polynomial order distribution on the mesh. | |
void | SetMaxPolyOrder (unsigned long MaxPolyOrder) |
Sets the maximum polynomial order for the elements of the mesh. | |
void | SetNumberElements (unsigned long NElems) |
Sets the number of elements. | |
void | SetNumberElementNodes (BuiltInArray< unsigned long > &NElemNodes, long NElems) |
Sets the number of element nodes and the number of mesh elements. Allocates the element incidences table. | |
void | SetNumberElementNodes (unsigned long NElemNodes, long NElems) |
Sets the number of element nodes and the number of mesh elements. Allocates the element incidences table. | |
void | SetElementShape (ElementShape_E Element) |
Sets the element shape. | |
void | SetPolynomialOrders (BuiltInArray< unsigned long > &ElemOrders) |
Sets the different polynomial orders using the element orders. | |
void | SetElementOrder (BuiltInArray< unsigned long > &ElementOrder) |
Sets the polynomial order for each element. if pMesh is equal pUNIFORM there is just an order. | |
void | SetSizeElemCoordsTable () |
Sets the size of the element coordinates. | |
void | SetSizeElemIncidTable () |
Sets the size of the element incidence. | |
void | SetAllElementsCoords (double *const coords) |
Copy the coordinates of all nodes. | |
void | SetElementCoords (unsigned long ElemNum, unsigned long nNodes, double *const coords) |
Sets the coordinates for every node. | |
void | SetElementIncidence (unsigned long ElemNum, unsigned long NodePos, unsigned long NodeNum) |
Sets the element incidence. | |
void | SetEquations (OneIndexTable< long > ElementIncid, unsigned long NumberDOFs) |
Generates equations to a specific mesh. | |
void | SetEquations (OneIndexTable< long > ElementIncid, OneIndexTable< unsigned long > NodalDOFNumbers) |
Generates equations to a specific mesh. | |
void | SetMeshID (MeshID_E MshID) |
Sets the mesh ID. | |
void | UpdateCoordinates (Vector &Displacement) |
Updates the element nodal coordinates based on an initial set of coordinates and a variation of the coordinates values. | |
void | UpdateCoordinates (Vector &Displacement, long NumberFreeDOFs) |
Updates the element nodal coordinates based on an initial set of coordinates and a variation of the coordinates values. | |
void | Save (FILE *File) |
Writes class information to a binary file. | |
void | Restore (FILE *File) |
Restores class data from a binary file. | |
void | Read (FILE *FEMFile, FILE *DEFFile, ElementShape_E ElementShape, unsigned long NumberElements, unsigned long GroupNumber, unsigned long Dimension) |
Reads the some properties of the mesh. | |
void | ReadIncidence (FILE *FEMFile) |
Reads the incidence of the mesh of the FE from .fem file. | |
void | Print (FILE *File) |
Prints Mesh information to an ASCII file. | |
void | Free () |
Releases the physical memory allocate for the mesh attributes. | |
Protected Attributes | |
MeshID_E | MeshID |
Stores the kind of mesh used. | |
ElementShape_E | ElemShape |
Stores the element shape. | |
unsigned long | Dim |
Element dimension (1,2,3). | |
MeshType_E | MshType |
Stores if the mesh is uniform, nonuniform or unstructured. | |
pMesh_E | pMesh |
Stores if the mesh is p-uniform or p-nonuniform. | |
unsigned long | MaxOrder |
Stores the maximum polynomial order. | |
unsigned long | NumElems |
Stores the number of elements. | |
BuiltInArray< unsigned long > | NumElemNodes |
Stores the number of element nodes. | |
BuiltInArray< long > | PolyOrder |
The different polynomial order using the element orders. | |
BuiltInArray< unsigned long > | ElemOrder |
Stores the polynomial order for each element. | |
OneIndexTable< long > | ElemIncid |
Stores the element incidence. | |
OneIndexTable< long > | ElemEquations |
Stores the element DOFs numbering. | |
OneIndexTable< double > | ElemCoords |
Stores the element nodal coordinates for the undeformed mesh. | |
OneIndexTable< double > | ElemDeformCoords |
Stores the element nodal coordinates for the deformed mesh. | |
ElementTopologicalIndices | LocTopInd |
Stores the local node numbers for each polynomial order. | |
unsigned long | PosTotalNumberDOFsByGroup |
Stores the local node numbers for each polynomial order. |
This class store the information for the elements including shape, mesh type, element order distribution, maximum element order, element order/incidence/nodal coordinates/dof numbering for each element and the local topological indices. The main purpose of this class is to collect all mesh data used during the generation of high-order nodes, solution and post-processing.
Mesh::Mesh | ( | MeshID_E | MshID | ) |
The constructo to set the mesh ID.
[in] | MshID | - the mesh ID. |
Mesh::Mesh | ( | unsigned long | NumberElements, |
ElementShape_E | ElementShape, | ||
MeshType_E | MeshType, | ||
pMesh_E | pDistribution, | ||
unsigned long | MaxPolyOrder = 0 |
||
) |
Constructor with parameters.
[in] | NumberElements | - number of mesh elements. |
[in] | ElementShape | - element shape. |
[in] | MeshType | - type of the mesh. |
[in] | pDistribution | - type of distirbution of the element orders (p-uniform or p-nonuniform). |
[in] | MaxPolyOrder | - maximum polynomial order for all elements of the mesh. |
Mesh::Mesh | ( | Mesh & | Instance | ) |
Copy-initializer constructor. Copies the contents of Instance for the object.
[in] | Instance | - instance of Mesh. |
void Mesh::Free | ( | ) |
Releases the physical memory allocate for the mesh attributes.
OneIndexTable< double > & Mesh::GetCoordinates | ( | ) |
Returns the nodal coordinates of all elements of the mesh.
OneIndexTable< double > & Mesh::GetDeformCoordinates | ( | ) |
Returns the nodal coordinates of all elements of the deformed mesh.
unsigned long Mesh::GetDimension | ( | ) |
Returns the element dimension (1, 2, 3)
void Mesh::GetEdgeCoordinates | ( | unsigned long | ElemNumber, |
unsigned long | EdgeNumber, | ||
double * | EdgeCoords, | ||
unsigned long & | NumEdgeCoords | ||
) |
Gets the edge coordinates for a given element.
[in] | - | ElemNumber - Local element number |
[in] | - | EdgeNumber - Local edge number |
[out] | - | EdgeCoords - Edge Coordinates |
[out] | - | NumEdgeCoords - Number of edge coordinates |
double * Mesh::GetElementCoordinates | ( | unsigned long | ElementNumber, |
unsigned long & | NumberCoords | ||
) |
Returns the nodal coordinates of the element given in the parameter ElementNumber.
[in] | ElementNumber | - number of the element for which the nodal coordinates are returned. |
[out] | NumberCoords | - store the number of nodal coordinates of the element. |
double * Mesh::GetElementDeformedCoordinates | ( | unsigned long | ElementNumber, |
unsigned long & | NumberCoords | ||
) |
Returns the deformed nodal coordinates of the element given in the parameter ElementNumber.
[in] | ElementNumber | - number of the element for which the nodal coordinates are returned. |
[out] | NumberCoords | - store the number of nodal coordinates of the element. |
long * Mesh::GetElementEquations | ( | unsigned long | ElementNumber, |
unsigned long & | NumberEquations | ||
) |
Returns the equations (dof numbering) of the element given in the parameter ElementNumber.
[in] | ElementNumber | - number of the element for which the dof numbering is returned. |
[out] | NumberEquations | - store the number of equations/dofs of the element. |
long * Mesh::GetElementIncidence | ( | unsigned long | ElementNumber, |
unsigned long & | NumberNodes | ||
) |
Returns the incidence of the element given in the parameter ElementNumber.
[in] | ElementNumber | - number of the element for which the incidence is returned. |
[out] | NumberNodes | - store the number of nodes/modes of the element |
Cast operation for the instance LocTopInd of type LocalTopolgicalIndices.
unsigned long Mesh::GetElementOrder | ( | unsigned long | ElementNumber | ) |
Returns the element order for the given element number.
[in] | ElementNumber | - number of the element. |
BuiltInArray< unsigned long > & Mesh::GetElementOrder | ( | ) |
Returns the element orders.
ElementShape_E Mesh::GetElementShape | ( | ) |
Returns the element shape.
OneIndexTable< long > & Mesh::GetEquations | ( | ) |
Returns the equations/dof numbering of all elements of the mesh.
void Mesh::GetFaceCoordinates | ( | unsigned long | ElemNumber, |
unsigned long | FaceNumber, | ||
double * | FaceCoords, | ||
unsigned long & | NumFaceCoords | ||
) |
Gets the face coordinates for a given element.
[in] | - | ElemNumber - Local Element number. |
[in] | - | FaceNumber - Local Face number. |
[out] | - | FaceCoords - Edge coordinates. |
[out] | - | NumFaceCoords - Number of face coordinates. |
OneIndexTable< long > & Mesh::GetIncidence | ( | ) |
Returns the incidence of all elements of the mesh.
unsigned long Mesh::GetMaxPolyOrder | ( | ) |
Returns the maximmum polynomial order for the elements of the mesh.
MeshID_E Mesh::GetMeshID | ( | ) |
Returns the mesh ID.
MeshType_E Mesh::GetMeshType | ( | ) |
Returns the mesh type.
double * Mesh::GetNodeCoordinates | ( | unsigned long | LocalElementNumber, |
unsigned long | NodeNumber, | ||
unsigned long & | NumberDofs | ||
) |
Returns the nodal coordinates of the node given in the parameter NodeNumber.
[in] | LocalElementNumber | - local number of the element. |
[in] | NodeNumber | - number of the node for which the coordinates are returned. |
[out] | NumberDofs | - store the number of nodal coordinates of the element. |
BuiltInArray< unsigned long > & Mesh::GetNumberElementNodes | ( | ) |
Returns the number of element nodes.
unsigned long Mesh::GetNumberElements | ( | ) |
Returns the number of elements of the mesh.
unsigned long Mesh::GetNumberNodesOnTopologicalEntities | ( | unsigned long | ElementNumber, |
Entity_E | TopoEntity | ||
) |
Returns the number of nodes/modes on the topological entity for the given element number.
[in] | ElementNumber | - element number |
[in] | TopoEntity | - type of topological entity (vertex, edge, face, volume). |
unsigned long Mesh::GetNumberTopologicalEntities | ( | Entity_E | TopoEntity | ) |
Returns the number of topological entities for the element shape.
[in] | TopoEntity | - type of topological entity (vertex, edge, face, volume). |
pMesh_E Mesh::GetpDistribution | ( | ) |
Returns the type of polynomial order distribution on the mesh.
BuiltInArray< long > & Mesh::GetPolynomialOrders | ( | ) |
Returns the polynomial orders.
unsigned long Mesh::GetPosTotalNumberDOFsByGroup | ( | ) |
Mesh::operator ElementTopologicalIndices & | ( | ) |
Cast operation for the instance LocTopInd of type LocalTopolgicalIndices.
Copies the contents of Instance for the object.
[in] | Instance | - instance of Mesh. |
void Mesh::Print | ( | FILE * | File | ) |
Prints Mesh information to an ASCII file.
[in] | File | - pointer to the ASCII file. |
void Mesh::Read | ( | FILE * | FEMFile, |
FILE * | DEFFile, | ||
ElementShape_E | ElementShape, | ||
unsigned long | NumberElements, | ||
unsigned long | GroupNumber, | ||
unsigned long | Dimension | ||
) |
Reads the some properties of the mesh.
[in] | FEMFile | - pointer to the .fem file with mesh data. |
[in] | DEFFile | - pointer to the .def file with model attributes data. |
[in] | ElementShape | - Element Shape of the mesh. |
[in] | NumberElements | - Number of elements of the mesh. |
[in] | GroupNumber | - group number. |
[in] | Dimension | - the dimension of element. |
void Mesh::ReadIncidence | ( | FILE * | FEMFile | ) |
Reads the incidence of the mesh of the FE from .fem file.
[in] | FEMFile | - the ascii file used to read the .fem file. |
void Mesh::Restore | ( | FILE * | File | ) |
Restores class data from a binary file.
[in] | File | - pointer to the binary fil |
void Mesh::Save | ( | FILE * | File | ) |
Writes class information to a binary file.
[in] | File | - Pointer to the file. |
void Mesh::SetAllElementsCoords | ( | double *const | coords | ) |
Copy the coordinates of all nodes.
[in] | coords | - the coordinates of the nodes. |
void Mesh::SetDimension | ( | unsigned long | Dimension | ) |
Sets the element dimension (1, 2, 3)
[in] | Dimension | - Dimension of the mesh. |
void Mesh::SetElementOrder | ( | BuiltInArray< unsigned long > & | ElementOrder | ) |
Sets the polynomial order for each element. if pMesh is equal pUNIFORM there is just an order.
[in] | ElementOrder | - array of the polynomial orders for each element. |
void Mesh::SetElementShape | ( | ElementShape_E | Element | ) |
void Mesh::SetEquations | ( | OneIndexTable< long > | ElementIncid, |
unsigned long | NumberDOFs | ||
) |
Generates equations to a specific mesh.
@ ElementIncid - Element incidences table
@ NumberDOFs - Number of Degrees of freedoms
void Mesh::SetEquations | ( | OneIndexTable< long > | ElementIncid, |
OneIndexTable< unsigned long > | NodalDOFNumbers | ||
) |
Generates equations to a specific mesh.
- Element incidences table
- Nodal DOF numbering.
void Mesh::SetMaxPolyOrder | ( | unsigned long | MaxPolyOrder | ) |
Sets the maximum polynomial order for the elements of the mesh.
[in] | MaxPolyOrder | - Maximum polynomial order. |
void Mesh::SetMeshID | ( | MeshID_E | MshID | ) |
Sets the mesh ID.
[in] | MshID | - the mesh ID. |
void Mesh::SetMeshType | ( | MeshType_E | MeshType | ) |
void Mesh::SetNumberElementNodes | ( | BuiltInArray< unsigned long > & | NElemNodes, |
long | NElems | ||
) |
Sets the number of element nodes and the number of mesh elements. Allocates the element incidences table.
[in] | NElemNodes | - array of element nodes to all orders. |
[in] | NElems | - number of mesh elements. |
void Mesh::SetNumberElementNodes | ( | unsigned long | NElemNodes, |
long | NElems | ||
) |
Sets the number of element nodes and the number of mesh elements. Allocates the element incidences table.
[in] | NElemNodes | - number of element nodes. |
[in] | NElems | - number of mesh elements. |
void Mesh::SetNumberElements | ( | unsigned long | NElems | ) |
Sets the number of elements.
[in] | NElems | - Used to sets the number of elements. |
void Mesh::SetpDistribution | ( | pMesh_E | pMsh | ) |
Sets the type of polynomial order distribution on the mesh.
[in] | pMsh | - pMesh param used to sets p-uniform or p-nonuniform to the polynomial order distribution. |
void Mesh::SetPolynomialOrders | ( | BuiltInArray< unsigned long > & | ElemOrders | ) |
Sets the different polynomial orders using the element orders.
[in] | ElemOrders | - array of the polynomial orders. |
void Mesh::UpdateCoordinates | ( | Vector & | Displacement | ) |
Updates the element nodal coordinates based on an initial set of coordinates and a variation of the coordinates values.
[in] | Displacement | - Vector of displacements values for each nodal dof. |
void Mesh::UpdateCoordinates | ( | Vector & | Displacement, |
long | NumberFreeDOFs | ||
) |
Updates the element nodal coordinates based on an initial set of coordinates and a variation of the coordinates values.
[in] | Displacement | - Vector of displacements values for each nodal dof. |