24#ifndef DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_ELEMENT_FLUXVARSCACHE_HH
25#define DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_ELEMENT_FLUXVARSCACHE_HH
41template<
class GFVC,
bool cachingEnabled>
59 : gridFluxVarsCachePtr_(&global) {}
66 template<
class FVElementGeometry,
class ElementVolumeVariables>
68 const FVElementGeometry& fvGeometry,
69 const ElementVolumeVariables& elemVolVars) &&
71 this->bind(element, fvGeometry, elemVolVars);
72 return std::move(*
this);
77 template<
class FVElementGeometry,
class ElementVolumeVariables>
78 void bind(
const typename FVElementGeometry::Element& element,
79 const FVElementGeometry& fvGeometry,
80 const ElementVolumeVariables& elemVolVars) &
82 bindElement(element, fvGeometry, elemVolVars);
90 template<
class FVElementGeometry,
class ElementVolumeVariables>
92 const FVElementGeometry& fvGeometry,
93 const ElementVolumeVariables& elemVolVars) &&
95 this->bindElement(element, fvGeometry, elemVolVars);
96 return std::move(*
this);
99 template<
class FVElementGeometry,
class ElementVolumeVariables>
100 void bindElement(
const typename FVElementGeometry::Element& element,
101 const FVElementGeometry& fvGeometry,
102 const ElementVolumeVariables& elemVolVars) &
104 eIdx_ = fvGeometry.gridGeometry().elementMapper().index(element);
112 template<
class FVElementGeometry,
class ElementVolumeVariables>
114 const FVElementGeometry& fvGeometry,
115 const ElementVolumeVariables& elemVolVars,
116 const typename FVElementGeometry::SubControlVolumeFace& scvf) &&
118 this->bindScvf(element, fvGeometry, elemVolVars, scvf);
119 return std::move(*
this);
122 template<
class FVElementGeometry,
class ElementVolumeVariables>
123 void bindScvf(
const typename FVElementGeometry::Element& element,
124 const FVElementGeometry& fvGeometry,
125 const ElementVolumeVariables& elemVolVars,
126 const typename FVElementGeometry::SubControlVolumeFace& scvf) &
128 bindElement(element, fvGeometry, elemVolVars);
132 template<
class SubControlVolumeFace>
134 {
return gridFluxVarsCache()[scvf]; }
138 {
return *gridFluxVarsCachePtr_; }
141 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
160 : gridFluxVarsCachePtr_(&global) {}
167 template<
class FVElementGeometry,
class ElementVolumeVariables>
169 const FVElementGeometry& fvGeometry,
170 const ElementVolumeVariables& elemVolVars) &&
172 this->bind(element, fvGeometry, elemVolVars);
173 return std::move(*
this);
178 template<
class FVElementGeometry,
class ElementVolumeVariables>
179 void bind(
const typename FVElementGeometry::Element& element,
180 const FVElementGeometry& fvGeometry,
181 const ElementVolumeVariables& elemVolVars) &
183 bindElement(element, fvGeometry, elemVolVars);
191 template<
class FVElementGeometry,
class ElementVolumeVariables>
193 const FVElementGeometry& fvGeometry,
194 const ElementVolumeVariables& elemVolVars) &&
196 this->bindElement(element, fvGeometry, elemVolVars);
197 return std::move(*
this);
200 template<
class FVElementGeometry,
class ElementVolumeVariables>
201 void bindElement(
const typename FVElementGeometry::Element& element,
202 const FVElementGeometry& fvGeometry,
203 const ElementVolumeVariables& elemVolVars) &
206 fluxVarsCache_.resize(fvGeometry.numScvf());
216 template<
class FVElementGeometry,
class ElementVolumeVariables>
218 const FVElementGeometry& fvGeometry,
219 const ElementVolumeVariables& elemVolVars,
220 const typename FVElementGeometry::SubControlVolumeFace& scvf) &&
222 this->bindScvf(element, fvGeometry, elemVolVars, scvf);
223 return std::move(*
this);
226 template<
class FVElementGeometry,
class ElementVolumeVariables>
227 void bindScvf(
const typename FVElementGeometry::Element& element,
228 const FVElementGeometry& fvGeometry,
229 const ElementVolumeVariables& elemVolVars,
230 const typename FVElementGeometry::SubControlVolumeFace& scvf) &
232 fluxVarsCache_.resize(fvGeometry.numScvf());
237 template<
class SubControlVolumeFace>
239 {
return fluxVarsCache_[scvf.index()]; }
242 template<
class SubControlVolumeFace>
244 {
return fluxVarsCache_[scvf.index()]; }
248 {
return *gridFluxVarsCachePtr_; }
251 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
252 std::vector<FluxVariablesCache> fluxVarsCache_;
The flux variables caches for an element.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:42
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:53
FaceCenteredStaggeredElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:58
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:56
void bindElement(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:100
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:137
FaceCenteredStaggeredElementFluxVariablesCache bind(const typename FVElementGeometry::Element &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/facecentered/staggered/elementfluxvariablescache.hh:67
void bind(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:78
FaceCenteredStaggeredElementFluxVariablesCache bindElement(const typename FVElementGeometry::Element &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/facecentered/staggered/elementfluxvariablescache.hh:91
FaceCenteredStaggeredElementFluxVariablesCache bindScvf(const typename FVElementGeometry::Element &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/facecentered/staggered/elementfluxvariablescache.hh:113
void bindScvf(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:123
FaceCenteredStaggeredElementFluxVariablesCache bindScvf(const typename FVElementGeometry::Element &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/facecentered/staggered/elementfluxvariablescache.hh:217
FaceCenteredStaggeredElementFluxVariablesCache bind(const typename FVElementGeometry::Element &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/facecentered/staggered/elementfluxvariablescache.hh:168
void bindScvf(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:227
void bindElement(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:201
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:247
FaceCenteredStaggeredElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:159
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:154
void bind(const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars) &
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:179
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: discretization/facecentered/staggered/elementfluxvariablescache.hh:157
FaceCenteredStaggeredElementFluxVariablesCache bindElement(const typename FVElementGeometry::Element &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/facecentered/staggered/elementfluxvariablescache.hh:192