libMesh::XdrSHEAD Class Reference

#include <xdr_shead.h>

Inheritance diagram for libMesh::XdrSHEAD:

Public Member Functions

 XdrSHEAD ()
 
 ~XdrSHEAD ()
 
void setNumVar (int numvar)
 
void setWrtVar (int wrtVar)
 
int getWrtVar () const
 
void setMeshCnt (int meshCnt)
 
void setKstep (int kstep)
 
void setTime (Real time)
 
void setUserTitle (const char *title)
 
const char * getUserTitle () const
 
void setVarTitle (const char *titles, int len)
 
const char * getVarTitle () const
 
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
 

Friends

class XdrSOLN
 

Detailed Description

The XdrSHEAD class. This class is responsible for reading/writing xdr solution file headers.

Author
Bill Barth
Robert McLay
Date
2000

Definition at line 40 of file xdr_shead.h.

Constructor & Destructor Documentation

libMesh::XdrSHEAD::XdrSHEAD ( )
inline

Constructor.

Definition at line 47 of file xdr_shead.h.

47 {}
libMesh::XdrSHEAD::~XdrSHEAD ( )
inline

Destructor.

Definition at line 52 of file xdr_shead.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.

References libmesh_nullptr.

Referenced by libMesh::XdrMESH::header(), libMesh::XdrHEAD::setId(), libMesh::XdrHEAD::setTitle(), setUserTitle(), and 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
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::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; }
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
const char* libMesh::XdrSHEAD::getUserTitle ( ) const
inline

Get the user solution title.

Definition at line 118 of file xdr_shead.h.

References libMesh::XdrHEAD::mp_userTitle.

Referenced by libMesh::XdrSOLN::header().

118 { return mp_userTitle; }
char * mp_userTitle
Definition: xdr_head.h:178
const char* libMesh::XdrSHEAD::getVarTitle ( ) const
inline

Get null-terminated list of variable names.

Definition at line 130 of file xdr_shead.h.

References libMesh::XdrHEAD::mp_varTitle.

Referenced by libMesh::XdrSOLN::header(), and libMesh::LegacyXdrIO::read_soln().

130 { return mp_varTitle; }
char * mp_varTitle
Definition: xdr_head.h:183
int libMesh::XdrSHEAD::getWrtVar ( ) const
inline

Get the number of written solution variables.

Definition at line 76 of file xdr_shead.h.

References libMesh::XdrHEAD::m_wrtVar.

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

76 { return m_wrtVar; }
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::XdrSHEAD::setKstep ( int  kstep)
inline

Get the mesh file number. Set the solution step number.

Definition at line 92 of file xdr_shead.h.

References libMesh::XdrHEAD::m_kstep.

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

92 { m_kstep = kstep; }
void libMesh::XdrSHEAD::setMeshCnt ( int  meshCnt)
inline

Set the mesh file number.

Definition at line 81 of file xdr_shead.h.

References libMesh::XdrHEAD::m_meshCnt.

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

81 { m_meshCnt = meshCnt; }
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::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::XdrSHEAD::setNumVar ( int  numvar)
inline

Set the total number of solution variables.

Definition at line 58 of file xdr_shead.h.

References libMesh::XdrHEAD::m_numvar.

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

58 { m_numvar = numvar; }
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::XdrSHEAD::setTime ( Real  time)
inline

Get the solution step number. Set the solution time.

Definition at line 103 of file xdr_shead.h.

References libMesh::XdrHEAD::m_time.

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

103 { m_time = time; }
xdr_Real m_time
Definition: xdr_head.h:188
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
void libMesh::XdrSHEAD::setUserTitle ( const char *  title)
inline

Get the solution time. Set the user solution title.

Definition at line 113 of file xdr_shead.h.

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

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

113 { delete [] mp_userTitle; mp_userTitle = cpyString(title); }
char * mp_userTitle
Definition: xdr_head.h:178
char * cpyString(const char *src, int len=-1)
Definition: xdr_head.C:59
void libMesh::XdrSHEAD::setVarTitle ( const char *  titles,
int  len 
)
inline

Set null-terminated list of variable names.

Definition at line 124 of file xdr_shead.h.

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

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

124 { delete [] mp_varTitle; mp_varTitle = cpyString(titles, len); }
char * cpyString(const char *src, int len=-1)
Definition: xdr_head.C:59
char * mp_varTitle
Definition: xdr_head.h:183
void libMesh::XdrSHEAD::setWrtVar ( int  wrtVar)
inline

Get the total number of solution variables. Set the number of written solution variables.

Definition at line 70 of file xdr_shead.h.

References libMesh::XdrHEAD::m_wrtVar.

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

70 { m_wrtVar = wrtVar; }

Friends And Related Function Documentation

friend class XdrSOLN
friend

Definition at line 42 of file xdr_shead.h.

Member Data Documentation

int libMesh::XdrHEAD::m_kstep
protectedinherited

The internal solution number.

Definition at line 133 of file xdr_head.h.

Referenced by libMesh::XdrSOLN::header(), 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(), 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 libMesh::XdrMHEAD::getNumEl(), libMesh::XdrMESH::header(), libMesh::XdrMHEAD::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(), 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 libMesh::XdrMHEAD::getSumWghts(), libMesh::XdrMESH::header(), libMesh::XdrMHEAD::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(), 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 getWrtVar(), libMesh::XdrSOLN::header(), setWrtVar(), and libMesh::XdrHEAD::XdrHEAD().

char* libMesh::XdrHEAD::mp_id
protectedinherited
char* libMesh::XdrHEAD::mp_title
protectedinherited
char* libMesh::XdrHEAD::mp_userTitle
protectedinherited

User's simulation title

Definition at line 178 of file xdr_head.h.

Referenced by getUserTitle(), libMesh::XdrSOLN::header(), setUserTitle(), libMesh::XdrHEAD::XdrHEAD(), and libMesh::XdrHEAD::~XdrHEAD().

char* libMesh::XdrHEAD::mp_varTitle
protectedinherited

List of null-separated variable names.

Definition at line 183 of file xdr_head.h.

Referenced by getVarTitle(), libMesh::XdrSOLN::header(), setVarTitle(), libMesh::XdrHEAD::XdrHEAD(), and libMesh::XdrHEAD::~XdrHEAD().


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