MeshInit Class Reference

#include <MeshInit.h>

Inheritance diagram for MeshInit:
TetMeshInit TriMeshInit

List of all members.

Public Types

typedef StandardAVI::BCFunc BCFunc
typedef StandardAVI::BCImposedType BCImposedType

Public Member Functions

 MeshInit (double simEndTime, bool wave)
virtual ~MeshInit ()
void initializeMesh (const std::string &fileName, int ndiv)
 main function to call after creating an instance.
virtual size_t getSpatialDim () const =0
virtual size_t getNodesPerElem () const =0
bool isWave () const
double getSimEndTime () const
int getNumElements () const
 Number of elements in the mesh.
int getNumNodes () const
 number of nodes (vertices) in the mesh
unsigned int getTotalNumDof () const
 number of nodes times the dimensionality
const std::vector< AVI * > & getAVIVec () const
const LocalToGlobalMapgetLocalToGlobalMap () const
 mapping function from local per element vectors (for target functions) to global vectors this tells what indices in the global vector each element contributes to
void setupDisplacements (VecDouble &disp) const
 setup initial conditions to be called before starting the simulation loop
void setupVelocities (VecDouble &vel) const
 setup initial conditions to be called before starting the simulation loop
void writeSync (const AVI &avi, const VecDouble &Qval, const VecDouble &Vbval, const VecDouble &Tval)
 Write the values in global vectors corresponding to this avi element to a file at regular intervals.
bool cmpState (const MeshInit &that) const
 Compare state of avi vector against other object Use for verification between different versions.
void printDiff (const MeshInit &that) const
 Compare state of avi vector against other object Use for verification between different versions and also print out the differences.

Protected Member Functions

virtual BCFunc getBCFunc (const double *coord) const =0
 functions to compute boundary condtions
virtual CoordConnmakeCoordConn () const =0
 returns the correct derived type of CoordConn
virtual const double * getParam () const =0
 parametric node numbering of an element (triangle or tetrahedron)
virtual double initDisp (const double *coord, int f) const =0
 internal function used by
virtual double initVel (const double *coord, int f) const =0
 internal function used by
virtual size_t numFields () const =0
 number of fields often the same as dimensionality

Private Member Functions

void stretchInternal (VecDouble &dispOrVel, bool isVel) const
void getBCs (const Element &e, std::vector< std::vector< BCImposedType > > &itypeMat, std::vector< BCFunc > &bcfuncVec) const
void destroy ()

Static Private Member Functions

static bool computeDiffAVI (std::vector< AVI * > listA, std::vector< AVI * > listB, bool printDiff)
template<typename T >
static void destroyVecOfPtr (std::vector< T * > &vec)

Private Attributes

double simEndTime
bool wave
LocalToGlobalMapl2gMap
 to be freed
CoordConncc
SimpleMaterialile
std::vector< ElementGeometry * > geomVec
 vectors to keep track of all the memory
std::vector< Element * > elemVec
std::vector< Residue * > massResidueVec
std::vector< DResidue * > operationsVec
std::vector< AVI * > aviVec
std::vector< size_t > fieldsUsed
double writeInc
int writeInterval
std::vector< size_t > aviWriteInterval
FILE * syncFileWriter

Static Private Attributes

static const double RHO = 1.0
static const double MU = 0.5
static const double LAMBDA = 0.0
static const int PID = 0
static const double DELTA = 0.1
static const double T_INIT = 0.0
static const size_t MAX_FNAME = 1024

Member Typedef Documentation


Constructor & Destructor Documentation

MeshInit::MeshInit ( double  simEndTime,
bool  wave 
) [inline]
Parameters:
simEndTime 
wave 
virtual MeshInit::~MeshInit (  )  [inline, virtual]

Member Function Documentation

bool MeshInit::cmpState ( const MeshInit that  )  const [inline]

Compare state of avi vector against other object Use for verification between different versions.

Parameters:
that 
bool MeshInit::computeDiffAVI ( std::vector< AVI * >  listA,
std::vector< AVI * >  listB,
bool  printDiff 
) [static, private]
void MeshInit::destroy (  )  [inline, private]
template<typename T >
static void MeshInit::destroyVecOfPtr ( std::vector< T * > &  vec  )  [inline, static, private]
const std::vector<AVI*>& MeshInit::getAVIVec (  )  const [inline]
virtual BCFunc MeshInit::getBCFunc ( const double *  coord  )  const [protected, pure virtual]

functions to compute boundary condtions

Parameters:
coord 

Implemented in TriMeshInit, and TetMeshInit.

void MeshInit::getBCs ( const Element e,
std::vector< std::vector< BCImposedType > > &  itypeMat,
std::vector< BCFunc > &  bcfuncVec 
) const [private]
const LocalToGlobalMap& MeshInit::getLocalToGlobalMap (  )  const [inline]

mapping function from local per element vectors (for target functions) to global vectors this tells what indices in the global vector each element contributes to

virtual size_t MeshInit::getNodesPerElem (  )  const [pure virtual]

Implemented in TriMeshInit, and TetMeshInit.

int MeshInit::getNumElements (  )  const [inline]

Number of elements in the mesh.

int MeshInit::getNumNodes (  )  const [inline]

number of nodes (vertices) in the mesh

virtual const double* MeshInit::getParam (  )  const [protected, pure virtual]

parametric node numbering of an element (triangle or tetrahedron)

Implemented in TriMeshInit, and TetMeshInit.

double MeshInit::getSimEndTime (  )  const [inline]
virtual size_t MeshInit::getSpatialDim (  )  const [pure virtual]

Implemented in TriMeshInit, and TetMeshInit.

unsigned int MeshInit::getTotalNumDof (  )  const [inline]

number of nodes times the dimensionality

virtual double MeshInit::initDisp ( const double *  coord,
int  f 
) const [protected, pure virtual]

internal function used by

See also:
setupDisplacements
Parameters:
coord 
f 

Implemented in TriMeshInit, and TetMeshInit.

void MeshInit::initializeMesh ( const std::string &  fileName,
int  ndiv 
)

main function to call after creating an instance.

This initializes all the data structures by reading this file

Parameters:
fileName 
ndiv,: number of times the mesh (read in from the file) should be subdivided
fileName 
ndiv number of times to subdivide the initial mesh
virtual double MeshInit::initVel ( const double *  coord,
int  f 
) const [protected, pure virtual]

internal function used by

See also:
setupVelocities
Parameters:
coord 
f 

Implemented in TriMeshInit, and TetMeshInit.

bool MeshInit::isWave (  )  const [inline]
virtual CoordConn* MeshInit::makeCoordConn (  )  const [protected, pure virtual]

returns the correct derived type of CoordConn

Implemented in TriMeshInit, and TetMeshInit.

virtual size_t MeshInit::numFields (  )  const [protected, pure virtual]

number of fields often the same as dimensionality

Implemented in TriMeshInit, and TetMeshInit.

void MeshInit::printDiff ( const MeshInit that  )  const [inline]

Compare state of avi vector against other object Use for verification between different versions and also print out the differences.

Parameters:
that 
void MeshInit::setupDisplacements ( VecDouble disp  )  const [inline]

setup initial conditions to be called before starting the simulation loop

Parameters:
disp,: global dispalcements vector
void MeshInit::setupVelocities ( VecDouble vel  )  const [inline]

setup initial conditions to be called before starting the simulation loop

Parameters:
vel,: global velocities vector
void MeshInit::stretchInternal ( VecDouble dispOrVel,
bool  isVel 
) const [private]
void MeshInit::writeSync ( const AVI avi,
const VecDouble Qval,
const VecDouble Vbval,
const VecDouble Tval 
)

Write the values in global vectors corresponding to this avi element to a file at regular intervals.

Parameters:
avi 
Qval 
Vbval 
Tval 
avi 
Qval displacement
Vbval velocity
Tval time

Member Data Documentation

std::vector<AVI*> MeshInit::aviVec [private]
std::vector<size_t> MeshInit::aviWriteInterval [private]
CoordConn* MeshInit::cc [private]
const double MeshInit::DELTA = 0.1 [static, private]
std::vector<Element*> MeshInit::elemVec [private]
std::vector<size_t> MeshInit::fieldsUsed [private]
std::vector<ElementGeometry*> MeshInit::geomVec [private]

vectors to keep track of all the memory

to be freed

const double MeshInit::LAMBDA = 0.0 [static, private]
std::vector<Residue*> MeshInit::massResidueVec [private]
const size_t MeshInit::MAX_FNAME = 1024 [static, private]
const double MeshInit::MU = 0.5 [static, private]
std::vector<DResidue*> MeshInit::operationsVec [private]
const int MeshInit::PID = 0 [static, private]
const double MeshInit::RHO = 1.0 [static, private]
double MeshInit::simEndTime [private]
FILE* MeshInit::syncFileWriter [private]
const double MeshInit::T_INIT = 0.0 [static, private]
bool MeshInit::wave [private]
double MeshInit::writeInc [private]
int MeshInit::writeInterval [private]

The documentation for this class was generated from the following files:
Generated on Tue Aug 2 11:51:27 2011 for Galois by  doxygen 1.6.3