AtilaCalculatorSoftware  2.3.4
C++ Interface for Atila fem resources files
Mesh Class Reference

Representation of a mesh, all of its nodes and elements. More...

#include <mesh.h>

Public Member Functions

 Mesh (gzFile file, dataFields fields)
 
std::string getName ()
 
std::string getElementName ()
 
GiD_ElementType getElementType ()
 
unsigned int getDimCount () const
 
unsigned int getNodeCount () const
 
unsigned int getElementCount () const
 
std::vector< NodegetNodes ()
 
std::tuple< int &, int * > getElement (const unsigned int &id) const
 

Static Public Member Functions

static GiD_ElementType getGiDElementType (const char *element)
 Write the mesh into a currently open PostResultFile. More...
 

Static Public Attributes

static size_t maxNodeCount = 0
 Biggest number of node encountered in the mesh. More...
 
static const std::map< std::string, GiD_ElementType > GiD_ElementTypeEncoding
 Map of all recognized GiD_ElementType according to their string encoded value. More...
 

Private Member Functions

void readCoordinates (gzFile &file, char buffer[GZ_BUFFER_SIZE])
 
void readElements (gzFile &file, char buffer[GZ_BUFFER_SIZE])
 

Private Attributes

std::string name
 Name of the mesh. More...
 
std::string elementName
 String encoded element type of the mesh. More...
 
GiD_ElementType elementType
 Element type of the mesh. More...
 
unsigned int dimCount
 Number of dimensions of the object (2 or 3) More...
 
unsigned int nodeCount
 Number of nodes which constitutes the mesh. More...
 
unsigned int elementCount
 Number of elements in the mesh. More...
 
std::vector< Nodenodes
 Nodes that constitutes the mesh. More...
 
int * elements
 Elements of the mesh. More...
 
int * elementsConnectivity
 Connectivity of the elements. More...
 

Detailed Description

Representation of a mesh, all of its nodes and elements.

Constructor & Destructor Documentation

◆ Mesh()

Mesh::Mesh ( gzFile  file,
dataFields  fields 
)
Parameters
fileFile that contains the mesh information
fieldsBase fields read from the file

Member Function Documentation

◆ getDimCount()

unsigned int Mesh::getDimCount ( ) const
Returns
The number of dimension of the mesh (2 or 3)

◆ getElement()

std::tuple< int &, int * > Mesh::getElement ( const unsigned int &  id) const
Parameters
idID of the element
Returns
Return information about an element:

◆ getElementCount()

unsigned int Mesh::getElementCount ( ) const
Returns
The number of elements in the mesh

◆ getElementName()

std::string Mesh::getElementName ( )
Returns
The string encoded element type of the mesh

◆ getElementType()

GiD_ElementType Mesh::getElementType ( )
Returns
The Element type of the mesh

◆ getGiDElementType()

GiD_ElementType Mesh::getGiDElementType ( const char *  element)
static

Write the mesh into a currently open PostResultFile.

Returns
The state of the GiD Post Mesh closure Get the GiD_ElementType of a string encoded GiDElementType
Parameters
elementstring encoded GiD_ElementType
Returns
The according GiD_ElementType, GiD_NoElement by default
Exceptions
runtime_errorif the encoded GiD_ElementType is not recognized

◆ getName()

std::string Mesh::getName ( )
Returns
The name of the name

◆ getNodeCount()

unsigned int Mesh::getNodeCount ( ) const
Returns
The number of nodes that constitutes the mesh

◆ getNodes()

std::vector<Node> Mesh::getNodes ( )
Returns
The nodes that constitutes the mesh

◆ readCoordinates()

void Mesh::readCoordinates ( gzFile &  file,
char  buffer[GZ_BUFFER_SIZE] 
)
private

Read the nodes coordinates from the mesh file

Parameters
fileFile that contains the mesh information
bufferThe zlib reading buffer from previous gzread

◆ readElements()

void Mesh::readElements ( gzFile &  file,
char  buffer[GZ_BUFFER_SIZE] 
)
private

Read the elements from the mesh file

Parameters
fileFile that contains the mesh information
bufferThe zlib reading buffer from previous gzread

Member Data Documentation

◆ dimCount

unsigned int Mesh::dimCount
private

Number of dimensions of the object (2 or 3)

◆ elementCount

unsigned int Mesh::elementCount
private

Number of elements in the mesh.

◆ elementName

std::string Mesh::elementName
private

String encoded element type of the mesh.

◆ elements

int* Mesh::elements
private

Elements of the mesh.

◆ elementsConnectivity

int* Mesh::elementsConnectivity
private

Connectivity of the elements.

◆ elementType

GiD_ElementType Mesh::elementType
private

Element type of the mesh.

◆ GiD_ElementTypeEncoding

const std::map< std::string, GiD_ElementType > Mesh::GiD_ElementTypeEncoding
static
Initial value:
= {
{ "", GiD_NoElement },
{ "Point", GiD_NoElement },
{ "Linear", GiD_NoElement },
{ "Triangle", GiD_Triangle },
{ "Quadrilateral", GiD_Quadrilateral },
{ "Tetrahedra", GiD_Tetrahedra },
{ "Hexahedra", GiD_Hexahedra },
{ "Prism", GiD_Prism },
{ "Pyramid", GiD_NoElement },
{ "Sphere", GiD_NoElement },
{ "Circle", GiD_NoElement }
}

Map of all recognized GiD_ElementType according to their string encoded value.

◆ maxNodeCount

size_t Mesh::maxNodeCount = 0
static

Biggest number of node encountered in the mesh.

◆ name

std::string Mesh::name
private

Name of the mesh.

◆ nodeCount

unsigned int Mesh::nodeCount
private

Number of nodes which constitutes the mesh.

◆ nodes

std::vector<Node> Mesh::nodes
private

Nodes that constitutes the mesh.


The documentation for this class was generated from the following files: