/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/data/data_output.hh Source File#

DiFfRG: /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/data/data_output.hh Source File
DiFfRG
data_output.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
7
8namespace DiFfRG
9{
10 using namespace dealii;
11
19 template <uint dim, typename VectorType> class DataOutput
20 {
21 public:
31 DataOutput(std::string top_folder, std::string output_name, std::string output_folder, const JSONValue &json);
32
34
39
44 CsvOutput &csv(const std::string &name);
45
50 HDF5Output &hdf5(const std::string &name);
52
59 void flush(const double time);
60
66 void set_Lambda(const double Lambda);
67
73 const std::string &get_output_name() const;
74
83 void dump_to_csv(const std::string &name, const std::vector<std::vector<double>> &values, bool attach = false,
84 const std::vector<std::string> header = {});
85
86 private:
88 const std::string top_folder;
89 const std::string output_name;
90 const std::string output_folder;
91 double Lambda;
92
93 std::vector<double> time_values;
94 std::vector<double> k_values;
95
97 std::map<std::string, CsvOutput> csv_files;
98
100 const std::string filename_h5;
101 std::map<std::string, HDF5Output> h5_files;
102 };
103} // namespace DiFfRG
A class to output data to a CSV file.
Definition csv_output.hh:20
Class to manage writing to files. FEM functions are written to vtk files and other data is written to...
Definition data_output.hh:20
std::vector< double > k_values
Definition data_output.hh:94
const std::string top_folder
Definition data_output.hh:88
CsvOutput & csv(const std::string &name)
Returns a reference to the CsvOutput object associated with the given name, which is used to write sc...
FEOutput< dim, VectorType > fe_out
Definition data_output.hh:96
std::map< std::string, CsvOutput > csv_files
Definition data_output.hh:97
std::map< std::string, HDF5Output > h5_files
Definition data_output.hh:101
const std::string output_folder
Definition data_output.hh:90
DataOutput(std::string top_folder, std::string output_name, std::string output_folder, const JSONValue &json)
Construct a new Data Output object.
FEOutput< dim, VectorType > & fe_output()
Returns a reference to the FEOutput object used to write FEM functions to .vtu files and ....
HDF5Output & hdf5()
DataOutput(const JSONValue &json)
std::vector< double > time_values
Definition data_output.hh:93
const std::string output_name
Definition data_output.hh:89
const std::string & get_output_name() const
Get the name of the output.
double Lambda
Definition data_output.hh:91
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.
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.
const std::string filename_h5
Definition data_output.hh:100
void flush(const double time)
Save all attached data vectors to a .vtu and append it to the time series. Also flush any attached sc...
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 ....
JSONValue json
Definition data_output.hh:87
bool use_hdf5
Definition data_output.hh:99
A class to output finite element data to disk as .vtu files and .pvd time series.
Definition fe_output.hh:31
A class to output data to a CSV file.
Definition hdf5_output.hh:22
A wrapper around the boost json value class.
Definition json.hh:19
Definition complex_math.hh:10