DataOutput< dim, VectorType > Class Template Reference#
|
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 (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. | |
| HDF5Output & | hdf5 (const std::string &name) |
| Returns a reference to the HDF5 file associated with the given name, which is used to write data to .h5 files. If the object does not exist, it is created. | |
| HDF5Output & | hdf5 () |
| 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 |
| bool | use_hdf5 |
| const std::string | filename_h5 |
| std::map< std::string, HDF5Output > | h5_files |
Detailed Description
class DiFfRG::DataOutput< dim, VectorType >
Class to manage writing to files. FEM functions are written to vtk files and other data is written to csv files.
- Template Parameters
-
dim dimensionality of the FEM solution. VectorType Vector type of the FEM solution.
Constructor & Destructor Documentation
◆ DataOutput() [1/2]
| 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.
- Parameters
-
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.
◆ DataOutput() [2/2]
| DiFfRG::DataOutput< dim, VectorType >::DataOutput | ( | const JSONValue & | json | ) |
Member Function Documentation
◆ csv()
| CsvOutput & DiFfRG::DataOutput< dim, VectorType >::csv | ( | 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.
◆ dump_to_csv()
| 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.
- Parameters
-
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.
◆ fe_output()
| 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.
◆ flush()
| 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.
- Parameters
-
time tag attached in the .pvd time series and the .csv files.
◆ get_output_name()
| const std::string & DiFfRG::DataOutput< dim, VectorType >::get_output_name | ( | ) | const |
Get the name of the output.
- Returns
- const std::string&
◆ hdf5() [1/2]
| HDF5Output & DiFfRG::DataOutput< dim, VectorType >::hdf5 | ( | ) |
◆ hdf5() [2/2]
| HDF5Output & DiFfRG::DataOutput< dim, VectorType >::hdf5 | ( | const std::string & | name | ) |
Returns a reference to the HDF5 file associated with the given name, which is used to write data to .h5 files. If the object does not exist, it is created.
◆ set_Lambda()
| 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.
- Parameters
-
Lambda The value of Lambda.
Member Data Documentation
◆ csv_files
|
private |
◆ fe_out
|
private |
◆ filename_h5
|
private |
◆ h5_files
|
private |
◆ json
|
private |
◆ k_values
|
private |
◆ Lambda
|
private |
◆ output_folder
|
private |
◆ output_name
|
private |
◆ time_values
|
private |
◆ top_folder
|
private |
◆ use_hdf5
|
private |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/data/data_output.hh
Generated by