DiFfRG
|
A class to output data to a CSV file. More...
#include <csv_output.hh>
Public Member Functions | |
CsvOutput (const std::string top_folder, const std::string output_name, const JSONValue &json) | |
Construct a new Csv Output object. | |
void | value (const std::string &name, const double value) |
Add a value to the output. | |
void | flush (const double time) |
Add a value to the output. | |
void | set_Lambda (const double Lambda) |
Set the value of Lambda. If Lambda is set, the output will contain a column for k = exp(-t) * Lambda. | |
Private Attributes | |
const JSONValue & | json |
const std::string | top_folder |
const std::string | output_name |
std::ofstream | output_stream |
std::vector< std::string > | insertion_order |
std::map< std::string, std::vector< double > > | values |
std::vector< std::string > | header |
std::vector< double > | time_values |
std::vector< double > | k_values |
double | Lambda |
A class to output data to a CSV file.
In every time step, the user can add values to the output, which will be written to the file when flush is called. Every timestep has to contain the same values, but the order in which they are added can change.
DiFfRG::CsvOutput::CsvOutput | ( | const std::string | top_folder, |
const std::string | output_name, | ||
const JSONValue & | json ) |
Construct a new Csv Output object.
top_folder | The top folder to store the output in. |
output_name | The name of the output file. |
json | The JSON object containing the parameters. |
void DiFfRG::CsvOutput::flush | ( | const double | time | ) |
Add a value to the output.
name | The name of the value. |
value | The value to add. |
void DiFfRG::CsvOutput::set_Lambda | ( | const double | Lambda | ) |
Set the value of Lambda. If Lambda is set, the output will contain a column for k = exp(-t) * Lambda.
Lambda | The value of Lambda. |
void DiFfRG::CsvOutput::value | ( | const std::string & | name, |
const double | value ) |
Add a value to the output.
name | The name of the value. |
value | The value to add. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |