libMesh::XdrHEAD Class Reference

#include <xdr_head.h>

Inheritance diagram for libMesh::XdrHEAD:

Public Member Functions

 XdrHEAD ()
 
virtual ~XdrHEAD ()
 
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 Member Functions

 XdrHEAD (const XdrHEAD &)
 
const XdrHEADoperator= (const XdrHEAD &)
 

Detailed Description

The XdrHEAD class. This is a base class for deriving either solution (XdrSHEAD) or mesh (XdrMHEAD) header interface classes.

Author
Bill Barth, Robert McLay.

Definition at line 34 of file xdr_head.h.

Constructor & Destructor Documentation

libMesh::XdrHEAD::XdrHEAD ( )

Constructor.

Definition at line 26 of file xdr_head.C.

References m_kstep, m_meshCnt, m_numBCs, m_numel, m_numNodes, m_numvar, m_strSize, m_sumWghts, m_time, m_wrtVar, mp_id, mp_title, mp_userTitle, and mp_varTitle.

27 {
28  m_wrtVar = 0;
29  m_numvar = 0;
30 
31  m_meshCnt = 0;
32  m_kstep = 0;
33 
34  m_numel = 0;
35  m_numNodes = 0;
36  m_sumWghts = 0;
37  m_numBCs = 0;
38  m_strSize = 0;
39  mp_id = 0;
40  mp_title = 0;
41  mp_userTitle = 0;
42  mp_varTitle = 0;
43 
44  m_time = 0;
45 }
libMesh::XdrHEAD::~XdrHEAD ( )
virtual

Destructor.

Definition at line 49 of file xdr_head.C.

References mp_id, mp_title, mp_userTitle, and mp_varTitle.

50 {
51  delete [] mp_id;
52  delete [] mp_title;
53  delete [] mp_userTitle;
54  delete [] mp_varTitle;
55 }
libMesh::XdrHEAD::XdrHEAD ( const XdrHEAD )
private

Member Function Documentation

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

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(), setId(), 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 }
const char* libMesh::XdrHEAD::getId ( ) const
inline

Get the mesh/solution file id.

Definition at line 55 of file xdr_head.h.

References mp_id.

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

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

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

Definition at line 91 of file xdr_head.h.

References m_numBCs.

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

91 { return m_numBCs; }
int libMesh::XdrHEAD::getNumNodes ( ) const
inline

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

Definition at line 77 of file xdr_head.h.

References m_numNodes.

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

77 { return m_numNodes; }
const char* libMesh::XdrHEAD::getTitle ( ) const
inline

Get the mesh/solution file title.

Definition at line 65 of file xdr_head.h.

References mp_title.

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

65 { return mp_title; }
const XdrHEAD& libMesh::XdrHEAD::operator= ( const XdrHEAD )
private
void libMesh::XdrHEAD::setId ( const char *  id)
inline

Set the mesh/solution file id.

Definition at line 50 of file xdr_head.h.

References cpyString(), and 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)
inline

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

Definition at line 84 of file xdr_head.h.

References m_numBCs.

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

84 { m_numBCs = numBCs; }
void libMesh::XdrHEAD::setNumNodes ( int  numNodes)
inline

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

Definition at line 71 of file xdr_head.h.

References m_numNodes.

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

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

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

Definition at line 97 of file xdr_head.h.

References m_strSize.

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

97 { m_strSize = strSize; }
void libMesh::XdrHEAD::setTitle ( const char *  title)
inline

Set the mesh/solution file title.

Definition at line 60 of file xdr_head.h.

References cpyString(), and 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); }

Member Data Documentation

int libMesh::XdrHEAD::m_kstep
protected

The internal solution number.

Definition at line 131 of file xdr_head.h.

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

int libMesh::XdrHEAD::m_meshCnt
protected

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

int libMesh::XdrHEAD::m_numBCs
protected

Number of boundary conditions in the solution/mesh.

Definition at line 156 of file xdr_head.h.

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

int libMesh::XdrHEAD::m_numel
protected

Number of elemetns in the solution/mesh.

Definition at line 137 of file xdr_head.h.

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

int libMesh::XdrHEAD::m_numNodes
protected

Number of nodes in the solution/mesh.

Definition at line 143 of file xdr_head.h.

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

int libMesh::XdrHEAD::m_numvar
protected

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

int libMesh::XdrHEAD::m_strSize
protected

String size (Not sure of what?)

Definition at line 161 of file xdr_head.h.

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

int libMesh::XdrHEAD::m_sumWghts
protected

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 libMesh::XdrMHEAD::getSumWghts(), libMesh::XdrMESH::header(), libMesh::XdrMHEAD::setSumWghts(), and XdrHEAD().

xdr_Real libMesh::XdrHEAD::m_time
protected

Current solution time.

Definition at line 186 of file xdr_head.h.

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

int libMesh::XdrHEAD::m_wrtVar
protected

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

char* libMesh::XdrHEAD::mp_id
protected

An ID string for the file.

Definition at line 166 of file xdr_head.h.

Referenced by getId(), libMesh::XdrSOLN::header(), libMesh::XdrMESH::header(), setId(), XdrHEAD(), and ~XdrHEAD().

char* libMesh::XdrHEAD::mp_title
protected

A title string for the file.

Definition at line 171 of file xdr_head.h.

Referenced by getTitle(), libMesh::XdrSOLN::header(), libMesh::XdrMESH::header(), setTitle(), XdrHEAD(), and ~XdrHEAD().

char* libMesh::XdrHEAD::mp_userTitle
protected

User's simulation title

Definition at line 176 of file xdr_head.h.

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

char* libMesh::XdrHEAD::mp_varTitle
protected

List of null-separated variable names.

Definition at line 181 of file xdr_head.h.

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


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

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

Hosted By:
SourceForge.net Logo