OGS
CreateAqueousSolution.cpp
Go to the documentation of this file.
1
12
13#include "AqueousSolution.h"
14#include "BaseLib/ConfigTree.h"
17#include "MeshLib/Mesh.h"
19
20namespace ChemistryLib
21{
22namespace PhreeqcIOData
23{
24std::unique_ptr<AqueousSolution> createAqueousSolution(
25 BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh)
26{
28 auto const fixing_pe = config.getConfigAttribute<bool>("fixing_pe", false);
29
31 auto const temperature = config.getConfigParameter<double>("temperature");
32
34 auto const pressure = config.getConfigParameter<double>("pressure");
35
37 auto const pe0 = config.getConfigParameter<double>("pe");
38
41
42 auto components = createSolutionComponents(config);
43
44 auto charge_balance = createChargeBalance(config);
45
46 return std::make_unique<AqueousSolution>(fixing_pe, temperature, pressure,
47 pe, pe0, std::move(components),
48 charge_balance);
49}
50} // namespace PhreeqcIOData
51} // namespace ChemistryLib
Definition of the Mesh class.
T getConfigParameter(std::string const &param) const
T getConfigAttribute(std::string const &attr) 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)
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)