FemlabMeshReader< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <FemlabMeshReader.hpp>

Inherits AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >.

Collaboration diagram for FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FemlabMeshReader (const std::string &rPathBaseName, const std::string &rNodeFileName, const std::string &rElementFileName, const std::string &rEdgeFileName)
virtual ~FemlabMeshReader ()

Private Member Functions

std::vector< std::vector
< double > > 
TokenizeStringsToDoubles (const std::vector< std::string > &rRawData)
std::vector< std::vector
< unsigned > > 
TokenizeStringsToInts (const std::vector< std::string > &rRawData, unsigned dimensionOfObject)

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >

Concrete version of the AbstractCachedMeshReader class. A FemlabMeshReader takes the file names of a set of Femlab mesh files. Once constructed the public methods of the AbstractCachedMeshReader (std::vector<double> GetNextNode(); etc) can be called to interrogate the data

Definition at line 42 of file FemlabMeshReader.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::FemlabMeshReader ( const std::string &  rPathBaseName,
const std::string &  rNodeFileName,
const std::string &  rElementFileName,
const std::string &  rEdgeFileName 
) [inline]

The constructor takes the path to and names of a set of Femlab mesh files (ie. the nodes, elements and faces files (in that order) and allows the data to be queried. Typical use: AbstractMeshReader* pMeshReader = new FemlabMeshReader("pdes/tests/meshdata/", "femlab_lshape_nodes.dat", "femlab_lshape_elements.dat", "femlab_lshape_edges.dat",);

Parameters:
rPathBaseName the base name of the files from which to read the mesh data
rNodeFileName the name of the nodes file
rElementFileName the name of the elements file
rEdgeFileName the name of the edges file

Definition at line 39 of file FemlabMeshReader.cpp.

References AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetRawDataFromFile(), AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementRawData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceRawData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeRawData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpElementIterator, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpFaceIterator, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpNodeIterator, FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::TokenizeStringsToDoubles(), and FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::TokenizeStringsToInts().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::~FemlabMeshReader (  )  [inline, virtual]

Destructor

Definition at line 79 of file FemlabMeshReader.cpp.


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector< double > > FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::TokenizeStringsToDoubles ( const std::vector< std::string > &  rRawData  )  [inline, private]

TokenizeStringsToDoubles is specific to reading node data which came from a Femlab or Matlab PDE toolbox file.

Each string is expected to be a series of doubles. Return value is a vector where each item is a vector of double which represents position. Indices are implicit in the vector.

Parameters:
rRawData the node data to be read

Definition at line 84 of file FemlabMeshReader.cpp.

References EXCEPTION.

Referenced by FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::FemlabMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector< unsigned > > FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::TokenizeStringsToInts ( const std::vector< std::string > &  rRawData,
unsigned  dimensionOfObject 
) [inline, private]

TokenizeStringsToInts is for reading element, face or edge data which came from a Femlab or Matlab PDE toolbox file. Each string is expected to be a series of unsigned which represent: The first several lines denote the indices of nodes The rest contains extra information which are ignored currently. ( In 2-D: 2 indices for an edge, 3 for a triangle) ( In 3-D: 3 indices for a face, 4 for a tetrahedron) Return value is a vector where each item is a vector of ints which represents indices of nodes.

Parameters:
rRawData the element, face or edge data to be read
dimensionOfObject the number of lines of data to be read

Definition at line 136 of file FemlabMeshReader.cpp.

Referenced by FemlabMeshReader< ELEMENT_DIM, SPACE_DIM >::FemlabMeshReader().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:05:19 2011 for Chaste by  doxygen 1.6.3