libMesh::XdrMHEAD Class Reference

#include <xdr_mhead.h>

Inheritance diagram for libMesh::XdrMHEAD:

Public Member Functions

 XdrMHEAD ()
 
 ~XdrMHEAD ()
 
void setNumEl (int numel)
 
int getNumEl () const
 
void setSumWghts (int sumWghts)
 
int getSumWghts () const
 
unsigned int get_n_blocks () const
 
void set_n_blocks (const unsigned int nb)
 
void get_block_elt_types (std::vector< ElemType > &bet) const
 
void set_block_elt_types (const std::vector< ElemType > &bet)
 
void get_num_elem_each_block (std::vector< unsigned int > &neeb) const
 
void set_num_elem_each_block (const std::vector< unsigned int > &neeb)
 
void setId (const char *id)
 
const char * getId () const
 
void setTitle (const char *title)
 
const char * getTitle () const
 
void setNumNodes (int numNodes)
 
int getNumNodes () const
 
void setNumBCs (int numBCs)
 
int getNumBCs () const
 
void setStrSize (int strSize)
 

Protected Member Functions

char * cpyString (const char *src, int len=-1)
 

Protected Attributes

int m_wrtVar
 
int m_numvar
 
int m_meshCnt
 
int m_kstep
 
int m_numel
 
int m_numNodes
 
int m_sumWghts
 
int m_numBCs
 
int m_strSize
 
char * mp_id
 
char * mp_title
 
char * mp_userTitle
 
char * mp_varTitle
 
xdr_Real m_time
 

Private Attributes

unsigned int _n_blocks
 
std::vector< ElemTypeblock_elt_types
 
std::vector< unsigned int > num_elem_each_block
 

Friends

class XdrMESH
 

Detailed Description

The XdrMHEAD class. This class is responsible for reading/writing xdr mesh file headers.

Author
Bill Barth
Robert McLay
John W. Peterson
Date
2000

Definition at line 44 of file xdr_mhead.h.

Constructor & Destructor Documentation

libMesh::XdrMHEAD::XdrMHEAD ( )
inline

Constructor. Initializes the number of blocks in the mesh to 1 and the number of levels to zero.

Definition at line 52 of file xdr_mhead.h.

52 : _n_blocks(1) {}
unsigned int _n_blocks
Definition: xdr_mhead.h:137
libMesh::XdrMHEAD::~XdrMHEAD ( )
inline

Destructor.

Definition at line 57 of file xdr_mhead.h.

57 {}

Member Function Documentation

char * libMesh::XdrHEAD::cpyString ( const char *  src,
int  len = -1 
)
protectedinherited

Uses std::memcpy to create an exact copy of src, then returns that copy. Note: I don't know where the memory allocated for this copy gets deleted!

Returns
Copy of src

Definition at line 59 of file xdr_head.C.

References libmesh_nullptr.

Referenced by libMesh::XdrMESH::header(), libMesh::XdrHEAD::setId(), libMesh::XdrHEAD::setTitle(), libMesh::XdrSHEAD::setUserTitle(), and libMesh::XdrSHEAD::setVarTitle().

60 {
61  char * temp = libmesh_nullptr;
62  int myLen = len;
63  if(src)
64  {
65  if (myLen == -1)
66  myLen = cast_int<int>(std::strlen(src))+1;
67  temp = new char[myLen];
68  temp = (char *) std::memcpy(temp, src, (myLen)*sizeof(char));
69  }
70  return temp;
71 }
const class libmesh_nullptr_t libmesh_nullptr
void libMesh::XdrMHEAD::get_block_elt_types ( std::vector< ElemType > &  bet) const
inline

Element block types are defined in enum_elem_type.h. They may be for example TRI3, TRI6, QUAD4, etc.

Returns
A writeable reference to the vector of element block types.

Definition at line 104 of file xdr_mhead.h.

References block_elt_types.

Referenced by libMesh::XdrMESH::header(), and libMesh::LegacyXdrIO::read_mesh().

104 { bet = block_elt_types; }
std::vector< ElemType > block_elt_types
Definition: xdr_mhead.h:149
unsigned int libMesh::XdrMHEAD::get_n_blocks ( ) const
inline

A mesh block by definition contains only a single type of element.

Returns
The number of mesh blocks.

Definition at line 91 of file xdr_mhead.h.

References _n_blocks.

Referenced by libMesh::XdrMESH::header(), and libMesh::LegacyXdrIO::read_mesh().

91 { return _n_blocks; }
unsigned int _n_blocks
Definition: xdr_mhead.h:137
void libMesh::XdrMHEAD::get_num_elem_each_block ( std::vector< unsigned int > &  neeb) const
inline

The size of each element block is the total number of a given type of element in the mesh.

Returns
The vector of block sizes

Definition at line 118 of file xdr_mhead.h.

References num_elem_each_block.

Referenced by libMesh::XdrMESH::header(), and libMesh::LegacyXdrIO::read_mesh().

118 { neeb = num_elem_each_block; }
std::vector< unsigned int > num_elem_each_block
Definition: xdr_mhead.h:156
const char* libMesh::XdrHEAD::getId ( ) const
inlineinherited

Get the mesh/solution file id.

Definition at line 57 of file xdr_head.h.

References libMesh::XdrHEAD::mp_id.

Referenced by libMesh::XdrSOLN::header(), and libMesh::XdrMESH::header().

57 { return mp_id; }
int libMesh::XdrHEAD::getNumBCs ( ) const
inlineinherited

Get the number of boundary conditions in them mesh/solution file.

Definition at line 93 of file xdr_head.h.

References libMesh::XdrHEAD::m_numBCs.

Referenced by libMesh::LegacyXdrIO::read_mesh().

93 { return m_numBCs; }
int libMesh::XdrMHEAD::getNumEl ( ) const
inline

Get the number of elements in the mesh.

Definition at line 69 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_numel.

Referenced by libMesh::LegacyXdrIO::read_mesh().

69 { return m_numel; }
int libMesh::XdrHEAD::getNumNodes ( ) const
inlineinherited

Get the total number of nodes in the mesh/solution file.

Definition at line 79 of file xdr_head.h.

References libMesh::XdrHEAD::m_numNodes.

Referenced by libMesh::LegacyXdrIO::read_mesh(), and libMesh::LegacyXdrIO::read_soln().

79 { return m_numNodes; }
int libMesh::XdrMHEAD::getSumWghts ( ) const
inline

Get the mesh weighting.

{DEAL mesh specific get/set functions}

Definition at line 83 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_sumWghts.

Referenced by libMesh::LegacyXdrIO::read_mesh().

83 { return m_sumWghts; }
const char* libMesh::XdrHEAD::getTitle ( ) const
inlineinherited

Get the mesh/solution file title.

Definition at line 67 of file xdr_head.h.

References libMesh::XdrHEAD::mp_title.

Referenced by libMesh::XdrSOLN::header(), and libMesh::XdrMESH::header().

67 { return mp_title; }
char * mp_title
Definition: xdr_head.h:173
void libMesh::XdrMHEAD::set_block_elt_types ( const std::vector< ElemType > &  bet)
inline

Set the vector of element block types

Definition at line 109 of file xdr_mhead.h.

References block_elt_types.

Referenced by libMesh::XdrMESH::header(), and libMesh::LegacyXdrIO::write_mesh().

109 { block_elt_types = bet; }
std::vector< ElemType > block_elt_types
Definition: xdr_mhead.h:149
void libMesh::XdrMHEAD::set_n_blocks ( const unsigned int  nb)
inline

Sets the number of mesh blocks.

Definition at line 96 of file xdr_mhead.h.

References _n_blocks.

Referenced by libMesh::XdrMESH::header(), and libMesh::LegacyXdrIO::write_mesh().

96 { this->_n_blocks = nb; }
unsigned int _n_blocks
Definition: xdr_mhead.h:137
void libMesh::XdrMHEAD::set_num_elem_each_block ( const std::vector< unsigned int > &  neeb)
inline

Set the vector of block sizes

Definition at line 123 of file xdr_mhead.h.

References num_elem_each_block.

Referenced by libMesh::XdrMESH::header(), and libMesh::LegacyXdrIO::write_mesh().

123 { num_elem_each_block = neeb; }
std::vector< unsigned int > num_elem_each_block
Definition: xdr_mhead.h:156
void libMesh::XdrHEAD::setId ( const char *  id)
inlineinherited

Set the mesh/solution file id.

Definition at line 52 of file xdr_head.h.

References libMesh::XdrHEAD::cpyString(), and libMesh::XdrHEAD::mp_id.

Referenced by libMesh::XdrSOLN::header(), libMesh::XdrMESH::header(), libMesh::LegacyXdrIO::write_mesh(), and libMesh::LegacyXdrIO::write_soln().

52 { delete [] mp_id; mp_id = cpyString(id); }
char * cpyString(const char *src, int len=-1)
Definition: xdr_head.C:59
void libMesh::XdrHEAD::setNumBCs ( int  numBCs)
inlineinherited

Set the number of boundary conditions in the mesh/solution file.

Definition at line 86 of file xdr_head.h.

References libMesh::XdrHEAD::m_numBCs.

Referenced by libMesh::LegacyXdrIO::write_mesh(), and libMesh::LegacyXdrIO::write_soln().

86 { m_numBCs = numBCs; }
void libMesh::XdrMHEAD::setNumEl ( int  numel)
inline

Set the number of elements in the mesh.

Definition at line 63 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_numel.

Referenced by libMesh::LegacyXdrIO::write_mesh().

63 { m_numel = numel; }
void libMesh::XdrHEAD::setNumNodes ( int  numNodes)
inlineinherited

Set the total number of nodes in the mesh/solution file.

Definition at line 73 of file xdr_head.h.

References libMesh::XdrHEAD::m_numNodes.

Referenced by libMesh::LegacyXdrIO::write_mesh(), and libMesh::LegacyXdrIO::write_soln().

73 { m_numNodes = numNodes; }
void libMesh::XdrHEAD::setStrSize ( int  strSize)
inlineinherited

Set the string size of the mesh/solution file. (?)

Definition at line 99 of file xdr_head.h.

References libMesh::XdrHEAD::m_strSize.

Referenced by libMesh::LegacyXdrIO::write_mesh(), and libMesh::LegacyXdrIO::write_soln().

99 { m_strSize = strSize; }
void libMesh::XdrMHEAD::setSumWghts ( int  sumWghts)
inline

Set the mesh weighting. You probably shouldn't set this yourself ...

Definition at line 76 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_sumWghts.

Referenced by libMesh::LegacyXdrIO::write_mesh().

76 { m_sumWghts = sumWghts; }
void libMesh::XdrHEAD::setTitle ( const char *  title)
inlineinherited

Set the mesh/solution file title.

Definition at line 62 of file xdr_head.h.

References libMesh::XdrHEAD::cpyString(), and libMesh::XdrHEAD::mp_title.

Referenced by libMesh::XdrSOLN::header(), libMesh::XdrMESH::header(), libMesh::LegacyXdrIO::write_mesh(), and libMesh::LegacyXdrIO::write_soln().

62 { delete [] mp_title; mp_title = cpyString(title); }
char * cpyString(const char *src, int len=-1)
Definition: xdr_head.C:59
char * mp_title
Definition: xdr_head.h:173

Friends And Related Function Documentation

friend class XdrMESH
friend

Definition at line 46 of file xdr_mhead.h.

Member Data Documentation

unsigned int libMesh::XdrMHEAD::_n_blocks
private

DEAL mesh specific variables:

Tells the total number of element blocks. An element block is contains only a single type of element.

Definition at line 137 of file xdr_mhead.h.

Referenced by get_n_blocks(), and set_n_blocks().

std::vector<ElemType> libMesh::XdrMHEAD::block_elt_types
private

A vector of length n_blocks which describes the elemnt type in each block e.g. TRI, QUAD, etc. Note: The element type uniquely defines the number of nodes for that element.

See also
enum_elem_type.h for more

Definition at line 149 of file xdr_mhead.h.

Referenced by get_block_elt_types(), and set_block_elt_types().

int libMesh::XdrHEAD::m_kstep
protectedinherited

The internal solution number.

Definition at line 133 of file xdr_head.h.

Referenced by libMesh::XdrSOLN::header(), libMesh::XdrSHEAD::setKstep(), and libMesh::XdrHEAD::XdrHEAD().

int libMesh::XdrHEAD::m_meshCnt
protectedinherited

The mesh file number which corresponds to a given solution file.

Definition at line 128 of file xdr_head.h.

Referenced by libMesh::XdrSOLN::header(), libMesh::XdrSHEAD::setMeshCnt(), and libMesh::XdrHEAD::XdrHEAD().

int libMesh::XdrHEAD::m_numBCs
protectedinherited

Number of boundary conditions in the solution/mesh.

Definition at line 158 of file xdr_head.h.

Referenced by libMesh::XdrHEAD::getNumBCs(), libMesh::XdrMESH::header(), libMesh::XdrHEAD::setNumBCs(), and libMesh::XdrHEAD::XdrHEAD().

int libMesh::XdrHEAD::m_numel
protectedinherited

Number of elemetns in the solution/mesh.

Definition at line 139 of file xdr_head.h.

Referenced by getNumEl(), libMesh::XdrMESH::header(), setNumEl(), and libMesh::XdrHEAD::XdrHEAD().

int libMesh::XdrHEAD::m_numNodes
protectedinherited
int libMesh::XdrHEAD::m_numvar
protectedinherited

Total number of variables, may differ from the total number of variables actually written.

Definition at line 121 of file xdr_head.h.

Referenced by libMesh::XdrSOLN::header(), libMesh::XdrSHEAD::setNumVar(), and libMesh::XdrHEAD::XdrHEAD().

int libMesh::XdrHEAD::m_strSize
protectedinherited

String size (Not sure of what?)

Definition at line 163 of file xdr_head.h.

Referenced by libMesh::XdrSOLN::header(), libMesh::XdrMESH::header(), libMesh::XdrHEAD::setStrSize(), and libMesh::XdrHEAD::XdrHEAD().

int libMesh::XdrHEAD::m_sumWghts
protectedinherited

Total mesh weighting i.e. How many nodes are there and where are they?

Definition at line 152 of file xdr_head.h.

Referenced by getSumWghts(), libMesh::XdrMESH::header(), setSumWghts(), and libMesh::XdrHEAD::XdrHEAD().

xdr_Real libMesh::XdrHEAD::m_time
protectedinherited

Current solution time.

Definition at line 188 of file xdr_head.h.

Referenced by libMesh::XdrSOLN::header(), libMesh::XdrSHEAD::setTime(), and libMesh::XdrHEAD::XdrHEAD().

int libMesh::XdrHEAD::m_wrtVar
protectedinherited

Set the string size of the mesh /solutionfile. (?) Number of variables written to output, e.g. u,v,w,p,T = 5

Definition at line 113 of file xdr_head.h.

Referenced by libMesh::XdrSHEAD::getWrtVar(), libMesh::XdrSOLN::header(), libMesh::XdrSHEAD::setWrtVar(), and libMesh::XdrHEAD::XdrHEAD().

char* libMesh::XdrHEAD::mp_id
protectedinherited
char* libMesh::XdrHEAD::mp_title
protectedinherited
char* libMesh::XdrHEAD::mp_userTitle
protectedinherited
char* libMesh::XdrHEAD::mp_varTitle
protectedinherited
std::vector<unsigned int> libMesh::XdrMHEAD::num_elem_each_block
private

A vector of length n_blocks containing the number of elements in each block.

Definition at line 156 of file xdr_mhead.h.

Referenced by get_num_elem_each_block(), and set_num_elem_each_block().


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