Chaste
Release::3.4
|
#include <AbstractPerElementWriter.hpp>
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 |
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.
|
inline |
Constructor
pMesh | The mesh whose elements we are going to write out data for. |
Definition at line 130 of file AbstractPerElementWriter.hpp.
|
inlinevirtual |
Empty virtual destructor for abstract class
Definition at line 243 of file AbstractPerElementWriter.hpp.
|
inlineprotectedvirtual |
Method that can be overridden to do any pre-calculations necessary to write out data.
rOutputDirectory | The 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< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteData().
|
inline |
Switch to write binary fibre file
(set to write ascii files in the constructor)
binary | Whether to write as binary (defaults to true). |
Definition at line 235 of file AbstractPerElementWriter.hpp.
|
protectedpure virtual |
How to associate an element with some data Must be over-ridden by the derived class.
pElement | a locally-owned element for which to calculate or lookup some data |
localElementIndex | the index of pElement in the local vector. Used in subclasses which look up data from a separate structure ordered by local indices |
rData | the double-precision data to write to file (output from the method) |
Referenced by AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteData().
|
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.
MUST BE CALLED IN PARALLEL.
rHandler | specify the directory in which to place the output file |
rFileName | the file name |
Definition at line 149 of file AbstractPerElementWriter.hpp.
|
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.
rData | the double-precision data to write to file |
Definition at line 85 of file AbstractPerElementWriter.hpp.
Referenced by AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteData().
|
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< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteData().
|
private |
Whether all data is to be written as binary
Definition at line 52 of file AbstractPerElementWriter.hpp.
Referenced by AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::SetWriteFileAsBinary(), AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteData(), and AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteElementOnMaster().
|
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< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteData(), and AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteElementOnMaster().
|
protected |
The mesh. Set by the constructor.
Definition at line 58 of file AbstractPerElementWriter.hpp.
Referenced by AbstractPerElementWriter< SPACE_DIM, SPACE_DIM, SPACE_DIM *SPACE_DIM >::WriteData().