CsvOutput Class Reference#

DiFfRG: DiFfRG::CsvOutput Class Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
DiFfRG::CsvOutput Class Reference

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)
 Construct a new Csv Output object.
 
 CsvOutput (const std::string top_folder, const std::string output_name, const ConfigTree &config)
 
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 validate_frame () const
 
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 std::string top_folder
 
const std::string output_name
 
std::ofstream output_stream
 
std::vector< std::string > insertion_order
 
std::unordered_map< std::string, std::vector< double > > values
 
std::unordered_set< std::string > written_this_frame
 
std::vector< std::string > header
 
std::vector< double > time_values
 
std::vector< double > k_values
 
double Lambda
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CsvOutput() [1/2]

DiFfRG::CsvOutput::CsvOutput ( const std::string top_folder,
const std::string output_name )

Construct a new Csv Output object.

Parameters
top_folderThe top folder to store the output in.
output_nameThe name of the output file.
configThe ConfigTree object containing the parameters.

◆ CsvOutput() [2/2]

DiFfRG::CsvOutput::CsvOutput ( const std::string top_folder,
const std::string output_name,
const ConfigTree & config )
inline

Member Function Documentation

◆ flush()

void DiFfRG::CsvOutput::flush ( const double time)

Add a value to the output.

Parameters
nameThe name of the value.
valueThe value to add.

◆ set_Lambda()

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.

Parameters
LambdaThe value of Lambda.

◆ validate_frame()

void DiFfRG::CsvOutput::validate_frame ( ) const

◆ value()

void DiFfRG::CsvOutput::value ( const std::string & name,
const double value )

Add a value to the output.

Parameters
nameThe name of the value.
valueThe value to add.

Member Data Documentation

◆ header

std::vector<std::string> DiFfRG::CsvOutput::header
private

◆ insertion_order

std::vector<std::string> DiFfRG::CsvOutput::insertion_order
private

◆ k_values

std::vector<double> DiFfRG::CsvOutput::k_values
private

◆ Lambda

double DiFfRG::CsvOutput::Lambda
private

◆ output_name

const std::string DiFfRG::CsvOutput::output_name
private

◆ output_stream

std::ofstream DiFfRG::CsvOutput::output_stream
private

◆ time_values

std::vector<double> DiFfRG::CsvOutput::time_values
private

◆ top_folder

const std::string DiFfRG::CsvOutput::top_folder
private

◆ values

std::unordered_map<std::string, std::vector<double> > DiFfRG::CsvOutput::values
private

◆ written_this_frame

std::unordered_set<std::string> DiFfRG::CsvOutput::written_this_frame
private

The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/data/csv_output.hh