version 3.9-dev
Dumux::Experimental::Variables< X > Class Template Reference

Class that represents the variables of a model. We assume that models are formulated on the basis of primary and possibly secondary variables, where the latter may non-linearly depend on the former. Variables in Dumux represent the state of a numerical solution of a model, consisting of all primary/secondary variables and, if a transient problem is modeled, time information. More...

#include <dumux/experimental/common/variables.hh>

Inheritance diagram for Dumux::Experimental::Variables< X >:

Description

template<class X>
class Dumux::Experimental::Variables< X >

This class defines the interface that is expected of variable classes, and it provides the implementation for models that do not require storing any additional information besides the primary variables and (optionally) time.

Template Parameters
XThe type used for solution vectors, i.e. all primary variables.

Public Types

using SolutionVector = X
 export the type of solution vector More...
 
using Scalar = typename ScalarT< X >::type
 export the underlying scalar type More...
 
using TimeLevel = Dumux::Experimental::TimeLevel< Scalar >
 export the time representation More...
 

Public Member Functions

 Variables ()
 Default constructor. More...
 
 Variables (const SolutionVector &x, const TimeLevel &t=TimeLevel{0.0})
 Construction from a solution. More...
 
 Variables (SolutionVector &&x, const TimeLevel &t=TimeLevel{0.0})
 Construction from a solution. More...
 
template<class Initializer , std::enable_if_t<(std::is_invocable_r_v< void, Initializer, X & >), int > = 0>
 Variables (const Initializer &initializeSolution, const TimeLevel &timeLevel=TimeLevel{0.0})
 Construction from initializer lambda. More...
 
const TimeLeveltimeLevel () const
 Return the time level. More...
 
const SolutionVectordofs () const
 Return reference to the solution. More...
 
SolutionVectordofs ()
 Non-const access still required for privar switch (TODO: Remove dependency) More...
 
void update (const SolutionVector &x)
 Update the state to a new solution. More...
 
void updateTime (const TimeLevel &t)
 Update the time level only. More...
 
void update (const SolutionVector &x, const TimeLevel &t)
 Update the state to a new solution & time level. More...
 

Member Typedef Documentation

◆ Scalar

template<class X >
using Dumux::Experimental::Variables< X >::Scalar = typename ScalarT<X>::type

◆ SolutionVector

template<class X >
using Dumux::Experimental::Variables< X >::SolutionVector = X

◆ TimeLevel

template<class X >
using Dumux::Experimental::Variables< X >::TimeLevel = Dumux::Experimental::TimeLevel<Scalar>

Constructor & Destructor Documentation

◆ Variables() [1/4]

template<class X >
Dumux::Experimental::Variables< X >::Variables ( )
inlineexplicit

◆ Variables() [2/4]

template<class X >
Dumux::Experimental::Variables< X >::Variables ( const SolutionVector x,
const TimeLevel t = TimeLevel{0.0} 
)
inlineexplicit

◆ Variables() [3/4]

template<class X >
Dumux::Experimental::Variables< X >::Variables ( SolutionVector &&  x,
const TimeLevel t = TimeLevel{0.0} 
)
inlineexplicit

◆ Variables() [4/4]

template<class X >
template<class Initializer , std::enable_if_t<(std::is_invocable_r_v< void, Initializer, X & >), int > = 0>
Dumux::Experimental::Variables< X >::Variables ( const Initializer &  initializeSolution,
const TimeLevel timeLevel = TimeLevel{0.0} 
)
inlineexplicit

Member Function Documentation

◆ dofs() [1/2]

template<class X >
SolutionVector & Dumux::Experimental::Variables< X >::dofs ( )
inline

◆ dofs() [2/2]

template<class X >
const SolutionVector & Dumux::Experimental::Variables< X >::dofs ( ) const
inline

◆ timeLevel()

template<class X >
const TimeLevel & Dumux::Experimental::Variables< X >::timeLevel ( ) const
inline

◆ update() [1/2]

template<class X >
void Dumux::Experimental::Variables< X >::update ( const SolutionVector x)
inline

◆ update() [2/2]

template<class X >
void Dumux::Experimental::Variables< X >::update ( const SolutionVector x,
const TimeLevel t 
)
inline

◆ updateTime()

template<class X >
void Dumux::Experimental::Variables< X >::updateTime ( const TimeLevel t)
inline

The documentation for this class was generated from the following file: