https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 6f75a96301228149ac622f0ead89662731c73fc4 authored by Tom Fischer on 08 October 2021, 12:31:50 UTC
Merge branch 'FixShapeMatrixDimensionError' into 'master'
Tip revision: 6f75a96
KineticReactant.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 "KineticReactant.h"

#include <algorithm>

namespace ChemistryLib
{
namespace PhreeqcKernelData
{
KineticReactant::KineticReactant(std::string const& name,
                                 double const initial_amount)
{
    rate_name = name.c_str();
    namecoef.add(name.c_str(), 1.0);
    m = initial_amount;
    m0 = initial_amount;
}

Kinetics::Kinetics(std::vector<KineticReactant> const& kinetic_reactants)
{
    std::transform(kinetic_reactants.begin(),
                   kinetic_reactants.end(),
                   std::back_inserter(kinetics_comps),
                   [](KineticReactant const& kinetic_reactant) {
                       return *kinetic_reactant.castToBaseClass();
                   });
}
}  // namespace PhreeqcKernelData
}  // namespace ChemistryLib
back to top