CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
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.
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>
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 > | |
FileWriter & | operator<< (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... | |
CepsObject & | operator= (const CepsObject &)=default |
Assignment operator. More... | |
CepsObject * | toBaseObject () |
Returns a pointer to CepsObject class. More... | |
const CepsObject * | toBaseObject () const |
Returns a pointer to CepsObject class, const version. More... | |
Profiler * | getProfiler () const |
Access to profiler. More... | |
Protected Member Functions | |
void | writeHeader () |
Writes comment lines to indicate what are the variables. More... | |
Protected Attributes | |
AbstractDiscretization * | m_discr |
Link to descretization (and problem within) More... | |
CepsVector< CepsReal3D > | m_points |
Points location. More... | |
CepsVector< CepsDofGlobalIndex > | m_dofIndices |
Points IDs. More... | |
CepsVector< CepsString > | m_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... | |
TimeWriter::TimeWriter | ( | const CepsString & | fileName, |
const CepsVector< CepsReal3D > & | points, | ||
AbstractDiscretization * | discr | ||
) |
Constructor.
Definition at line 34 of file TimeWriter.cpp.
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.
CepsBool TimeWriter::hasSomethingToWrite | ( | ) | const |
Tells if some data must be written. If not, why bother ?
Definition at line 66 of file TimeWriter.cpp.
Writes the content of data at indices set in constructor.
Definition at line 82 of file TimeWriter.cpp.
|
protected |
Writes comment lines to indicate what are the variables.
Definition at line 113 of file TimeWriter.cpp.
|
protected |
Prevents addition of data after header is written.
Definition at line 87 of file TimeWriter.hpp.
|
protected |
Custom data, careful with ptr handling.
Definition at line 86 of file TimeWriter.hpp.
|
protected |
Custom data name, printed in header.
Definition at line 85 of file TimeWriter.hpp.
|
protected |
Link to descretization (and problem within)
Definition at line 80 of file TimeWriter.hpp.
|
protected |
Points IDs.
Definition at line 83 of file TimeWriter.hpp.
|
protected |
Points location.
Definition at line 82 of file TimeWriter.hpp.