TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Ecrire_YAML Class Reference

classe Ecrire_YAML Use this to generate a yaml file that will then be read by the PDI library (for checkpoint/restart or for domain partitioning) More...

#include <Ecrire_YAML.h>

Public Member Functions

 Ecrire_YAML ()
void write_checkpoint_file (const std::string &yaml_fname)
 Generate the YAML file that will be read for checkpoint.
void write_restart_file (const std::string &yaml_fname)
 Generate the YAML file that will be read for restart.
void write_champ_fonc_restart_file (const std::string &filename)
 Generate the YAML file that will be read with champ_fonc_reprise.
void add_pb_base (const Probleme_base &pb_base, const Nom &full_file_name)
void add_field (Nom pb, Nom nom, int nb_dim)
 Adds a field (name+dimension) to the block of the problem pb_name in the YAML file.
void add_scalar (Nom pb, Nom nom, Nom type, bool is_local)
 Adds a scalar (name+type) to the block of the problem pb_name in the YAML file.

Detailed Description

classe Ecrire_YAML Use this to generate a yaml file that will then be read by the PDI library (for checkpoint/restart or for domain partitioning)

The data that will be written are the ones that have been set in Equation_base::data_a_sauvegarder() (+overloads) and Postraitement_base::data_a_sauvegarder() (+ overloads)

These data must then be shared with PDI (during the simulation) in order to trigger the wanted IO operations, see also the class TRUST_2_PDI

The structure of the file is as follows (indentation matters!):

Metadata: mdata1 : type # for scalar mdata2 : { type: array, subtype: ..., size: ... } # for arrays ... Data: data1 : type ... Plugins: plugin1: plugin2: ...

We're using the HDF5 plugin. Here is an example of how to declare a HDF5 dataset (structure gathering data of the same type) and write our TRUST data into it:

  • file: filename datasets: dataset1: { type: array, subtype: ..., size: ... } #declaration of first dataset dataset2: { type: array, subtype: ..., size: ... } #declaration of second dataset ... write: data1: # TRUST data (it has to be declared in the data section first!) dataset: dataset1 # the dataset to which the data belongs dataset_selection: size: [...,...] # What is the size of the section in the dataset (for every dimension) we will work with ? start:[...,...] # Where do we want to start to write/read the data in the dataset (for every dimension)?

Definition at line 63 of file Ecrire_YAML.h.

Constructor & Destructor Documentation

◆ Ecrire_YAML()

Ecrire_YAML::Ecrire_YAML ( )
inline

Definition at line 66 of file Ecrire_YAML.h.

Member Function Documentation

◆ add_field()

void Ecrire_YAML::add_field ( Nom pb,
Nom nom,
int nb_dim )

Adds a field (name+dimension) to the block of the problem pb_name in the YAML file.

Definition at line 560 of file Ecrire_YAML.cpp.

◆ add_pb_base()

void Ecrire_YAML::add_pb_base ( const Probleme_base & pb_base,
const Nom & full_file_name )
inline

Definition at line 76 of file Ecrire_YAML.h.

◆ add_scalar()

void Ecrire_YAML::add_scalar ( Nom pb,
Nom nom,
Nom type,
bool is_local )

Adds a scalar (name+type) to the block of the problem pb_name in the YAML file.

Definition at line 583 of file Ecrire_YAML.cpp.

◆ write_champ_fonc_restart_file()

void Ecrire_YAML::write_champ_fonc_restart_file ( const std::string & filename)

Generate the YAML file that will be read with champ_fonc_reprise.

Definition at line 47 of file Ecrire_YAML.cpp.

◆ write_checkpoint_file()

void Ecrire_YAML::write_checkpoint_file ( const std::string & yaml_fname)

Generate the YAML file that will be read for checkpoint.

Definition at line 23 of file Ecrire_YAML.cpp.

◆ write_restart_file()

void Ecrire_YAML::write_restart_file ( const std::string & yaml_fname)

Generate the YAML file that will be read for restart.

Definition at line 35 of file Ecrire_YAML.cpp.


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