PhreeqcRM
YAMLPhreeqcRM.h
Go to the documentation of this file.
1#ifdef USE_YAML
13#ifndef INC_YAMLPHREEQCRM_H
14#define INC_YAMLPHREEQCRM_H
15#include <map>
16#include <mutex>
17#include <string>
18#include "yaml-cpp/yaml.h"
19#include "IrmResult.h"
20//#pragma once
21
22#include "irm_dll_export.h"
23
29class IRM_DLL_EXPORT YAMLPhreeqcRM
30{
31private:
32 YAML::Node YAML_doc;
33 std::map<std::string, int> method_map;
34 YAML::EmitterStyle::value style;
35protected:
36 friend class YAMLPhreeqcRMLib;
37 static std::map<size_t, YAMLPhreeqcRM*> Instances;
38 static std::mutex InstancesLock;
39 static size_t InstancesIndex;
40 size_t Index;
41public:
42
62 void Clear();
68 int GetId(void)const;
83 const YAML::Node& GetYAMLDoc() { return this->YAML_doc; };
97 void WriteYAMLDoc(std::string file_name);
98 // methods
168 void YAMLAddOutputVars(std::string option, std::string def);
186 void YAMLCloseFiles(void);
223 void YAMLCreateMapping(std::vector< int >& grid2chem);
247 void YAMLDumpModule(bool dump_on, bool append);
260 void YAMLThreadCount(int nthreads);
321 void YAMLInitialSolutions2Module(std::vector< int > solutions);
336 void YAMLInitialEquilibriumPhases2Module(std::vector< int > equilibrium_phases);
351 void YAMLInitialExchanges2Module(std::vector< int > exchanges);
366 void YAMLInitialSurfaces2Module(std::vector< int > surfaces);
381 void YAMLInitialGasPhases2Module(std::vector< int > gas_phases);
396 void YAMLInitialSolidSolutions2Module(std::vector< int > solid_solutions);
411 void YAMLInitialKinetics2Module(std::vector< int > kinetics);
454 void YAMLInitialPhreeqc2Module(std::vector< int > initial_conditions1);
522 void YAMLInitialPhreeqc2Module(std::vector< int > initial_conditions1, std::vector< int > initial_conditions2, std::vector< double > fraction1);
553 void YAMLInitialPhreeqcCell2Module(int n, std::vector< int > cell_numbers);
574 void YAMLLoadDatabase(std::string database);
594 void YAMLLogMessage(std::string str);
616 void YAMLOpenFiles(void);
636 void YAMLOutputMessage(std::string str);
665 void YAMLRunCells(void);
693 void YAMLRunFile(bool workers, bool initial_phreeqc, bool utility, std::string chemistry_name);
723 void YAMLRunString(bool workers, bool initial_phreeqc, bool utility, std::string input_string);
745 void YAMLScreenMessage(std::string str);
775 void YAMLSetComponentH2O(bool tf);
801 void YAMLSetConcentrations(std::vector< double >& c);
855 void YAMLSetDensityUser(std::vector< double > density);
878 void YAMLSetDumpFileName(std::string dump_name);
922 void YAMLSetErrorOn(bool tf);
944 void YAMLSetFilePrefix(std::string prefix);
975 void YAMLSetGasCompMoles(std::vector< double > gas_moles);
1009 void YAMLSetGasPhaseVolume(std::vector< double > gas_volume);
1121 void YAMLSetPorosity(std::vector< double > por);
1145 void YAMLSetPressure(std::vector< double > p);
1175 void YAMLSetPrintChemistryMask(std::vector< int > cell_mask);
1213 void YAMLSetPrintChemistryOn(bool workers, bool initial_phreeqc, bool utility);
1310 void YAMLSetRepresentativeVolume(std::vector< double > rv);
1341 void YAMLSetSaturationUser(std::vector< double > sat);
1364 void YAMLSetScreenOn(bool tf);
1422 void YAMLSetSpeciesSaveOn(bool save_on);
1450 void YAMLSetTemperature(std::vector< double > t);
1471 void YAMLSetTime(double time);
1494 void YAMLSetTimeConversion(double conv_factor);
1517 void YAMLSetTimeStep(double time_step);
1555 void YAMLSetUnitsExchange(int option);
1594 void YAMLSetUnitsGasPhase(int option);
1650 void YAMLSetUnitsKinetics(int option);
1746 void YAMLSetUnitsSolution(int option);
1822 void YAMLSetUnitsSurface(int option);
1858 void YAMLSpeciesConcentrations2Module(std::vector< double > species_conc);
1888 void YAMLStateSave(int istate);
1918 void YAMLStateApply(int istate);
1940 void YAMLStateDelete(int istate);
2002 void YAMLWarningMessage(std::string warnstr);
2003 // data
2004
2005};
2006#include "bmi.hxx"
2013{
2014public:
2015 //static void CleanupYAMLPhreeqcRMInstances(void);
2016 static int CreateYAMLPhreeqcRM(void);
2019};
2020
2021#endif // INC_YAMLPHREEQCRM_H
2022#endif
Enumeration used to return error codes.
IRM_RESULT
Enumeration for PhreeqcRM function return codes.
Definition IrmResult.h:8
Class to implement multiple instances of YAMLPhreeqcRM.
Definition YAMLPhreeqcRM.h:2013
static IRM_RESULT DestroyYAMLPhreeqcRM(int n)
static YAMLPhreeqcRM * GetInstance(int n)
static int CreateYAMLPhreeqcRM(void)
YAML helper class.
Definition YAMLPhreeqcRM.h:30
void YAMLSetGridCellCount(int n)
int GetId(void) const
void YAMLSetUnitsSolution(int option)
void YAMLInitialExchanges2Module(std::vector< int > exchanges)
size_t Index
Definition YAMLPhreeqcRM.h:40
void YAMLSetUnitsPPassemblage(int option)
void YAMLSetTimeConversion(double conv_factor)
void YAMLUseSolutionDensityVolume(bool tf)
void YAMLScreenMessage(std::string str)
void YAMLInitialPhreeqcCell2Module(int n, std::vector< int > cell_numbers)
void YAMLSetTime(double time)
void YAMLInitialSolutions2Module(std::vector< int > solutions)
void YAMLSetUnitsExchange(int option)
void YAMLRunFile(bool workers, bool initial_phreeqc, bool utility, std::string chemistry_name)
void YAMLInitialEquilibriumPhases2Module(std::vector< int > equilibrium_phases)
void YAMLSetNthSelectedOutput(int n)
void YAMLInitialGasPhases2Module(std::vector< int > gas_phases)
void YAMLInitialPhreeqc2Module(std::vector< int > initial_conditions1)
void YAMLSetConcentrations(std::vector< double > &c)
void YAMLWarningMessage(std::string warnstr)
void YAMLDumpModule(bool dump_on, bool append)
const YAML::Node & GetYAMLDoc()
Definition YAMLPhreeqcRM.h:83
void YAMLFindComponents()
void YAMLSetPrintChemistryOn(bool workers, bool initial_phreeqc, bool utility)
void YAMLSetRepresentativeVolume(std::vector< double > rv)
void YAMLLogMessage(std::string str)
void YAMLStateDelete(int istate)
void WriteYAMLDoc(std::string file_name)
void YAMLSetGasPhaseVolume(std::vector< double > gas_volume)
void YAMLSetPrintChemistryMask(std::vector< int > cell_mask)
void YAMLSetSaturationUser(std::vector< double > sat)
void YAMLSetDensityUser(std::vector< double > density)
static std::mutex InstancesLock
Definition YAMLPhreeqcRM.h:38
void YAMLSetUnitsSSassemblage(int option)
void YAMLStateApply(int istate)
void YAMLSetSpeciesSaveOn(bool save_on)
static size_t InstancesIndex
Definition YAMLPhreeqcRM.h:39
void YAMLSetPartitionUZSolids(bool tf)
void YAMLThreadCount(int nthreads)
void YAMLInitialKinetics2Module(std::vector< int > kinetics)
void YAMLInitialSolidSolutions2Module(std::vector< int > solid_solutions)
void YAMLAddOutputVars(std::string option, std::string def)
void YAMLSetTemperature(std::vector< double > t)
void YAMLCloseFiles(void)
void YAMLRunString(bool workers, bool initial_phreeqc, bool utility, std::string input_string)
void YAMLSetRebalanceByCell(bool tf)
void YAMLSetUnitsKinetics(int option)
void YAMLSetFilePrefix(std::string prefix)
void YAMLInitialPhreeqc2Module(std::vector< int > initial_conditions1, std::vector< int > initial_conditions2, std::vector< double > fraction1)
void YAMLSetScreenOn(bool tf)
void YAMLSetDumpFileName(std::string dump_name)
void YAMLSetErrorHandlerMode(int mode)
void YAMLLoadDatabase(std::string database)
void YAMLSetRebalanceFraction(double f)
void YAMLSetTimeStep(double time_step)
void YAMLSetComponentH2O(bool tf)
void YAMLSetUnitsSurface(int option)
void YAMLSetPorosity(std::vector< double > por)
void YAMLSetUnitsGasPhase(int option)
void YAMLSetSelectedOutputOn(bool tf)
void YAMLOpenFiles(void)
void YAMLCreateMapping(std::vector< int > &grid2chem)
void YAMLRunCells(void)
void YAMLOutputMessage(std::string str)
void YAMLStateSave(int istate)
void YAMLSetCurrentSelectedOutputUserNumber(int n_user)
static std::map< size_t, YAMLPhreeqcRM * > Instances
Definition YAMLPhreeqcRM.h:37
void YAMLSetErrorOn(bool tf)
void YAMLInitialSurfaces2Module(std::vector< int > surfaces)
void YAMLSetGasCompMoles(std::vector< double > gas_moles)
void YAMLSetPressure(std::vector< double > p)
void YAMLSpeciesConcentrations2Module(std::vector< double > species_conc)