Commit e98f9bd7 authored by Lukas Riedel's avatar Lukas Riedel

Improve parameterization docstrings and docs

parent ce4823ba
......@@ -136,7 +136,7 @@ script. It is readily installed into the
Physical Line(6) = {5, 6}; // left
Parameterization Class Documentation
Parameterization class documentation
------------------------------------
The following is the doxygen documentation of the classes implementing the soil
......@@ -145,14 +145,12 @@ must match one of the instances derived from ``RichardsParameterization``.
Their ``type`` and the names of their member parameters must match.
.. doxygenclass:: Dune::Dorie::RichardsParameterization
:members:
:private-members:
:undoc-members:
:members:
:private-members:
.. doxygenclass:: Dune::Dorie::MualemVanGenuchtenParameterization
:members:
:private-members:
:undoc-members:
:members:
:private-members:
.. _YAML: https://gettaurus.org/docs/YAMLTutorial/
......
......@@ -11,6 +11,15 @@ namespace Dune {
namespace Dorie {
/// Class specifying the Mualem–van Genuchten parameterization
/** Implements the following parameters which need to be specified in the
* respective parameter file:
* * RichardsParameterization::ResidualWaterContent "theta_r"
* * RichardsParameterization::SaturatedWaterContent "theta_s"
* * RichardsParameterization::SaturatedConductivity "k0"
* * Alpha "alpha"
* * N "n"
* * Tau "tau"
*/
template <typename Traits>
class MualemVanGenuchtenParameterization :
public RichardsParameterization<Traits>
......@@ -50,9 +59,9 @@ public:
inline static const std::string name = "tau";
};
Alpha _alpha;
Tau _tau;
N _n;
Alpha _alpha; //!< Value of air-entry value Alpha
Tau _tau; //!< Value of skew-factor Tau
N _n; //!< Value of retention curve shape factor N
/// The name of this parameterization type (This is not the instance name)
static inline std::string type = "MvG";
......@@ -60,14 +69,20 @@ public:
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
*/
MualemVanGenuchtenParameterization (const std::string name) :
RichardsParameterization<Traits>(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
MualemVanGenuchtenParameterization (const std::string name,
const std::tuple<Args...> parameters) :
MualemVanGenuchtenParameterization (
const std::string name,
const std::tuple<Args...> parameters) :
RichardsParameterization<Traits>(name, parameters),
_alpha(std::get<Alpha>(parameters)),
_tau(std::get<Tau>(parameters)),
......@@ -77,6 +92,9 @@ public:
/// Add default destructor to clarify override
~MualemVanGenuchtenParameterization () override = default;
/// Return a scaled conductivity function
/** Saturation -> Conductivity
*/
std::function<Conductivity(const Saturation)> conductivity_f () const
override
{
......@@ -90,6 +108,9 @@ public:
};
}
/// Return a scaled saturation function
/** Matric head -> Saturation
*/
std::function<Saturation(const MatricHead)> saturation_f () const
override
{
......@@ -104,6 +125,9 @@ public:
};
}
/// Return a map of parameter names and values for manipulation
/** \return Map: Parameter name, parameter value in this object
*/
std::map<std::string, double&> parameters () override
{
return {
......
......@@ -80,20 +80,29 @@ public:
inline static const std::string name = "theta_s";
};
//! Value of the residual water content.
ResidualWaterContent _theta_r;
//! Value of the saturated water content.
SaturatedWaterContent _theta_s;
//! Value of the saturated hydraulic conductivity.
SaturatedConductivity _k0;
//!< The name of this parameterization instance, associated with the layer.
//! The name of this parameterization instance, associated with the layer.
const std::string _name;
public:
/// Construct with default-initialized parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
RichardsParameterization (const std::string name) :
_name(name)
{ }
/// Construct from a tuple of parameters
/** \param name The name associated with this soil layer
* \param parameters Tuple of parameters to use in this parameterization
*/
template<typename... Args>
RichardsParameterization (const std::string name,
const std::tuple<Args...> parameters) :
......@@ -103,6 +112,7 @@ public:
_name(name)
{ }
/// Default constructor (virtual).
virtual ~RichardsParameterization () = default;
/// Return the name of this parameterization instance.
......@@ -132,9 +142,9 @@ public:
virtual std::function<Conductivity(const Saturation)> conductivity_f ()
const = 0;
/// Return a map referecing all parameters by their names
/** \return Map. Key: Name of parameter (string). Value: Value of parameter
* (double&)
/// Return a map referecing all parameters by their names.
/** \return Map. Key: Name of parameter (string).
* Value: Value of parameter (double&)
*/
virtual std::map<std::string, double&> parameters () = 0;
......
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