24#ifndef DUMUX_DISCRETIZATION_BOX_ELEMENT_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_BOX_ELEMENT_VOLUMEVARIABLES_HH
40template<
class GVV,
bool cachingEnabled>
60 : gridVolVarsPtr_(&gridVolVars) {}
63 {
return gridVolVars().volVars(eIdx_, scvIdx); }
65 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
67 {
return gridVolVars().volVars(eIdx_, scv.indexInElement()); }
71 template<
class FVElementGeometry,
class SolutionVector>
72 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
73 const FVElementGeometry& fvGeometry,
74 const SolutionVector& sol)
76 bindElement(element, fvGeometry, sol);
80 template<
class FVElementGeometry,
class SolutionVector>
81 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
82 const FVElementGeometry& fvGeometry,
83 const SolutionVector& sol)
85 eIdx_ = fvGeometry.gridGeometry().elementMapper().index(element);
90 {
return *gridVolVarsPtr_; }
93 const GridVolumeVariables* gridVolVarsPtr_;
114 : gridVolVarsPtr_(&gridVolVars) {}
117 template<
class FVElementGeometry,
class SolutionVector>
118 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
119 const FVElementGeometry& fvGeometry,
120 const SolutionVector& sol)
122 bindElement(element, fvGeometry, sol);
126 template<
class FVElementGeometry,
class SolutionVector>
127 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
128 const FVElementGeometry& fvGeometry,
129 const SolutionVector& sol)
132 auto elemSol =
elementSolution(element, sol, fvGeometry.gridGeometry());
135 volumeVariables_.resize(fvGeometry.numScv());
136 for (
auto&& scv : scvs(fvGeometry))
137 volumeVariables_[scv.indexInElement()].update(elemSol, gridVolVars().problem(), element, scv);
141 {
return volumeVariables_[scvIdx]; }
144 {
return volumeVariables_[scvIdx]; }
146 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
148 {
return volumeVariables_[scv.indexInElement()]; }
150 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
152 {
return volumeVariables_[scv.indexInElement()]; }
156 {
return *gridVolVarsPtr_; }
159 const GridVolumeVariables* gridVolVarsPtr_;
160 std::vector<VolumeVariables> volumeVariables_;
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethod::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:115
The local (stencil) volume variables class for box models.
Definition: box/elementvolumevariables.hh:41
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol)
Definition: box/elementvolumevariables.hh:72
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition: box/elementvolumevariables.hh:56
GVV GridVolumeVariables
export type of the grid volume variables
Definition: box/elementvolumevariables.hh:53
const GridVolumeVariables & gridVolVars() const
The global volume variables object we are a restriction of.
Definition: box/elementvolumevariables.hh:89
BoxElementVolumeVariables(const GridVolumeVariables &gridVolVars)
Constructor.
Definition: box/elementvolumevariables.hh:59
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol)
Definition: box/elementvolumevariables.hh:81
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol)
Definition: box/elementvolumevariables.hh:118
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol)
Definition: box/elementvolumevariables.hh:127
BoxElementVolumeVariables(const GridVolumeVariables &gridVolVars)
Constructor.
Definition: box/elementvolumevariables.hh:113
GVV GridVolumeVariables
export type of the grid volume variables
Definition: box/elementvolumevariables.hh:107
const GridVolumeVariables & gridVolVars() const
The global volume variables object we are a restriction of.
Definition: box/elementvolumevariables.hh:155
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition: box/elementvolumevariables.hh:110
The local element solution class for the box method.