25#ifndef DUMUX_COMMON_VARIABLES_HH
26#define DUMUX_COMMON_VARIABLES_HH
30#include <dune/common/typetraits.hh>
54 template<class T, bool indexable = Dune::IsIndexable<T>::value>
55 struct ScalarT {
using type = T; };
58 struct ScalarT<T, true>
60 using Element = std::decay_t<decltype(std::declval<T>()[0])>;
61 using type =
typename ScalarT<Element>::type;
69 using Scalar =
typename ScalarT<X>::type;
86 : x_(std::move(x)), t_(t)
90 template<
class Initializer,
91 std::enable_if_t<(std::is_invocable_r_v<void, Initializer, X&>),
int> = 0>
92 explicit Variables(
const Initializer& initializeSolution,
96 initializeSolution(x_);
Class that represents a time level during time integration.
Definition: variables.hh:33
Class that represents the variables of a model. We assume that models are formulated on the basis of ...
Definition: variables.hh:53
void update(const SolutionVector &x, const TimeLevel &t)
Update the state to a new solution & time level.
Definition: variables.hh:118
void update(const SolutionVector &x)
Update the state to a new solution.
Definition: variables.hh:110
void updateTime(const TimeLevel &t)
Update the time level only.
Definition: variables.hh:114
const SolutionVector & dofs() const
Return reference to the solution.
Definition: variables.hh:104
const TimeLevel & timeLevel() const
Return the time level.
Definition: variables.hh:100
Variables(const Initializer &initializeSolution, const TimeLevel &timeLevel=TimeLevel{0.0})
Construction from initializer lambda.
Definition: variables.hh:92
Variables(const SolutionVector &x, const TimeLevel &t=TimeLevel{0.0})
Construction from a solution.
Definition: variables.hh:78
Variables(SolutionVector &&x, const TimeLevel &t=TimeLevel{0.0})
Construction from a solution.
Definition: variables.hh:84
Variables()
Default constructor.
Definition: variables.hh:75
X SolutionVector
export the type of solution vector
Definition: variables.hh:66
typename ScalarT< X >::type Scalar
export the underlying scalar type
Definition: variables.hh:69
SolutionVector & dofs()
Non-const access still required for privar switch (TODO: Remove dependency)
Definition: variables.hh:107
Class that represents a time level during time integration.
Definition: timelevel.hh:34