swh:1:snp:6088ab52ef49920e01e3f334cdf4d5d6c8a822b9
Raw File
Tip revision: 5930c156413d1a86eb68c5781de6459a429083a6 authored by Wenqing Wang on 09 December 2021, 14:43:31 UTC
[Test/LIE] Update result with velocity orientation correction
Tip revision: 5930c15
CreateSolutionComponent.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#include "CreateSolutionComponent.h"

#include "AqueousSolution.h"
#include "BaseLib/ConfigTree.h"

namespace ChemistryLib
{
namespace PhreeqcIOData
{
std::vector<Component> createSolutionComponents(
    BaseLib::ConfigTree const& config)
{
    std::vector<Component> components;
    //! \ogs_file_param{prj__chemical_system__solution__components}
    auto components_config = config.getConfigSubtree("components");

    for (
        auto const& component_config :
        //! \ogs_file_param{prj__chemical_system__solution__components__component}
        components_config.getConfigSubtreeList("component"))
    {
        auto const component_name = component_config.getValue<std::string>();
        auto const chemical_formula =
            //! \ogs_file_attr{prj__chemical_system__solution__components__component__chemical_formula}
            component_config.getConfigAttribute<std::string>("chemical_formula",
                                                             "");
        components.emplace_back(component_name, chemical_formula);
    }

    return components;
}
}  // namespace PhreeqcIOData
}  // namespace ChemistryLib
back to top