13#ifndef DUMUX_COMMON_VARIABLES_HH
14#define DUMUX_COMMON_VARIABLES_HH
18#include <dune/common/typetraits.hh>
42 template<class T, bool indexable = Dune::IsIndexable<T>::value>
43 struct ScalarT {
using type = T; };
46 struct ScalarT<T, true>
48 using Element = std::decay_t<decltype(std::declval<T>()[0])>;
49 using type =
typename ScalarT<Element>::type;
57 using Scalar =
typename ScalarT<X>::type;
74 : x_(std::move(x)), t_(t)
78 template<
class Initializer,
79 std::enable_if_t<(std::is_invocable_r_v<void, Initializer, X&>),
int> = 0>
80 explicit Variables(
const Initializer& initializeSolution,
84 initializeSolution(x_);
Class that represents a time level during time integration.
Definition: timelevel.hh:22
Class that represents the variables of a model. We assume that models are formulated on the basis of ...
Definition: variables.hh:41
void update(const SolutionVector &x, const TimeLevel &t)
Update the state to a new solution & time level.
Definition: variables.hh:106
void update(const SolutionVector &x)
Update the state to a new solution.
Definition: variables.hh:98
void updateTime(const TimeLevel &t)
Update the time level only.
Definition: variables.hh:102
const SolutionVector & dofs() const
Return reference to the solution.
Definition: variables.hh:92
const TimeLevel & timeLevel() const
Return the time level.
Definition: variables.hh:88
Variables(const Initializer &initializeSolution, const TimeLevel &timeLevel=TimeLevel{0.0})
Construction from initializer lambda.
Definition: variables.hh:80
Variables(const SolutionVector &x, const TimeLevel &t=TimeLevel{0.0})
Construction from a solution.
Definition: variables.hh:66
Variables(SolutionVector &&x, const TimeLevel &t=TimeLevel{0.0})
Construction from a solution.
Definition: variables.hh:72
Variables()
Default constructor.
Definition: variables.hh:63
X SolutionVector
export the type of solution vector
Definition: variables.hh:54
typename ScalarT< X >::type Scalar
export the underlying scalar type
Definition: variables.hh:57
SolutionVector & dofs()
Non-const access still required for privar switch (TODO: Remove dependency)
Definition: variables.hh:95
Definition: experimental/assembly/cclocalassembler.hh:36
Class that represents a time level during time integration.