Sapphire++
 v1.3.0-121-g2682132
Loading...
Searching...
No Matches
sapphirepp::Utils::OutputParameters Class Reference

Parameters class to handle output parameters. More...

#include <output-parameters.h>

Public Member Functions

 OutputParameters ()
 Constructor.
void declare_parameters (ParameterHandler &prm)
 Delcare parameters in parameter file.
void parse_parameters (ParameterHandler &prm)
 Parse parameters from parameter file.
template<unsigned int dim>
void write_results (DataOut< dim > &data_out, const unsigned int time_step_number=0, const double cur_time=std::numeric_limits< double >::min(), const bool write_mesh_hdf5=true, const std::string &filename="")
 Write results to file.
template<unsigned int dim>
void write_grid (const Triangulation< dim > &triangulation, const std::string &filename="grid.ucd") const
 Write a grid to a file in ucd format.
void move_checkpoint (const std::filesystem::path &checkpoint_folder, const std::string &old_filename="tmp.checkpoint", const std::string &new_filename="checkpoint") const
 Rename temporary checkpoint files to final checkpoint.
template<class Archive>
void serialize (Archive &ar, const unsigned int version)
 Write and read the data of this object from a archive.

Public Attributes

unsigned int output_frequency = 1
std::filesystem::path output_path
std::filesystem::path results_path
std::string simulation_id = "01"
std::string base_file_name = "solution"
unsigned int n_digits_for_counter = 4
OutputFormat format
bool debug_input_functions = false
unsigned int checkpoint_frequency = 0

Detailed Description

Parameters class to handle output parameters.

This function handles the output of Sapphire+⁠+. It defines all the output related parameters and provides functions to write the results.

Member Function Documentation

◆ declare_parameters()

void sapphirepp::Utils::OutputParameters::declare_parameters ( ParameterHandler & prm)

Delcare parameters in parameter file.

Parameters
prmParameterHandler

◆ move_checkpoint()

void sapphirepp::Utils::OutputParameters::move_checkpoint ( const std::filesystem::path & checkpoint_folder,
const std::string & old_filename = "tmp.checkpoint",
const std::string & new_filename = "checkpoint" ) const

Rename temporary checkpoint files to final checkpoint.

This operation can be considered atomic.

Parameters
checkpoint_folderFolder of the checkpoint files.
old_filenameBasefilename of the temporary checkpoint.
new_filenameBasefilename of the final checkpoint.
Todo
Make this operation atomic.

◆ parse_parameters()

void sapphirepp::Utils::OutputParameters::parse_parameters ( ParameterHandler & prm)

Parse parameters from parameter file.

Parameters
prmParameterHandler

◆ serialize()

template<class Archive>
void sapphirepp::Utils::OutputParameters::serialize ( Archive & ar,
const unsigned int version )
inline

Write and read the data of this object from a archive.

Template Parameters
ArchiveBOOST input/outout archive.
Parameters
arArchive.
versionArchive version.

◆ write_grid()

template<unsigned int dim>
template void sapphirepp::Utils::OutputParameters::write_grid< 3 > ( const Triangulation< dim > & triangulation,
const std::string & filename = "grid.ucd" ) const

Write a grid to a file in ucd format.

Template Parameters
dimDimension of the grid
Parameters
triangulationGrid
filenameName of the file

◆ write_results()

template<unsigned int dim>
template void sapphirepp::Utils::OutputParameters::write_results< 3 > ( DataOut< dim > & data_out,
const unsigned int time_step_number = 0,
const double cur_time = std::numeric_limits< double >::min(),
const bool write_mesh_hdf5 = true,
const std::string & filename = "" )

Write results to file.

Template Parameters
dimDimension of the solution
Parameters
data_outDataOut class with the solution. It must already contain all the data that should be written. This function only handles the last step of writing to the file.
time_step_numberNumber of the time step
cur_timeSimulation time associated with this time step
write_mesh_hdf5Only for hdf5: Write the mesh file? Needed at (re-)start of simulation or after refinement.
filenameOverwrite for the base_file_name
Note
This function should be a const member. The problem is, that in case of HDF5 output, the xdmf_entries are changed.
Todo
Append lines to xdmf file instead of rewriting the file

Member Data Documentation

◆ base_file_name

std::string sapphirepp::Utils::OutputParameters::base_file_name = "solution"

File name for the solution

◆ checkpoint_frequency

unsigned int sapphirepp::Utils::OutputParameters::checkpoint_frequency = 0

Save a checkpoint every n-th time step. Use 0 to disable checkpoints.

◆ debug_input_functions

bool sapphirepp::Utils::OutputParameters::debug_input_functions = false

Append user defined input functions to output as debug information?

◆ format

OutputFormat sapphirepp::Utils::OutputParameters::format

Output format

◆ n_digits_for_counter

unsigned int sapphirepp::Utils::OutputParameters::n_digits_for_counter = 4

Number of digits for time steps

◆ output_frequency

unsigned int sapphirepp::Utils::OutputParameters::output_frequency = 1

Only put out every n-th step

◆ output_path

std::filesystem::path sapphirepp::Utils::OutputParameters::output_path

Output folder = results_path + simulation_id

◆ results_path

std::filesystem::path sapphirepp::Utils::OutputParameters::results_path

Path to the results directory

◆ simulation_id

std::string sapphirepp::Utils::OutputParameters::simulation_id = "01"

Name of the simulation run, i.e. subfolder for the simulation


The documentation for this class was generated from the following files: