|
DiFfRG
|
Class to manage writing to files. FEM functions are written to vtk files and other data is written to csv files. More...
#include <data_output.hh>
Public Member Functions | |
| DataOutput (std::string top_folder, std::string output_name, std::string output_folder, const JSONValue &json) | |
| Construct a new Data Output object. | |
| DataOutput (const JSONValue &json) | |
| FEOutput< dim, VectorType > & | fe_output () |
| Returns a reference to the FEOutput object used to write FEM functions to .vtu files and .pvd time series. | |
| CsvOutput & | csv_file (const std::string &name) |
| Returns a reference to the CsvOutput object associated with the given name, which is used to write scalar values to .csv files. If the object does not exist, it is created. | |
| void | flush (const double time) |
| Save all attached data vectors to a .vtu and append it to the time series. Also flush any attached scalar values to the .csv files. | |
| 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. | |
| const std::string & | get_output_name () const |
| Get the name of the output. | |
| void | dump_to_csv (const std::string &name, const std::vector< std::vector< double > > &values, bool attach=false, const std::vector< std::string > header={}) |
| Dump a vector of vectors to a .csv file, e.g. for a higher-dimensional grid function. | |
Private Attributes | |
| JSONValue | json |
| const std::string | top_folder |
| const std::string | output_name |
| const std::string | output_folder |
| double | Lambda |
| std::vector< double > | time_values |
| std::vector< double > | k_values |
| FEOutput< dim, VectorType > | fe_out |
| std::map< std::string, CsvOutput > | csv_files |
Class to manage writing to files. FEM functions are written to vtk files and other data is written to csv files.
| dim | dimensionality of the FEM solution. |
| VectorType | Vector type of the FEM solution. |
| DiFfRG::DataOutput< dim, VectorType >::DataOutput | ( | std::string | top_folder, |
| std::string | output_name, | ||
| std::string | output_folder, | ||
| const JSONValue & | json ) |
Construct a new Data Output object.
| top_folder | Folder where the output will be written, i.e. the folder containing the .pvd file and the .csv files. |
| output_name | Name of the output, i.e. the name of the .pvd file and the .csv files. |
| output_folder | Folder where the .vtu files will be written. Should be relative to top_folder. |
| subdivisions | Number of subdivisions of the cells in the .vtu files. |
| DiFfRG::DataOutput< dim, VectorType >::DataOutput | ( | const JSONValue & | json | ) |
| CsvOutput & DiFfRG::DataOutput< dim, VectorType >::csv_file | ( | const std::string & | name | ) |
Returns a reference to the CsvOutput object associated with the given name, which is used to write scalar values to .csv files. If the object does not exist, it is created.
| void DiFfRG::DataOutput< dim, VectorType >::dump_to_csv | ( | const std::string & | name, |
| const std::vector< std::vector< double > > & | values, | ||
| bool | attach = false, | ||
| const std::vector< std::string > | header = {} ) |
Dump a vector of vectors to a .csv file, e.g. for a higher-dimensional grid function.
| name | Name of the .csv file. |
| values | Vector of vectors to dump. |
| attach | If true, the values are appended to the file. If false, the file is truncated. |
| header | Header of the .csv file. If attach is true, this is ignored. |
| FEOutput< dim, VectorType > & DiFfRG::DataOutput< dim, VectorType >::fe_output | ( | ) |
Returns a reference to the FEOutput object used to write FEM functions to .vtu files and .pvd time series.
| void DiFfRG::DataOutput< dim, VectorType >::flush | ( | const double | time | ) |
Save all attached data vectors to a .vtu and append it to the time series. Also flush any attached scalar values to the .csv files.
| time | tag attached in the .pvd time series and the .csv files. |
| const std::string & DiFfRG::DataOutput< dim, VectorType >::get_output_name | ( | ) | const |
Get the name of the output.
| void DiFfRG::DataOutput< dim, VectorType >::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. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |