Chaste Release::3.1
AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE > Class Template Reference

#include <AbstractPerElementWriter.hpp>

Collaboration diagram for AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >:

List of all members.

Public Member Functions

void WriteData (OutputFileHandler &rHandler, const std::string &rFileName, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)
virtual ~AbstractPerElementWriter ()

Protected Member Functions

virtual void Visit (Element< ELEMENT_DIM, SPACE_DIM > *pElement, c_vector< double, DATA_SIZE > &rData)=0
virtual void WriteElementOnMaster (const c_vector< double, DATA_SIZE > &rData)
virtual void WriteHeaderOnMaster ()

Protected Attributes

out_stream mpMasterFile

Private Attributes

AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpMesh

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
class AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >

An abstract writer class for writing stuff on a "per element" basis. This class will "visit" all the locally owned elements and concentrate data back to the master.

Definition at line 51 of file AbstractPerElementWriter.hpp.


Constructor & Destructor Documentation

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

Empty virtual destructor for abstract class

Definition at line 160 of file AbstractPerElementWriter.hpp.


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
virtual void AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::Visit ( Element< ELEMENT_DIM, SPACE_DIM > *  pElement,
c_vector< double, DATA_SIZE > &  rData 
) [protected, pure virtual]

How to associate an element with some data Must be over-ridden by the derived class.

Parameters:
pElementa locally-owned element for which to calculate or lookup some data
rDatathe double-precision data to write to file (output from the method)

Referenced by AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteData().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
void AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteData ( OutputFileHandler rHandler,
const std::string &  rFileName,
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh 
) [inline]

Writes data about each element in parallel Data about each element is retrieved by the Visit() method. Writing is done by the master process using the WriteElement() method. Any element not owned by the master is communicated by the unique designated owner.

Parameters:
rHandlerspecify the directory in which to place the output file
rFileNamethe file name
pMeshthe mesh, the elements of which are to be iterated over

Definition at line 104 of file AbstractPerElementWriter.hpp.

References PetscTools::AmMaster(), ChasteBuildInfo::GetProvenanceString(), AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mpMasterFile, AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mpMesh, OutputFileHandler::OpenOutputFile(), AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::Visit(), AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteElementOnMaster(), and AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteHeaderOnMaster().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
virtual void AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteElementOnMaster ( const c_vector< double, DATA_SIZE > &  rData) [inline, protected, virtual]

How to write an element's worth of data to the file. By default writes tab-separated data to a single line, but can be over-ridden. This is only called by the master process.

Parameters:
rDatathe double-precision data to write to file

Definition at line 73 of file AbstractPerElementWriter.hpp.

Referenced by AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteData().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
virtual void AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteHeaderOnMaster ( ) [inline, protected, virtual]

How to write the header information to the file. By default writes nothing. This is only called by the master process.

Definition at line 88 of file AbstractPerElementWriter.hpp.

Referenced by AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteData().


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
out_stream AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mpMasterFile [protected]

The output file (only valid on master process). Set by the public method WriteData and used by WriteElementOnMaster

Definition at line 56 of file AbstractPerElementWriter.hpp.

Referenced by AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteData().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
AbstractTetrahedralMesh<ELEMENT_DIM, SPACE_DIM>* AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mpMesh [private]

The mesh. Set by the public method WriteData.

Definition at line 54 of file AbstractPerElementWriter.hpp.

Referenced by AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteData().


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