OGS
CreateAqueousSolution.cpp
Go to the documentation of this file.
1 
11 #include "CreateAqueousSolution.h"
12 
13 #include "AqueousSolution.h"
14 #include "BaseLib/ConfigTree.h"
17 #include "MeshLib/Mesh.h"
18 
19 namespace ChemistryLib
20 {
21 namespace PhreeqcIOData
22 {
23 std::unique_ptr<AqueousSolution> createAqueousSolution(
24  BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh)
25 {
27  auto const temperature = config.getConfigParameter<double>("temperature");
28 
30  auto const pressure = config.getConfigParameter<double>("pressure");
31 
33  auto const pe0 = config.getConfigParameter<double>("pe");
34 
35  auto pe = MeshLib::getOrCreateMeshProperty<double>(
37 
38  auto components = createSolutionComponents(config);
39 
40  auto charge_balance = createChargeBalance(config);
41 
42  return std::make_unique<AqueousSolution>(
43  temperature, pressure, pe, pe0, std::move(components), charge_balance);
44 }
45 } // namespace PhreeqcIOData
46 } // namespace ChemistryLib
Definition of the Mesh class.
T getConfigParameter(std::string const &param) const
std::unique_ptr< AqueousSolution > createAqueousSolution(BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh)
std::vector< Component > createSolutionComponents(BaseLib::ConfigTree const &config)
ChargeBalance createChargeBalance(BaseLib::ConfigTree const &config)