Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
CellDataItemWriter< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <CellDataItemWriter.hpp>

+ Inheritance diagram for CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 CellDataItemWriter (std::string cellDataVariableName="")
 
double GetCellDataForVtkOutput (CellPtr pCell, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation)
 
virtual void VisitCell (CellPtr pCell, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation)
 
std::string GetCellDataVariableName () const
 
- Public Member Functions inherited from AbstractCellWriter< ELEMENT_DIM, SPACE_DIM >
 AbstractCellWriter (const std::string &rFileName)
 
virtual c_vector< double, SPACE_DIM > GetVectorCellDataForVtkOutput (CellPtr pCell, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation)
 
bool GetOutputScalarData ()
 
bool GetOutputVectorData ()
 
void SetVtkCellDataName (std::string vtkCellDataName)
 
void SetVtkVectorCellDataName (std::string vtkCellDataName)
 
std::string GetVtkCellDataName ()
 
std::string GetVtkVectorCellDataName ()
 
- Public Member Functions inherited from AbstractCellBasedWriter< ELEMENT_DIM, SPACE_DIM >
 AbstractCellBasedWriter (const std::string &rFileName)
 
virtual ~AbstractCellBasedWriter ()
 
void CloseFile ()
 
virtual void OpenOutputFile (OutputFileHandler &rOutputFileHandler)
 
void OpenOutputFileForAppend (OutputFileHandler &rOutputFileHandler)
 
virtual void WriteTimeStamp ()
 
virtual void WriteNewline ()
 
void SetFileName (std::string fileName)
 
std::string GetFileName ()
 
- Public Member Functions inherited from Identifiable
virtual ~Identifiable ()
 
std::string GetIdentifier () const
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

std::string mCellDataVariableName
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from AbstractCellWriter< ELEMENT_DIM, SPACE_DIM >
bool mOutputScalarData
 
bool mOutputVectorData
 
std::string mVtkCellDataName
 
std::string mVtkVectorCellDataName
 
- Protected Attributes inherited from AbstractCellBasedWriter< ELEMENT_DIM, SPACE_DIM >
std::string mFileName
 
out_stream mpOutStream
 

Detailed Description

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

A class written using the visitor pattern for writing to file, for each cell, the level of a variable stored in CellData.

The output file is called cell[variable name].dat. If VTK is switched on, then the writer also specifies the VTK output for each cell, which is stored in the VTK cell data "Cell [variable name]".

Note: if VTK is switched on then everything in CellData will be output as VTK cell data already but this is the best way to output to a .dat file.

Definition at line 55 of file CellDataItemWriter.hpp.

Constructor & Destructor Documentation

◆ CellDataItemWriter()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >::CellDataItemWriter ( std::string  cellDataVariableName = "")

Constructor.

Parameters
cellDataVariableNamethe item in CellData to output (defaults to "")

Definition at line 40 of file CellDataItemWriter.cpp.

References CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >::mCellDataVariableName, and AbstractCellWriter< ELEMENT_DIM, SPACE_DIM >::mVtkCellDataName.

Member Function Documentation

◆ GetCellDataForVtkOutput()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >::GetCellDataForVtkOutput ( CellPtr  pCell,
AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > *  pCellPopulation 
)
virtual

Overridden GetCellDataForVtkOutput() method.

Get a double associated with a cell. This method reduces duplication of code between the methods VisitCell() and AddVtkData().

Parameters
pCella cell
pCellPopulationa pointer to the cell population owning the cell
Returns
data associated with the cell

Reimplemented from AbstractCellWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 48 of file CellDataItemWriter.cpp.

◆ GetCellDataVariableName()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >::GetCellDataVariableName ( ) const
Returns
mCellDataVariableName used in archiving.

Definition at line 78 of file CellDataItemWriter.cpp.

◆ serialize()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Serialize the object and its member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 67 of file CellDataItemWriter.hpp.

◆ VisitCell()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >::VisitCell ( CellPtr  pCell,
AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > *  pCellPopulation 
)
virtual

Overridden VisitCell() method.

Visit a cell and write its cell data item.

Outputs a line of space-separated values of the form: ...[location index] [cell id] [x-pos] [y-pos] [z-pos] [cell data item]... with [y-pos] and [z-pos] included for 2 and 3 dimensional simulations, respectively.

This is appended to the output written by AbstractCellBasedWriter, which is a single value [present simulation time], followed by a tab.

Parameters
pCella cell
pCellPopulationa pointer to the cell population owning the cell

Implements AbstractCellWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 55 of file CellDataItemWriter.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetLocationIndexUsingCell(), and AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetLocationOfCellCentre().

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 59 of file CellDataItemWriter.hpp.

Member Data Documentation

◆ mCellDataVariableName

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string CellDataItemWriter< ELEMENT_DIM, SPACE_DIM >::mCellDataVariableName
private

The item stored in CellData to output.

Definition at line 76 of file CellDataItemWriter.hpp.

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


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