Commit 8ab20082 authored by renchao.lu's avatar renchao.lu
Browse files

[CL] kinetic reactant constructor.

parent 19f6c8eb
......@@ -40,8 +40,8 @@ std::vector<KineticReactant> createKineticReactants(
auto parameters =
//! \ogs_file_param{prj__chemical_system__kinetic_reactants__kinetic_reactant__parameters}
reactant_config.getConfigParameterOptional<std::vector<double>>(
"parameters");
reactant_config.getConfigParameter<std::vector<double>>(
"parameters", {});
kinetic_reactants.emplace_back(std::move(name),
std::move(chemical_formula),
......
......@@ -20,16 +20,14 @@ namespace ChemistryLib
{
struct KineticReactant
{
KineticReactant(std::string name_,
KineticReactant(std::string&& name_,
std::string&& chemical_formula_,
double amount_,
boost::optional<std::vector<double>>
parameters_)
std::vector<double>&& parameters_)
: name(std::move(name_)),
chemical_formula(std::move(chemical_formula_)),
amount(amount_),
parameters(parameters_ ? std::move(*parameters_)
: std::vector<double>{})
parameters(std::move(parameters_))
{
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment