24#ifndef DUMUX_DISCRETIZATION_BOX_ELEMENT_FLUXVARSCACHE_HH
25#define DUMUX_DISCRETIZATION_BOX_ELEMENT_FLUXVARSCACHE_HH
41template<
class GFVC,
bool cachingEnabled>
60 : gridFluxVarsCachePtr_(&global) {}
64 template<
class FVElementGeometry,
class ElementVolumeVariables>
65 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
66 const FVElementGeometry& fvGeometry,
67 const ElementVolumeVariables& elemVolVars) &
68 { bindElement(element, fvGeometry, elemVolVars); }
75 template<
class FVElementGeometry,
class ElementVolumeVariables>
77 const FVElementGeometry& fvGeometry,
78 const ElementVolumeVariables& elemVolVars) &&
80 this->bind(element, fvGeometry, elemVolVars);
81 return std::move(*
this);
84 template<
class FVElementGeometry,
class ElementVolumeVariables>
85 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
86 const FVElementGeometry& fvGeometry,
87 const ElementVolumeVariables& elemVolVars) &
88 { eIdx_ = fvGeometry.gridGeometry().elementMapper().index(element); }
95 template<
class FVElementGeometry,
class ElementVolumeVariables>
97 const FVElementGeometry& fvGeometry,
98 const ElementVolumeVariables& elemVolVars) &&
100 this->bindElement(element, fvGeometry, elemVolVars);
101 return std::move(*
this);
104 template<
class FVElementGeometry,
class ElementVolumeVariables>
105 void bindScvf(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
106 const FVElementGeometry& fvGeometry,
107 const ElementVolumeVariables& elemVolVars,
108 const typename FVElementGeometry::SubControlVolumeFace& scvf) &
109 { bindElement(element, fvGeometry, elemVolVars); }
116 template<
class FVElementGeometry,
class ElementVolumeVariables>
118 const FVElementGeometry& fvGeometry,
119 const ElementVolumeVariables& elemVolVars,
120 const typename FVElementGeometry::SubControlVolumeFace& scvf) &&
122 this->bindScvf(element, fvGeometry, elemVolVars, scvf);
123 return std::move(*
this);
127 template<
class SubControlVolumeFace>
129 {
return gridFluxVarsCache().cache(eIdx_, scvf.index()); }
133 {
return *gridFluxVarsCachePtr_; }
136 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
155 : gridFluxVarsCachePtr_(&global) {}
159 template<
class FVElementGeometry,
class ElementVolumeVariables>
160 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
161 const FVElementGeometry& fvGeometry,
162 const ElementVolumeVariables& elemVolVars) &
164 bindElement(element, fvGeometry, elemVolVars);
172 template<
class FVElementGeometry,
class ElementVolumeVariables>
174 const FVElementGeometry& fvGeometry,
175 const ElementVolumeVariables& elemVolVars) &&
177 this->bind(element, fvGeometry, elemVolVars);
178 return std::move(*
this);
181 template<
class FVElementGeometry,
class ElementVolumeVariables>
182 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
183 const FVElementGeometry& fvGeometry,
184 const ElementVolumeVariables& elemVolVars) &
187 fluxVarsCache_.resize(fvGeometry.numScvf());
188 for (
auto&& scvf : scvfs(fvGeometry))
189 (*this)[scvf].update(gridFluxVarsCache().problem(), element, fvGeometry, elemVolVars, scvf);
197 template<
class FVElementGeometry,
class ElementVolumeVariables>
199 const FVElementGeometry& fvGeometry,
200 const ElementVolumeVariables& elemVolVars) &&
202 this->bindElement(element, fvGeometry, elemVolVars);
203 return std::move(*
this);
206 template<
class FVElementGeometry,
class ElementVolumeVariables>
207 void bindScvf(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
208 const FVElementGeometry& fvGeometry,
209 const ElementVolumeVariables& elemVolVars,
210 const typename FVElementGeometry::SubControlVolumeFace& scvf) &
212 fluxVarsCache_.resize(fvGeometry.numScvf());
213 (*this)[scvf].update(gridFluxVarsCache().problem(), element, fvGeometry, elemVolVars, scvf);
221 template<
class FVElementGeometry,
class ElementVolumeVariables>
223 const FVElementGeometry& fvGeometry,
224 const ElementVolumeVariables& elemVolVars,
225 const typename FVElementGeometry::SubControlVolumeFace& scvf) &&
227 this->bindScvf(element, fvGeometry, elemVolVars, scvf);
228 return std::move(*
this);
232 template<
class SubControlVolumeFace>
234 {
return fluxVarsCache_[scvf.index()]; }
237 template<
class SubControlVolumeFace>
239 {
return fluxVarsCache_[scvf.index()]; }
243 {
return *gridFluxVarsCachePtr_; }
246 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
247 std::vector<FluxVariablesCache> fluxVarsCache_;
The flux variables caches for an element.
Definition: discretization/box/elementfluxvariablescache.hh:43
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/box/elementfluxvariablescache.hh:85
void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &
Definition: discretization/box/elementfluxvariablescache.hh:105
BoxElementFluxVariablesCache bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/elementfluxvariablescache.hh:117
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: discretization/box/elementfluxvariablescache.hh:57
BoxElementFluxVariablesCache bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/elementfluxvariablescache.hh:96
BoxElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: discretization/box/elementfluxvariablescache.hh:59
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: discretization/box/elementfluxvariablescache.hh:54
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/box/elementfluxvariablescache.hh:65
BoxElementFluxVariablesCache bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/elementfluxvariablescache.hh:76
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: discretization/box/elementfluxvariablescache.hh:132
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: discretization/box/elementfluxvariablescache.hh:242
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/box/elementfluxvariablescache.hh:182
BoxElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: discretization/box/elementfluxvariablescache.hh:154
BoxElementFluxVariablesCache bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/elementfluxvariablescache.hh:173
BoxElementFluxVariablesCache bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/elementfluxvariablescache.hh:198
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: discretization/box/elementfluxvariablescache.hh:149
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: discretization/box/elementfluxvariablescache.hh:152
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/box/elementfluxvariablescache.hh:160
BoxElementFluxVariablesCache bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/elementfluxvariablescache.hh:222
void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &
Definition: discretization/box/elementfluxvariablescache.hh:207