13#ifndef DUMUX_FV_GRID_VARIABLES_HH 
   14#define DUMUX_FV_GRID_VARIABLES_HH 
   28template<
class GG, 
class GVV, 
class GFVC>
 
   45    using Scalar = std::decay_t<decltype(std::declval<PrimaryVariables>()[0])>;
 
   50    template<
class Problem>
 
   54    , curGridVolVars_(*problem)
 
   55    , prevGridVolVars_(*problem)
 
   56    , gridFluxVarsCache_(*problem)
 
 
   60    template<
class SolutionVector>
 
   61    void init(
const SolutionVector& curSol)
 
   67        gridFluxVarsCache_.update(*
gridGeometry_, curGridVolVars_, curSol, 
true);
 
   73        prevGridVolVars_ = curGridVolVars_;
 
 
   77    template<
class SolutionVector>
 
   78    void update(
const SolutionVector& curSol, 
bool forceFluxCacheUpdate = 
false)
 
   84        gridFluxVarsCache_.update(*
gridGeometry_, curGridVolVars_, curSol, forceFluxCacheUpdate);
 
 
   88    template<
class SolutionVector>
 
   96        prevGridVolVars_ = curGridVolVars_;
 
 
  105        prevGridVolVars_ = curGridVolVars_;
 
 
  109    template<
class SolutionVector>
 
  113        curGridVolVars_ = prevGridVolVars_;
 
  116        gridFluxVarsCache_.update(*
gridGeometry_, curGridVolVars_, solution);
 
 
  121    { 
return gridFluxVarsCache_; }
 
 
  125    { 
return gridFluxVarsCache_; }
 
 
  129    { 
return curGridVolVars_; }
 
 
  133    { 
return curGridVolVars_; }
 
 
  137    { 
return prevGridVolVars_; }
 
 
  141    { 
return prevGridVolVars_; }
 
 
 
GridVolumeVariables & curGridVolVars()
return the current volume variables
Definition discretization/fvgridvariables.hh:132
const GridFluxVariablesCache & gridFluxVarsCache() const
return the flux variables cache
Definition discretization/fvgridvariables.hh:120
GG GridGeometry
export type of the finite volume grid geometry
Definition discretization/fvgridvariables.hh:33
typename VolumeVariables::PrimaryVariables PrimaryVariables
export primary variable type
Definition discretization/fvgridvariables.hh:42
std::shared_ptr< const GridGeometry > gridGeometry_
Definition discretization/fvgridvariables.hh:149
const GridVolumeVariables & curGridVolVars() const
return the current volume variables
Definition discretization/fvgridvariables.hh:128
void advanceTimeStep()
Sets the current state as the previous for next time step.
Definition discretization/fvgridvariables.hh:103
GVV GridVolumeVariables
export type of the finite volume grid geometry
Definition discretization/fvgridvariables.hh:36
GridFluxVariablesCache & gridFluxVarsCache()
return the flux variables cache
Definition discretization/fvgridvariables.hh:124
void init(const SolutionVector &curSol)
initialize all variables (stationary case)
Definition discretization/fvgridvariables.hh:61
const GridVolumeVariables & prevGridVolVars() const
return the volume variables of the previous time step (for instationary problems)
Definition discretization/fvgridvariables.hh:136
const GridGeometry & gridGeometry() const
Definition discretization/fvgridvariables.hh:144
GridVolumeVariables & prevGridVolVars()
return the volume variables of the previous time step (for instationary problems)
Definition discretization/fvgridvariables.hh:140
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition discretization/fvgridvariables.hh:39
GFVC GridFluxVariablesCache
export type of the finite volume grid geometry
Definition discretization/fvgridvariables.hh:48
void updateAfterGridAdaption(const SolutionVector &curSol)
update all variables after grid adaption
Definition discretization/fvgridvariables.hh:89
void resetTimeStep(const SolutionVector &solution)
resets state to the one before time integration
Definition discretization/fvgridvariables.hh:110
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry)
Definition discretization/fvgridvariables.hh:51
std::decay_t< decltype(std::declval< PrimaryVariables >()[0])> Scalar
export scalar type (TODO get it directly from the volvars)
Definition discretization/fvgridvariables.hh:45
void update(const SolutionVector &curSol, bool forceFluxCacheUpdate=false)
update all variables
Definition discretization/fvgridvariables.hh:78