CSV data printer for simulation output.
More...
#include "CSVDataPrinter.h"
|
| | CSVDataPrinter (const String &name="CSVDataPrinter") |
| | Constructs a new CSVDataPrinter object.
|
| |
| virtual void | printTable (Output &out, const String &label, const Table &table, const Properties &globdat) override |
| | Print table data in CSV format with timestamps.
|
| |
| virtual void | printVector (Output &out, const String &label, const Vector &vec, const DofSpace &dofs, const Properties &globdat) override |
| | Print vector data in CSV format with DOF information.
|
| |
| virtual void | printSparseVector (Output &out, const String &label, const Vector &vec, const IdxVector &idofs, const DofSpace &dofs, const Properties &globdat) override |
| | Print sparse vector data in CSV format.
|
| |
Extends the standard DataPrinter to output data in CSV format with timestamps. Supports three output modes: tables, vectors, and sparse vectors. Once a mode is set for an instance, it cannot be changed during the simulation.
Usage
The printer automatically detects output mode from first print call:
- Author
- Til Gärtner
- See also
- jive::app::DataPrinter
◆ mode
| Enumerator |
|---|
| EMPTY | No output mode set yet.
|
| TABLES | Table output mode active.
|
| VECTORS | Vector output mode active.
|
| SPARSEVECTORS | Sparse vector output mode active.
|
◆ CSVDataPrinter()
| CSVDataPrinter::CSVDataPrinter |
( |
const String & |
name = "CSVDataPrinter" | ) |
|
|
explicit |
- Parameters
-
| [in] | name | Name of the data printer instance for identification |
◆ ~CSVDataPrinter()
| CSVDataPrinter::~CSVDataPrinter |
( |
| ) |
|
|
protectedvirtual |
◆ printSparseVector()
| void CSVDataPrinter::printSparseVector |
( |
Output & |
out, |
|
|
const String & |
label, |
|
|
const Vector & |
vec, |
|
|
const IdxVector & |
idofs, |
|
|
const DofSpace & |
dofs, |
|
|
const Properties & |
globdat |
|
) |
| |
|
overridevirtual |
Similar to printVector but handles sparse data with specified DOF indices. Sets printer mode to SPARSEVECTORS on first call.
- Parameters
-
| [in] | out | Output stream for CSV data |
| [in] | label | Data label for identification |
| [in] | vec | Vector containing sparse data to print |
| [in] | idofs | DOF indices for sparse vector entries |
| [in] | dofs | Degree of freedom space for context |
| [in] | globdat | Global data properties with simulation context |
◆ printTable()
| void CSVDataPrinter::printTable |
( |
Output & |
out, |
|
|
const String & |
label, |
|
|
const Table & |
table, |
|
|
const Properties & |
globdat |
|
) |
| |
|
overridevirtual |
Sets printer mode to TABLES on first call. All subsequent calls must be to printTable() or an exception will be thrown.
- Parameters
-
| [in] | out | Output stream for CSV data |
| [in] | label | Data label for identification |
| [in] | table | Table containing data to print |
| [in] | globdat | Global data properties with simulation context |
◆ printVector()
| void CSVDataPrinter::printVector |
( |
Output & |
out, |
|
|
const String & |
label, |
|
|
const Vector & |
vec, |
|
|
const DofSpace & |
dofs, |
|
|
const Properties & |
globdat |
|
) |
| |
|
overridevirtual |
Sets printer mode to VECTORS on first call. Cannot be mixed with table output.
- Parameters
-
| [in] | out | Output stream for CSV data |
| [in] | label | Data label for identification |
| [in] | vec | Vector containing data to print |
| [in] | dofs | Degree of freedom space for context |
| [in] | globdat | Global data properties with simulation context |