OGS
CreateSolutionComponent.cpp
Go to the documentation of this file.
1
12
13#include "AqueousSolution.h"
14#include "BaseLib/ConfigTree.h"
15
16namespace ChemistryLib
17{
18namespace PhreeqcIOData
19{
20std::vector<Component> createSolutionComponents(
21 BaseLib::ConfigTree const& config)
22{
23 std::vector<Component> components;
25 auto components_config = config.getConfigSubtree("components");
26
27 for (
28 auto const& component_config :
30 components_config.getConfigSubtreeList("component"))
31 {
32 auto const component_name = component_config.getValue<std::string>();
33 auto const chemical_formula =
35 component_config.getConfigAttribute<std::string>("chemical_formula",
36 "");
37 components.emplace_back(component_name, chemical_formula);
38 }
39
40 return components;
41}
42} // namespace PhreeqcIOData
43} // namespace ChemistryLib
ConfigTree getConfigSubtree(std::string const &root) const
std::vector< Component > createSolutionComponents(BaseLib::ConfigTree const &config)