OGS
CreateChemicalSystem.cpp
Go to the documentation of this file.
1
12
13#include "BaseLib/ConfigTree.h"
14#include "ChemicalSystem.h"
17#include "CreateExchange.h"
19#include "CreateSurface.h"
20#include "EquilibriumReactant.h"
21#include "Exchange.h"
22#include "KineticReactant.h"
23#include "Surface.h"
24
25namespace ChemistryLib
26{
27namespace PhreeqcIOData
28{
29std::unique_ptr<ChemicalSystem> createChemicalSystem(
30 BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh)
31{
32 // solution
33 auto aqueous_solution = createAqueousSolution(
35 config.getConfigSubtree("solution"), mesh);
36
37 // kinetic reactants
38 auto kinetic_reactants = createKineticReactants(
40 config.getConfigSubtreeOptional("kinetic_reactants"), mesh);
41
42 // equilibrium reactants
43 auto equilibrium_reactants = createEquilibriumReactants(
45 config.getConfigSubtreeOptional("equilibrium_reactants"), mesh);
46
47 // exchangers
48 auto exchangers = createExchange(
50 config.getConfigSubtreeOptional("exchangers"), mesh);
51
52 // surface
53 auto surface = createSurface(
55 config.getConfigSubtreeOptional("surface"), mesh);
56
57 return std::make_unique<ChemicalSystem>(std::move(aqueous_solution),
58 std::move(kinetic_reactants),
59 std::move(equilibrium_reactants),
60 std::move(exchangers),
61 std::move(surface));
62}
63} // namespace PhreeqcIOData
64} // namespace ChemistryLib
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
ConfigTree getConfigSubtree(std::string const &root) const
std::vector< std::variant< DensityBasedSurfaceSite, MoleBasedSurfaceSite > > createSurface(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)
std::unique_ptr< AqueousSolution > createAqueousSolution(BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh)
std::unique_ptr< ChemicalSystem > createChemicalSystem(BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh)
std::vector< ExchangeSite > createExchange(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)
std::vector< EquilibriumReactant > createEquilibriumReactants(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)
std::vector< KineticReactant > createKineticReactants(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)