14#ifndef DUMUX_EXPERIMENTAL_FV_GRID_VARIABLES_HH
15#define DUMUX_EXPERIMENTAL_FV_GRID_VARIABLES_HH
35 using GridGeometry =
typename GV::GridGeometry;
36 using FVElementGeometry =
typename GridGeometry::LocalView;
38 using GridView =
typename GridGeometry::GridView;
39 using Element =
typename GridView::template Codim<0>::Entity;
41 using ElementVolumeVariables =
typename GV::GridVolumeVariables::LocalView;
42 using ElementFluxVariablesCache =
typename GV::GridFluxVariablesCache::LocalView;
60 void bind(
const Element& element,
61 const FVElementGeometry& fvGeometry)
64 elemVolVars_.bind(element, fvGeometry, x);
65 elemFluxVarsCache_.bind(element, fvGeometry, elemVolVars_);
74 const FVElementGeometry& fvGeometry)
76 elemVolVars_.bind(element, fvGeometry,
gridVariables().dofs());
83 const ElementVolumeVariables&
elemVolVars()
const {
return elemVolVars_; }
84 ElementVolumeVariables&
elemVolVars() {
return elemVolVars_; }
92 {
return *gridVariables_; }
96 ElementVolumeVariables elemVolVars_;
97 ElementFluxVariablesCache elemFluxVarsCache_;
114template<
class GVV,
class GFVC,
class X>
118 using Problem =
typename GVV::Problem;
155 : ParentType([problem] (auto& x) { problem->applyInitialSolution(x); })
157 , gridVolVars_(*problem)
158 , gridFluxVarsCache_(*problem)
170 template<
class SolOrInitializer>
173 SolOrInitializer&& solOrInitializer,
175 : ParentType(std::forward<SolOrInitializer>(solOrInitializer),
timeLevel)
177 , gridVolVars_(*problem)
178 , gridFluxVarsCache_(*problem)
181 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, this->
dofs(),
true);
193 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, curSol);
205 gridFluxVarsCache_.update(this->
gridGeometry(), gridVolVars_, curSol,
true);
210 {
return gridFluxVarsCache_; }
214 {
return gridFluxVarsCache_; }
218 {
return gridVolVars_; }
222 {
return gridVolVars_; }
226 {
return *gridGeometry_; }
229 std::shared_ptr<const GridGeometry> gridGeometry_;
GG GridGeometry
export type of the finite volume grid geometry
Definition experimental/discretization/fvgridvariables.hh:128
void update(const SolutionVector &curSol)
Update all variables that may be affected by a change in solution.
Definition experimental/discretization/fvgridvariables.hh:185
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition experimental/discretization/fvgridvariables.hh:134
GridFluxVariablesCache & gridFluxVarsCache()
return the flux variables cache
Definition experimental/discretization/fvgridvariables.hh:213
GFVC GridFluxVariablesCache
export cache type for flux variables
Definition experimental/discretization/fvgridvariables.hh:140
void forceUpdateAll(const SolutionVector &curSol)
Force the update of all variables.
Definition experimental/discretization/fvgridvariables.hh:197
GVV GridVolumeVariables
export type of the grid volume variables
Definition experimental/discretization/fvgridvariables.hh:131
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry)
Constructor.
Definition experimental/discretization/fvgridvariables.hh:153
FVGridVariables(std::shared_ptr< Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, SolOrInitializer &&solOrInitializer, const typename ParentType::TimeLevel &timeLevel=typename ParentType::TimeLevel{0.0})
Constructor with custom initialization of the solution.
Definition experimental/discretization/fvgridvariables.hh:171
FVGridVariablesLocalView< ThisType > LocalView
export the local view on this class
Definition experimental/discretization/fvgridvariables.hh:143
GridVolumeVariables & gridVolVars()
return the current volume variables
Definition experimental/discretization/fvgridvariables.hh:221
const GridFluxVariablesCache & gridFluxVarsCache() const
return the flux variables cache
Definition experimental/discretization/fvgridvariables.hh:209
const GridVolumeVariables & gridVolVars() const
return the current volume variables
Definition experimental/discretization/fvgridvariables.hh:217
typename VolumeVariables::PrimaryVariables PrimaryVariables
export primary variable type
Definition experimental/discretization/fvgridvariables.hh:137
X SolutionVector
export the type of solution vector
Definition experimental/common/variables.hh:54
const GridGeometry & gridGeometry() const
Return a reference to the grid geometry.
Definition experimental/discretization/fvgridvariables.hh:225
Finite volume-specific local view on grid variables.
Definition experimental/discretization/fvgridvariables.hh:34
GV GridVariables
export corresponding grid-wide class
Definition experimental/discretization/fvgridvariables.hh:46
ElementVolumeVariables & elemVolVars()
Definition experimental/discretization/fvgridvariables.hh:84
FVGridVariablesLocalView(const GridVariables &gridVariables)
Constructor.
Definition experimental/discretization/fvgridvariables.hh:49
const ElementVolumeVariables & elemVolVars() const
return reference to the elem vol vars
Definition experimental/discretization/fvgridvariables.hh:83
void bindElemVolVars(const Element &element, const FVElementGeometry &fvGeometry)
Bind only the volume variables local view to a grid element.
Definition experimental/discretization/fvgridvariables.hh:73
ElementFluxVariablesCache & elemFluxVarsCache()
Definition experimental/discretization/fvgridvariables.hh:88
const ElementFluxVariablesCache & elemFluxVarsCache() const
return reference to the flux variables cache
Definition experimental/discretization/fvgridvariables.hh:87
void bind(const Element &element, const FVElementGeometry &fvGeometry)
Bind this local view to a grid element.
Definition experimental/discretization/fvgridvariables.hh:60
const GridVariables & gridVariables() const
Definition experimental/discretization/fvgridvariables.hh:91
The grid variables class for general schemes, storing variables and data.
Definition discretization/gridvariables.hh:27
void update(const SolutionVector &x)
Update the state to a new solution.
Definition experimental/common/variables.hh:98
const SolutionVector & dofs() const
Return reference to the solution.
Definition experimental/common/variables.hh:92
Dumux::Experimental::TimeLevel< Scalar > TimeLevel
export the time representation
Definition experimental/common/variables.hh:60
const TimeLevel & timeLevel() const
Return the time level.
Definition experimental/common/variables.hh:88
Variables()
Default constructor.
Definition experimental/common/variables.hh:63
X SolutionVector
export the type of solution vector
Definition experimental/common/variables.hh:54
Type traits for problem classes.
Class that represents the variables of a model. We assume that models are formulated on the basis of ...
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition localview.hh:26
Free function to get the local view of a grid cache object.
Definition assembly/assembler.hh:44
Detail::ProblemGridGeometry< Problem > GridGeometry
Definition common/typetraits/problem.hh:50