OGS
CreateSolutionComponent.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include "AqueousSolution.h"
8
9namespace ChemistryLib
10{
11namespace PhreeqcIOData
12{
13std::vector<Component> createSolutionComponents(
14 BaseLib::ConfigTree const& config)
15{
16 std::vector<Component> components;
18 auto components_config = config.getConfigSubtree("components");
19
20 for (
21 auto const& component_config :
23 components_config.getConfigSubtreeList("component"))
24 {
25 auto const component_name = component_config.getValue<std::string>();
26 auto const chemical_formula =
28 component_config.getConfigAttribute<std::string>("chemical_formula",
29 "");
30 components.emplace_back(component_name, chemical_formula);
31 }
32
33 return components;
34}
35} // namespace PhreeqcIOData
36} // namespace ChemistryLib
Per-system aqueous state exchanged with PHREEQC.
ConfigTree getConfigSubtree(std::string const &root) const
std::vector< Component > createSolutionComponents(BaseLib::ConfigTree const &config)