Commit 133711d2 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#873 - #9 Parameters: improve comments.

parent 1a4e016d
......@@ -60,7 +60,7 @@ namespace HappyHeart
* \endverbatim
*
* In this case, g(t) is stored as a function and is recomputed at each \a TimeUpdate() calls (such calls
* should therefore be located in Model::InitializeStep() or Model::FinalizeStep()).
* should therefore be located in Model::InitializeStep() where the time update actually occur).
*/
......
......@@ -35,16 +35,46 @@ namespace HappyHeart
{
/*!
* \class doxygen_hide_apply_time_factor
*
* \brief Update the \a value_with_time_factor obtained after multiplying the time factor by the
* purely spatial component.
*
* Or in short, compute f(x) * g(t) given both parts.
*
* \copydoc doxygen_hide_param_time_dependancy
*
* The difficulty is that f(x) might be a scalar, a vector or a matrix; the different overloads here
* take care of each of this case.
*
*/
/*!
* \copydoc doxygen_hide_apply_time_factor
*
* <b>Overload for TypeT == Type::scalar.</b>
*/
void ApplyTimeFactor(double value_without_time_factor,
double time_factor,
double& value_with_time_factor) noexcept;
/*!
* \copydoc doxygen_hide_apply_time_factor
*
* <b>Overload for TypeT == Type::vector.</b>
*/
void ApplyTimeFactor(const LocalVector& value_without_time_factor,
double time_factor,
LocalVector& value_with_time_factor);
/*!
* \copydoc doxygen_hide_apply_time_factor
*
* <b>Overload for TypeT == Type::matrix.</b>
*/
void ApplyTimeFactor(const LocalMatrix& value_without_time_factor,
double time_factor,
LocalMatrix& value_with_time_factor);
......
......@@ -32,7 +32,19 @@ namespace HappyHeart
namespace TimeDependencyNS
{
/*!
* \brief Base class when there is a decoupled time dependency.
*
* \copydoc doxygen_hide_param_time_dependancy
*
* \tparam FunctorT A function with takes as argument a double (the time in seconds) and returns
* the time-related factor (g(t) in the explanation above).
* \tparam TypeT Whether the parameter at a quadrature point yields a scalar, a vector or a matrix.
*/
template
<
ParameterNS::Type TypeT,
......@@ -68,7 +80,7 @@ namespace HappyHeart
* \brief Constructor.
*
* \param[in] time_manager Object that keeps track of the time within the Model.
* \param[in] function Functor which returns the time-dependent factor given the current time.
* \param[in] functor Functor which returns the time-dependent factor given the current time.
*/
explicit Base(const TimeManager& time_manager,
FunctorT&& functor);
......@@ -113,6 +125,14 @@ namespace HappyHeart
//! Constant accessor to the object that keeps track of the time within the Model.
const TimeManager& GetTimeManager() const noexcept;
/*!
* \brief Return the full value of the Parameter, once the time factor has been taken into account.
*
* \param[in] value_without_time_factor Value computed at the quadrature point when only the spatial
* contribution has been taken into account (f(x) in the class explanation).
* \return Value once the time contribution has been taken into account (f(x) * g(t) in the class
* explanation).
*/
return_type ApplyTimeFactor(return_type value_without_time_factor) const;
private:
......@@ -142,6 +162,9 @@ namespace HappyHeart
* new object.
*
* The method is marked const as it acts solely upon a mutable data attribute.
*
* \return Reference to the object in which full value of the parameter at a given quadrature point is
* stored.
*/
storage_type& GetNonCstValueWithTimeFactor() const noexcept;
......@@ -186,7 +209,11 @@ namespace HappyHeart
} // namespace TimeDependencyNS
/*!
* \brief An instantiation of \a TimeDependencyNS::Base where the function is given by a mere std::function.
*
* \tparam TypeT Whether the parameter at a quadrature point yields a scalar, a vector or a matrix.
*/
template<ParameterNS::Type TypeT>
using TimeDependency = TimeDependencyNS::Base<TypeT, std::function<double(double)>>;
......
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