CEPS  24.01
Cardiac ElectroPhysiology Simulator
TimeWriter Class Reference

Detailed Description

A writer that generates text files with data extracted from distributed vector at specific points, along time, writes values of 0D unknown and aditional custom data.

Points can be specified in the input file with the "probe points" entry.

See also
AbstractPdeProblem

All spatial unknowns of the problem are written for each probe point: For each point given in the constructor, the dof with the closest geometric point is selected

For custom data, a pointer to a scalar must be provided for each data, together with a name written in the output file header

Definition at line 47 of file TimeWriter.hpp.

#include <TimeWriter.hpp>

Inheritance diagram for TimeWriter:
[legend]

Public Member Functions

 TimeWriter (const CepsString &fileName, const CepsVector< CepsReal3D > &points, AbstractDiscretization *discr)
 Constructor. More...
 
CepsBool hasSomethingToWrite () const
 Tells if some data must be written. If not, why bother ? More...
 
void addCustomData (const CepsString &name, CepsReal *data)
 Add a custom data to be written in the outputfile. Custom data cannot be added after header has been written (ie first call of "write") More...
 
void write (CepsReal t, DHVecPtr data)
 Writes the content of data at indices set in constructor. More...
 
- Public Member Functions inherited from FileWriter
 FileWriter (CepsBool binary=false)
 Constructor. More...
 
 FileWriter (const CepsString &file, CepsBool binary=false)
 Constructor. More...
 
 ~FileWriter () override
 Constructor. More...
 
CepsString getFileName ()
 Name of parsed file. More...
 
void open ()
 Creates file or cleans previous content. More...
 
void close ()
 Close current file. More...
 
CepsBool good ()
 Tells if file is ok. More...
 
void reset ()
 The file stream is placed at the beginning of the file. More...
 
void write (const CepsString &s)
 Single line writing. More...
 
template<typename T >
FileWriteroperator<< (const T &content)
 Writing operator. More...
 
- Public Member Functions inherited from CepsObject
 CepsObject ()=default
 default constructor More...
 
 CepsObject (const CepsObject &)=default
 Copy constructor. More...
 
virtual ~CepsObject ()=default
 Destructor. More...
 
CepsObjectoperator= (const CepsObject &)=default
 Assignment operator. More...
 
CepsObjecttoBaseObject ()
 Returns a pointer to CepsObject class. More...
 
const CepsObjecttoBaseObject () const
 Returns a pointer to CepsObject class, const version. More...
 
ProfilergetProfiler () const
 Access to profiler. More...
 

Protected Member Functions

void writeHeader ()
 Writes comment lines to indicate what are the variables. More...
 

Protected Attributes

AbstractDiscretizationm_discr
 Link to descretization (and problem within) More...
 
CepsVector< CepsReal3Dm_points
 Points location. More...
 
CepsVector< CepsDofGlobalIndexm_dofIndices
 Points IDs. More...
 
CepsVector< CepsStringm_customNames
 Custom data name, printed in header. More...
 
CepsVector< CepsReal * > m_customData
 Custom data, careful with ptr handling. More...
 
CepsBool m_canAddData
 Prevents addition of data after header is written. More...
 
- Protected Attributes inherited from FileWriter
CepsString m_fileName
 file to write More...
 
std::ofstream m_file
 corresponding stream More...
 
CepsBool m_binary
 binary output if true More...
 

Additional Inherited Members

- Static Protected Attributes inherited from CepsObject
static Profiler m_profiler
 The same profiler for each big object. More...
 

Constructor & Destructor Documentation

◆ TimeWriter()

TimeWriter::TimeWriter ( const CepsString fileName,
const CepsVector< CepsReal3D > &  points,
AbstractDiscretization discr 
)

Constructor.

Definition at line 34 of file TimeWriter.cpp.

Member Function Documentation

◆ addCustomData()

void TimeWriter::addCustomData ( const CepsString name,
CepsReal data 
)

Add a custom data to be written in the outputfile. Custom data cannot be added after header has been written (ie first call of "write")

Definition at line 72 of file TimeWriter.cpp.

◆ hasSomethingToWrite()

CepsBool TimeWriter::hasSomethingToWrite ( ) const

Tells if some data must be written. If not, why bother ?

Definition at line 66 of file TimeWriter.cpp.

◆ write()

void TimeWriter::write ( CepsReal  t,
DHVecPtr  data 
)

Writes the content of data at indices set in constructor.

Definition at line 82 of file TimeWriter.cpp.

◆ writeHeader()

void TimeWriter::writeHeader ( )
protected

Writes comment lines to indicate what are the variables.

Definition at line 113 of file TimeWriter.cpp.

Field Documentation

◆ m_canAddData

CepsBool TimeWriter::m_canAddData
protected

Prevents addition of data after header is written.

Definition at line 87 of file TimeWriter.hpp.

◆ m_customData

CepsVector<CepsReal*> TimeWriter::m_customData
protected

Custom data, careful with ptr handling.

Definition at line 86 of file TimeWriter.hpp.

◆ m_customNames

CepsVector<CepsString> TimeWriter::m_customNames
protected

Custom data name, printed in header.

Definition at line 85 of file TimeWriter.hpp.

◆ m_discr

AbstractDiscretization* TimeWriter::m_discr
protected

Link to descretization (and problem within)

Definition at line 80 of file TimeWriter.hpp.

◆ m_dofIndices

CepsVector<CepsDofGlobalIndex> TimeWriter::m_dofIndices
protected

Points IDs.

Definition at line 83 of file TimeWriter.hpp.

◆ m_points

CepsVector<CepsReal3D> TimeWriter::m_points
protected

Points location.

Definition at line 82 of file TimeWriter.hpp.


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