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< ElemType > block_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. Modified: John W. Peterson

Definition at line 39 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 47 of file xdr_mhead.h.

47 : _n_blocks(1) {}
libMesh::XdrMHEAD::~XdrMHEAD ( )
inline

Destructor.

Definition at line 52 of file xdr_mhead.h.

52 {}

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.

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

60 {
61  char* temp = NULL;
62  int myLen = len;
63  if(src)
64  {
65  if (myLen == -1)
66  myLen = libmesh_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 }
void libMesh::XdrMHEAD::get_block_elt_types ( std::vector< ElemType > &  bet) const
inline

Element block types are defined in 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 99 of file xdr_mhead.h.

References block_elt_types.

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

99 { bet = block_elt_types; }
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 86 of file xdr_mhead.h.

References _n_blocks.

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

86 { return _n_blocks; }
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 113 of file xdr_mhead.h.

References num_elem_each_block.

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

113 { neeb = num_elem_each_block; }
const char* libMesh::XdrHEAD::getId ( ) const
inlineinherited

Get the mesh/solution file id.

Definition at line 55 of file xdr_head.h.

References libMesh::XdrHEAD::mp_id.

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

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

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

Definition at line 91 of file xdr_head.h.

References libMesh::XdrHEAD::m_numBCs.

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

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

Get the number of elements in the mesh.

Definition at line 64 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_numel.

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

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

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

Definition at line 77 of file xdr_head.h.

References libMesh::XdrHEAD::m_numNodes.

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

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

Get the mesh weighting.

{DEAL mesh specific get/set functions}

Definition at line 78 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_sumWghts.

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

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

Get the mesh/solution file title.

Definition at line 65 of file xdr_head.h.

References libMesh::XdrHEAD::mp_title.

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

65 { return mp_title; }
void libMesh::XdrMHEAD::set_block_elt_types ( const std::vector< ElemType > &  bet)
inline

Set 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::write_mesh().

104 { block_elt_types = bet; }
void libMesh::XdrMHEAD::set_n_blocks ( const unsigned int  nb)
inline

Sets 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::write_mesh().

91 { this->_n_blocks = nb; }
void libMesh::XdrMHEAD::set_num_elem_each_block ( const std::vector< unsigned int > &  neeb)
inline

Set 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::write_mesh().

118 { num_elem_each_block = neeb; }
void libMesh::XdrHEAD::setId ( const char *  id)
inlineinherited

Set the mesh/solution file id.

Definition at line 50 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().

50 { delete [] mp_id; mp_id = cpyString(id); }
void libMesh::XdrHEAD::setNumBCs ( int  numBCs)
inlineinherited

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

Definition at line 84 of file xdr_head.h.

References libMesh::XdrHEAD::m_numBCs.

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

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

Set the number of elements in the mesh.

Definition at line 58 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_numel.

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

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

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

Definition at line 71 of file xdr_head.h.

References libMesh::XdrHEAD::m_numNodes.

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

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

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

Definition at line 97 of file xdr_head.h.

References libMesh::XdrHEAD::m_strSize.

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

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

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

Definition at line 71 of file xdr_mhead.h.

References libMesh::XdrHEAD::m_sumWghts.

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

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

Set the mesh/solution file title.

Definition at line 60 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().

60 { delete [] mp_title; mp_title = cpyString(title); }

Friends And Related Function Documentation

friend class XdrMESH
friend

Definition at line 41 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 132 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
elem_type.h for more

Definition at line 144 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 131 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 126 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 156 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 137 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 119 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 161 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 150 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 186 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 111 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 151 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:

Site Created By: libMesh Developers
Last modified: February 07 2014 16:58:02 UTC

Hosted By:
SourceForge.net Logo