[Richards] Add clone and access to parameters in parameterization

parent 7c1310dc
......@@ -148,6 +148,18 @@ public:
*/
virtual std::map<std::string, double&> parameters () = 0;
/// Return a map referecing all parameters by their names.
/** \return Map. Key: Name of parameter (string).
* Value: Value of parameter (const double&)
*/
virtual std::map<std::string, const double&> parameters () const = 0;
/// Return a clone of this object
/** \return a unique pointer with a copy of this object.
*/
virtual std::unique_ptr<RichardsParameterization<Traits>> clone () const = 0;
};
} // namespace Dune
......
......@@ -141,6 +141,27 @@ public:
{N::name, _n.value}
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::map<std::string, const double&> parameters () const override
{
return {
{ResidualWaterContent::name, this->_theta_r.value},
{SaturatedWaterContent::name, this->_theta_s.value},
{SaturatedConductivity::name, this->_k0.value},
{Alpha::name, _alpha.value},
{Tau::name, _tau.value},
{N::name, _n.value}
};
}
std::unique_ptr<RichardsParameterization<Traits>> clone () const override
{
using ThisType = MualemVanGenuchtenParameterization<Traits>;
return std::make_unique<ThisType>(*this);
}
};
} // namespace Dune
......
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