$extrastylesheet
libMesh::XdrMHEAD Class Reference

#include <xdr_mhead.h>

Inheritance diagram for libMesh::XdrMHEAD:

List of all members.

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

Definition at line 39 of file xdr_mhead.h.


Constructor & Destructor Documentation

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.

: _n_blocks(1) {}

Destructor.

Definition at line 52 of file xdr_mhead.h.

{}

Member Function Documentation

char * libMesh::XdrHEAD::cpyString ( const char *  src,
int  len = -1 
) [protected, inherited]

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().

{
  char* temp = NULL;
  int myLen = len;
  if(src)
    {
      if (myLen == -1)
        myLen = cast_int<int>(std::strlen(src))+1;
      temp = new char[myLen];
      temp = (char *) std::memcpy(temp, src, (myLen)*sizeof(char));
    }
  return temp;
}
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().

{ 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().

{ 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().

{ neeb = num_elem_each_block; }
const char* libMesh::XdrHEAD::getId ( ) const [inline, inherited]

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().

{ return mp_id; }
int libMesh::XdrHEAD::getNumBCs ( ) const [inline, inherited]

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().

{ 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().

{ return m_numel; }
int libMesh::XdrHEAD::getNumNodes ( ) const [inline, inherited]

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().

{ 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().

{ return m_sumWghts; }
const char* libMesh::XdrHEAD::getTitle ( ) const [inline, inherited]

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().

{ 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().

{ 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().

{ 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().

{ num_elem_each_block = neeb; }
void libMesh::XdrHEAD::setId ( const char *  id) [inline, inherited]
void libMesh::XdrHEAD::setNumBCs ( int  numBCs) [inline, inherited]

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().

{ 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().

{ m_numel = numel; }
void libMesh::XdrHEAD::setNumNodes ( int  numNodes) [inline, inherited]

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().

{ m_numNodes = numNodes; }
void libMesh::XdrHEAD::setStrSize ( int  strSize) [inline, inherited]

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().

{ 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().

{ m_sumWghts = sumWghts; }
void libMesh::XdrHEAD::setTitle ( const char *  title) [inline, inherited]

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().

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 [protected, inherited]

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 [protected, inherited]

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 [protected, inherited]

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 [protected, inherited]

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 [protected, inherited]
int libMesh::XdrHEAD::m_numvar [protected, inherited]

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 [protected, inherited]

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 [protected, inherited]

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 [protected, inherited]

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 [protected, inherited]

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_varTitle [protected, inherited]
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: