Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE > Class Template Referenceabstract

#include <AbstractPerElementWriter.hpp>

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
 
out_stream mpMasterFile
 

Private Attributes

bool mFileIsBinary
 

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 49 of file AbstractPerElementWriter.hpp.

Constructor & Destructor Documentation

◆ AbstractPerElementWriter()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::AbstractPerElementWriter ( AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh)
inline

Constructor

Parameters
pMeshThe mesh whose elements we are going to write out data for.

Definition at line 130 of file AbstractPerElementWriter.hpp.

◆ ~AbstractPerElementWriter()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
virtual AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::~AbstractPerElementWriter ( )
inlinevirtual

Empty virtual destructor for abstract class

Definition at line 243 of file AbstractPerElementWriter.hpp.

Member Function Documentation

◆ PreWriteCalculations()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
virtual void AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::PreWriteCalculations ( OutputFileHandler rOutputDirectory)
inlineprotectedvirtual

Method that can be overridden to do any pre-calculations necessary to write out data.

Parameters
rOutputDirectoryThe folder data is going to be written into (mostly for debugging to be written into).

Reimplemented in StreeterFibreGenerator< SPACE_DIM >.

Definition at line 119 of file AbstractPerElementWriter.hpp.

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

◆ SetWriteFileAsBinary()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
void AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::SetWriteFileAsBinary ( bool  binary = true)
inline

Switch to write binary fibre file

(set to write ascii files in the constructor)

Parameters
binaryWhether to write as binary (defaults to true).

Definition at line 235 of file AbstractPerElementWriter.hpp.

References AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mFileIsBinary.

◆ Visit()

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,
unsigned  localElementIndex,
c_vector< double, DATA_SIZE > &  rData 
)
protectedpure 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
localElementIndexthe index of pElement in the local vector. Used in subclasses which look up data from a separate structure ordered by local indices
rDatathe double-precision data to write to file (output from the method)

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

◆ 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 
)
inline

◆ WriteElementOnMaster()

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)
inlineprotectedvirtual

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 85 of file AbstractPerElementWriter.hpp.

References AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mFileIsBinary, and AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mpMasterFile.

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

◆ WriteHeaderOnMaster()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
virtual void AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::WriteHeaderOnMaster ( )
inlineprotectedvirtual

How to write the header information to the file. By default writes nothing. This is only called by the master process. This should NOT end the line (eg:
or std::endl) as we need to say whether the file is binary or not.

Reimplemented in StreeterFibreGenerator< SPACE_DIM >.

Definition at line 109 of file AbstractPerElementWriter.hpp.

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

Member Data Documentation

◆ mFileIsBinary

◆ mpMasterFile

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 64 of file AbstractPerElementWriter.hpp.

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

◆ mpMesh

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned DATA_SIZE>
AbstractTetrahedralMesh<ELEMENT_DIM, SPACE_DIM>* AbstractPerElementWriter< ELEMENT_DIM, SPACE_DIM, DATA_SIZE >::mpMesh
protected

The mesh. Set by the constructor.

Definition at line 58 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: