Commit 74a1d84b authored by Lukas Riedel's avatar Lukas Riedel

Add parameterization constructors taking tuples as arguments

* Fix name of parameter Alpha
* Add name of MvG parameterization
parent e3caea12
......@@ -227,15 +227,11 @@ public:
typename MvG::Tau tau{p_values.at(4)};
typename RP::SaturatedConductivity k0{p_values.at(5)};
// can create parameters out of order by using tuple
auto mvg =
std::make_shared<MualemVanGenuchtenParameterization<Traits>>
(
theta_r,
theta_s,
k0,
alpha,
tau,
n
std::make_tuple(theta_s, theta_r, k0, alpha, tau, n)
);
ScalingType type = RP::Scaling::None;
......
......@@ -33,7 +33,7 @@ public:
struct Alpha
{
RF value;
inline static const std::string name = "a";
inline static const std::string name = "alpha";
};
/// Parameter defining the value of n (retention curve shape)
......@@ -54,7 +54,12 @@ public:
Tau _tau;
N _n;
public:
/// Name associated with this parameterization type
static inline std::string name = "MvG";
public:
/// Construct from single parameters
MualemVanGenuchtenParameterization (
const ResidualWaterContent theta_r,
const SaturatedWaterContent theta_s,
......@@ -69,6 +74,15 @@ public:
_n(n)
{ }
/// Construct from a tuple of parameters
template<typename... Args>
MualemVanGenuchtenParameterization (const std::tuple<Args...> parameters) :
RichardsParameterization<Traits>(parameters),
_alpha(std::get<Alpha>(parameters)),
_tau(std::get<Tau>(parameters)),
_n(std::get<N>(parameters))
{ }
/// Add default destructor to clarify override
~MualemVanGenuchtenParameterization () override = default;
......
......@@ -85,6 +85,7 @@ public:
public:
/// Construct from single parameters
RichardsParameterization (
const ResidualWaterContent theta_r,
const SaturatedWaterContent theta_s,
......@@ -95,6 +96,14 @@ public:
_k0(k0)
{ }
/// Construct from a tuple of parameters
template<typename... Args>
RichardsParameterization (const std::tuple<Args...> parameters) :
_theta_r(std::get<ResidualWaterContent>(parameters)),
_theta_s(std::get<SaturatedWaterContent>(parameters)),
_k0(std::get<SaturatedConductivity>(parameters))
{ }
virtual ~RichardsParameterization () = default;
/// Return a bound version of the water content function
......
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