swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: 7530c9f1174945ed7d156abb969f34c2203ebd7f authored by Lars Bilke on 31 May 2021, 06:20:56 UTC
[T] Relax tolerances in Parallel_2D_StaggeredScheme_...
Tip revision: 7530c9f
EquilibriumReactants.h
/**
 * \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
 *
 */

#pragma once

#include <phreeqcpp/PPassemblage.h>

#include <set>
#include <string>
#include <vector>

namespace ChemistryLib
{
namespace PhreeqcKernelData
{
class PhaseComponent final : private cxxPPassemblageComp
{
public:
    PhaseComponent(std::string&& name_, double const initial_amount,
                   double const saturation_index);

    cxxPPassemblageComp const* castToBaseClass() const
    {
        return static_cast<cxxPPassemblageComp const*>(this);
    }

    std::string const& getName() const { return Get_name(); }
};

class EquilibriumReactants final : private cxxPPassemblage
{
public:
    explicit EquilibriumReactants(
        std::vector<PhaseComponent> const& phase_components);

    void setChemicalSystemID(std::size_t const chemical_system_id)
    {
        Set_n_user_both(chemical_system_id);
    }

    cxxPPassemblage const* castToBaseClass() const
    {
        return static_cast<cxxPPassemblage const*>(this);
    }

    std::map<std::string, cxxPPassemblageComp> const& getPhaseComponents() const
    {
        return castToBaseClass()->Get_pp_assemblage_comps();
    }
};

}  // namespace PhreeqcKernelData
}  // namespace ChemistryLib
back to top