26#ifndef DUMUX_EXPERIMENTAL_FV_GRID_VARIABLES_HH
27#define DUMUX_EXPERIMENTAL_FV_GRID_VARIABLES_HH
47 using GridGeometry =
typename GV::GridGeometry;
48 using FVElementGeometry =
typename GridGeometry::LocalView;
50 using GridView =
typename GridGeometry::GridView;
51 using Element =
typename GridView::template Codim<0>::Entity;
53 using ElementVolumeVariables =
typename GV::GridVolumeVariables::LocalView;
54 using ElementFluxVariablesCache =
typename GV::GridFluxVariablesCache::LocalView;
72 void bind(
const Element& element,
73 const FVElementGeometry& fvGeometry)
76 elemVolVars_.bind(element, fvGeometry, x);
77 elemFluxVarsCache_.bind(element, fvGeometry, elemVolVars_);
86 const FVElementGeometry& fvGeometry)
88 elemVolVars_.bind(element, fvGeometry,
gridVariables().dofs());
95 const ElementVolumeVariables&
elemVolVars()
const {
return elemVolVars_; }
96 ElementVolumeVariables&
elemVolVars() {
return elemVolVars_; }
104 {
return *gridVariables_; }
108 ElementVolumeVariables elemVolVars_;
109 ElementFluxVariablesCache elemFluxVarsCache_;
121template<
class GVV,
class GFVC,
class X>
123:
public GridVariables<typename ProblemTraits<typename GVV::Problem>::GridGeometry, X>
125 using Problem =
typename GVV::Problem;
163 , gridVolVars_(*problem)
164 , gridFluxVarsCache_(*problem)
175 template<
class SolOrInitializer>
178 SolOrInitializer&& solOrInitializer)
180 , gridVolVars_(*problem)
181 , gridFluxVarsCache_(*problem)
184 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, this->
dofs(),
true);
196 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, curSol);
208 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, curSol,
true);
213 {
return gridFluxVarsCache_; }
217 {
return gridFluxVarsCache_; }
221 {
return gridVolVars_; }
225 {
return gridVolVars_; }
Free function to get the local view of a grid cache object.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
Definition: variables.hh:33
std::decay_t< decltype(std::declval< Problem >().gridGeometry())> GridGeometry
Definition: common/typetraits/problem.hh:45
void update(const SolutionVector &x)
Update the state to a new solution.
Definition: variables.hh:110
const SolutionVector & dofs() const
Return reference to the solution.
Definition: variables.hh:104
X SolutionVector
export the type of solution vector
Definition: variables.hh:66
Finite volume-specific local view on grid variables.
Definition: experimental/discretization/fvgridvariables.hh:46
GV GridVariables
export corresponding grid-wide class
Definition: experimental/discretization/fvgridvariables.hh:58
ElementVolumeVariables & elemVolVars()
Definition: experimental/discretization/fvgridvariables.hh:96
FVGridVariablesLocalView(const GridVariables &gridVariables)
Constructor.
Definition: experimental/discretization/fvgridvariables.hh:61
const ElementVolumeVariables & elemVolVars() const
return reference to the elem vol vars
Definition: experimental/discretization/fvgridvariables.hh:95
void bindElemVolVars(const Element &element, const FVElementGeometry &fvGeometry)
Bind only the volume variables local view to a grid element.
Definition: experimental/discretization/fvgridvariables.hh:85
ElementFluxVariablesCache & elemFluxVarsCache()
Definition: experimental/discretization/fvgridvariables.hh:100
const ElementFluxVariablesCache & elemFluxVarsCache() const
return reference to the flux variables cache
Definition: experimental/discretization/fvgridvariables.hh:99
void bind(const Element &element, const FVElementGeometry &fvGeometry)
Bind this local view to a grid element.
Definition: experimental/discretization/fvgridvariables.hh:72
const GridVariables & gridVariables() const
Return reference to the grid variables.
Definition: experimental/discretization/fvgridvariables.hh:103
The grid variable class for finite volume schemes, storing variables on scv and scvf (volume and flux...
Definition: experimental/discretization/fvgridvariables.hh:124
GG GridGeometry
export type of the finite volume grid geometry
Definition: experimental/discretization/fvgridvariables.hh:135
void update(const SolutionVector &curSol)
Update all variables that may be affected by a change in solution.
Definition: experimental/discretization/fvgridvariables.hh:188
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition: experimental/discretization/fvgridvariables.hh:141
GridFluxVariablesCache & gridFluxVarsCache()
return the flux variables cache
Definition: experimental/discretization/fvgridvariables.hh:216
GFVC GridFluxVariablesCache
export cache type for flux variables
Definition: experimental/discretization/fvgridvariables.hh:147
void forceUpdateAll(const SolutionVector &curSol)
Force the update of all variables.
Definition: experimental/discretization/fvgridvariables.hh:200
GVV GridVolumeVariables
export type of the grid volume variables
Definition: experimental/discretization/fvgridvariables.hh:138
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry)
Constructor.
Definition: experimental/discretization/fvgridvariables.hh:160
GridVolumeVariables & gridVolVars()
return the current volume variables
Definition: experimental/discretization/fvgridvariables.hh:224
const GridFluxVariablesCache & gridFluxVarsCache() const
return the flux variables cache
Definition: experimental/discretization/fvgridvariables.hh:212
const GridVolumeVariables & gridVolVars() const
return the current volume variables
Definition: experimental/discretization/fvgridvariables.hh:220
typename VolumeVariables::PrimaryVariables PrimaryVariables
export primary variable type
Definition: experimental/discretization/fvgridvariables.hh:144
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, SolOrInitializer &&solOrInitializer)
Constructor with custom initialization of the solution.
Definition: experimental/discretization/fvgridvariables.hh:176
Base class for grid variables.
Definition: experimental/discretization/gridvariables.hh:45
const GridGeometry & gridGeometry() const
Return a reference to the grid geometry.
Definition: experimental/discretization/gridvariables.hh:64
Type traits for problem classes.
Base class for grid variables.