hp2FEM  0.1
Public Member Functions | Protected Attributes
Mesh Class Reference

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>

Collaboration diagram for Mesh:
Collaboration graph
[legend]

List of all members.

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.
Meshoperator= (Mesh &Instance)
 Copies the contents of Instance for the object.
 operator ElementTopologicalIndices & ()
 Cast operation for the instance LocTopInd of type LocalTopolgicalIndices.
ElementTopologicalIndicesGetElementLocalTopIndices ()
 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.

Detailed Description

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.

Author:
Marco Lucio Bittencourt/ Fabiano Fernandes Bargos Gilberto Luis Valente da Costa
Date:
March/28/2011

Constructor & Destructor Documentation

Mesh::Mesh ( MeshID_E  MshID)

The constructo to set the mesh ID.

Parameters:
[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.

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.

Parameters:
[in]Instance- instance of Mesh.
Returns:
Reference of the current object.

Member Function Documentation

void Mesh::Free ( )

Releases the physical memory allocate for the mesh attributes.

Note:
Statically allocated variables are set to the default values.

Returns the nodal coordinates of all elements of the mesh.

Returns:
Returns a reference to a table which stores the element nodal coordinates.

Returns the nodal coordinates of all elements of the deformed mesh.

Returns:
Returns a reference to a table which stores the element nodal coordinates.
unsigned long Mesh::GetDimension ( )

Returns the element dimension (1, 2, 3)

Returns:
an unsigned long with the element dimension value.
void Mesh::GetEdgeCoordinates ( unsigned long  ElemNumber,
unsigned long  EdgeNumber,
double *  EdgeCoords,
unsigned long &  NumEdgeCoords 
)

Gets the edge coordinates for a given element.

Parameters:
[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.

Parameters:
[in]ElementNumber- number of the element for which the nodal coordinates are returned.
[out]NumberCoords- store the number of nodal coordinates of the element.
Returns:
a pointer to double * const with the element nodal coordinates stored as (X,Y,Z) for each node.
double * Mesh::GetElementDeformedCoordinates ( unsigned long  ElementNumber,
unsigned long &  NumberCoords 
)

Returns the deformed nodal coordinates of the element given in the parameter ElementNumber.

Parameters:
[in]ElementNumber- number of the element for which the nodal coordinates are returned.
[out]NumberCoords- store the number of nodal coordinates of the element.
Returns:
a pointer to double * const with the element nodal coordinates stored as (X,Y,Z) for each node.
long * Mesh::GetElementEquations ( unsigned long  ElementNumber,
unsigned long &  NumberEquations 
)

Returns the equations (dof numbering) of the element given in the parameter ElementNumber.

Parameters:
[in]ElementNumber- number of the element for which the dof numbering is returned.
[out]NumberEquations- store the number of equations/dofs of the element.
Returns:
Array with the element nodal coordinates.
long * Mesh::GetElementIncidence ( unsigned long  ElementNumber,
unsigned long &  NumberNodes 
)

Returns the incidence of the element given in the parameter ElementNumber.

Parameters:
[in]ElementNumber- number of the element for which the incidence is returned.
[out]NumberNodes- store the number of nodes/modes of the element
Returns:
Array with the element incidence.

Cast operation for the instance LocTopInd of type LocalTopolgicalIndices.

Returns:
Reference for insatnec of LocalTopologicalIndices.
unsigned long Mesh::GetElementOrder ( unsigned long  ElementNumber)

Returns the element order for the given element number.

Parameters:
[in]ElementNumber- number of the element.
Returns:
Element polynomial order
BuiltInArray< unsigned long > & Mesh::GetElementOrder ( )

Returns the element orders.

Returns:
Returns a reference to a BuiltInArray which stores the element orders.
ElementShape_E Mesh::GetElementShape ( )

Returns the element shape.

Returns:
Element shape as an enumerate.

Returns the equations/dof numbering of all elements of the mesh.

Returns:
Returns a reference to a table which stores the element dof numberings.
void Mesh::GetFaceCoordinates ( unsigned long  ElemNumber,
unsigned long  FaceNumber,
double *  FaceCoords,
unsigned long &  NumFaceCoords 
)

Gets the face coordinates for a given element.

Parameters:
[in]-ElemNumber - Local Element number.
[in]-FaceNumber - Local Face number.
[out]-FaceCoords - Edge coordinates.
[out]-NumFaceCoords - Number of face coordinates.

Returns the incidence of all elements of the mesh.

Returns:
Returns a reference to a table which stores the element incidences.
unsigned long Mesh::GetMaxPolyOrder ( )

Returns the maximmum polynomial order for the elements of the mesh.

Returns:
Returns maximum polynomial order.
MeshID_E Mesh::GetMeshID ( )

Returns the mesh ID.

Returns:
Mesh ID (INPUT, SOLUTION, MAPPING, POST_PROCESSING).
MeshType_E Mesh::GetMeshType ( )

Returns the mesh type.

Returns:
Mesh type (uniform, non-uniform, unstructured).
double * Mesh::GetNodeCoordinates ( unsigned long  LocalElementNumber,
unsigned long  NodeNumber,
unsigned long &  NumberDofs 
)

Returns the nodal coordinates of the node given in the parameter NodeNumber.

Parameters:
[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.
Returns:
a pointer to double * const with the nodal coordinates stored as (X,Y,Z) for the node.
BuiltInArray< unsigned long > & Mesh::GetNumberElementNodes ( )

Returns the number of element nodes.

Returns:
an unsigned long type that to store the number of element nodes.
unsigned long Mesh::GetNumberElements ( )

Returns the number of elements of the mesh.

Returns:
Returns the number of elements.
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.

Parameters:
[in]ElementNumber- element number
[in]TopoEntity- type of topological entity (vertex, edge, face, volume).
Returns:
Number of nodes/modes.
unsigned long Mesh::GetNumberTopologicalEntities ( Entity_E  TopoEntity)

Returns the number of topological entities for the element shape.

Parameters:
[in]TopoEntity- type of topological entity (vertex, edge, face, volume).
Returns:
Number of topological entities.

Returns the type of polynomial order distribution on the mesh.

Returns:
Returns p-uniform or p-nonuniform,

Returns the polynomial orders.

Returns:
Returns a reference to a BuiltInArray which stores the polynomial orders.

Returns the total number of the DOFs by group of the post processing mesh.

Returns:
an unsigned long type that to store the total number of DOFs.
Mesh::operator ElementTopologicalIndices & ( )

Cast operation for the instance LocTopInd of type LocalTopolgicalIndices.

Returns:
Reference for insatnec of LocalTopologicalIndices.
Mesh & Mesh::operator= ( Mesh Instance)

Copies the contents of Instance for the object.

Parameters:
[in]Instance- instance of Mesh.
Returns:
Reference of the current object.
void Mesh::Print ( FILE *  File)

Prints Mesh information to an ASCII file.

Parameters:
[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.

Parameters:
[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.

Parameters:
[in]FEMFile- the ascii file used to read the .fem file.
void Mesh::Restore ( FILE *  File)

Restores class data from a binary file.

Parameters:
[in]File- pointer to the binary fil
void Mesh::Save ( FILE *  File)

Writes class information to a binary file.

Parameters:
[in]File- Pointer to the file.
void Mesh::SetAllElementsCoords ( double *const  coords)

Copy the coordinates of all nodes.

Parameters:
[in]coords- the coordinates of the nodes.
void Mesh::SetDimension ( unsigned long  Dimension)

Sets the element dimension (1, 2, 3)

Parameters:
[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.

Parameters:
[in]ElementOrder- array of the polynomial orders for each element.
void Mesh::SetElementShape ( ElementShape_E  Element)

Sets the element shape.

Parameters:
[in]Element- The element shape used to set the attribute ElemShape of the Mesh Class.
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.

Parameters:
[in]MaxPolyOrder- Maximum polynomial order.
void Mesh::SetMeshID ( MeshID_E  MshID)

Sets the mesh ID.

Parameters:
[in]MshID- the mesh ID.
void Mesh::SetMeshType ( MeshType_E  MeshType)

Sets the mesh type.

Parameters:
[in]MeshType- The mesh type used to set the attribute MshType of the Mesh Class
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.

Parameters:
[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.

Parameters:
[in]NElemNodes- number of element nodes.
[in]NElems- number of mesh elements.
void Mesh::SetNumberElements ( unsigned long  NElems)

Sets the number of elements.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[in]Displacement- Vector of displacements values for each nodal dof.

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Friends Defines