A class for generating full YAML input files from multiple data sources. More...
#include <YamlWriter.h>
A class for generating full YAML input files from multiple data sources.
Definition at line 27 of file YamlWriter.h.
Public Member Functions | |
void | setHeader (const AnyMap &header) |
Include top-level information used in YAML header block. | |
void | addPhase (shared_ptr< Solution > soln, bool includeAdjacent=true) |
Include a phase definition for the specified Solution object. | |
void | addPhase (shared_ptr< ThermoPhase > thermo, shared_ptr< Kinetics > kin={}, shared_ptr< Transport > tran={}) |
Include a phase definition using the specified ThermoPhase, (optional) Kinetics, and (optional) Transport objects. | |
string | toYamlString () const |
Return a YAML string that contains the definitions for the added phases, species, and reactions. | |
void | toYamlFile (const string &filename) const |
Write the definitions for the added phases, species and reactions to the specified file. | |
void | setPrecision (long int n) |
For output floating point values, set the maximum number of digits to the right of the decimal point. | |
void | skipUserDefined (bool skip=true) |
By default user-defined data present in the input is preserved on output. | |
void | setUnits (const map< string, string > &units={}) |
Set the units to be used in the output file. | |
void | setUnitSystem (const UnitSystem &units=UnitSystem()) |
Set the units to be used in the output file. | |
Protected Attributes | |
AnyMap | m_header |
Top-level information used in YAML header block. | |
vector< shared_ptr< Solution > > | m_phases |
long int | m_float_precision = 15 |
See setPrecision() | |
bool | m_skip_user_defined = false |
See skipUserDefined() | |
UnitSystem | m_output_units |
Top-level units directive for the output file. | |
void setHeader | ( | const AnyMap & | header | ) |
Include top-level information used in YAML header block.
Definition at line 19 of file YamlWriter.cpp.
void addPhase | ( | shared_ptr< Solution > | soln, |
bool | includeAdjacent = true |
||
) |
Include a phase definition for the specified Solution object.
Definition at line 23 of file YamlWriter.cpp.
void addPhase | ( | shared_ptr< ThermoPhase > | thermo, |
shared_ptr< Kinetics > | kin = {} , |
||
shared_ptr< Transport > | tran = {} |
||
) |
Include a phase definition using the specified ThermoPhase, (optional) Kinetics, and (optional) Transport objects.
Definition at line 45 of file YamlWriter.cpp.
string toYamlString | ( | ) | const |
Return a YAML string that contains the definitions for the added phases, species, and reactions.
Definition at line 55 of file YamlWriter.cpp.
void toYamlFile | ( | const string & | filename | ) | const |
Write the definitions for the added phases, species and reactions to the specified file.
Definition at line 189 of file YamlWriter.cpp.
|
inline |
For output floating point values, set the maximum number of digits to the right of the decimal point.
The default is 15 digits.
Definition at line 53 of file YamlWriter.h.
|
inline |
By default user-defined data present in the input is preserved on output.
This method can be used to skip output of user-defined data fields which are not directly used by Cantera.
Definition at line 60 of file YamlWriter.h.
void setUnits | ( | const map< string, string > & | units = {} | ) |
Set the units to be used in the output file.
Dimensions not specified will use Cantera's defaults.
units | A map where keys are dimensions (mass, length, time, quantity, pressure, energy, activation-energy) and the values are corresponding units supported by the UnitSystem class. |
Definition at line 195 of file YamlWriter.cpp.
void setUnitSystem | ( | const UnitSystem & | units = UnitSystem() | ) |
Set the units to be used in the output file.
Dimensions not specified will use Cantera's defaults.
units | A UnitSystem object specifying dimensions (mass, length, time, quantity, pressure, energy, activation-energy). |
Definition at line 201 of file YamlWriter.cpp.
|
protected |
Top-level information used in YAML header block.
Definition at line 79 of file YamlWriter.h.
|
protected |
Definition at line 81 of file YamlWriter.h.
|
protected |
See setPrecision()
Definition at line 84 of file YamlWriter.h.
|
protected |
Definition at line 87 of file YamlWriter.h.
|
protected |
Top-level units directive for the output file.
Defaults to Cantera's native SI+kmol system.
Definition at line 91 of file YamlWriter.h.