libMesh::XdrHEAD Class Reference

#include <xdr_head.h>

Inheritance diagram for libMesh::XdrHEAD:

List of all members.

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.

00027 {
00028   m_wrtVar = 0;
00029   m_numvar = 0;
00030 
00031   m_meshCnt = 0;
00032   m_kstep = 0;
00033 
00034   m_numel = 0;
00035   m_numNodes = 0;
00036   m_sumWghts = 0;
00037   m_numBCs = 0;
00038   m_strSize = 0;
00039   mp_id = 0;
00040   mp_title = 0;
00041   mp_userTitle = 0;
00042   mp_varTitle = 0;
00043 
00044   m_time = 0;
00045 }

libMesh::XdrHEAD::~XdrHEAD (  )  [virtual]

Destructor.

Definition at line 49 of file xdr_head.C.

References mp_id, mp_title, mp_userTitle, and mp_varTitle.

00050 {
00051   delete [] mp_id;
00052   delete [] mp_title;
00053   delete [] mp_userTitle;
00054   delete [] mp_varTitle;
00055 }

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

00060 {
00061   char* temp = NULL;
00062   int myLen = len;
00063   if(src)
00064     {
00065       if (myLen == -1)
00066         myLen = libmesh_cast_int<int>(std::strlen(src))+1;
00067       temp = new char[myLen];
00068       temp = (char *) std::memcpy(temp, src, (myLen)*sizeof(char));
00069     }
00070   return temp;
00071 }

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

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

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

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

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

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

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

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

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

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

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

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_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 05 2013 19:55:43 UTC

Hosted By:
SourceForge.net Logo