24#ifndef DUMUX_DISCRETIZATION_BOX_ELEMENT_FLUXVARSCACHE_HH
25#define DUMUX_DISCRETIZATION_BOX_ELEMENT_FLUXVARSCACHE_HH
40template<
class GFVC,
bool cachingEnabled>
59 : gridFluxVarsCachePtr_(&global) {}
63 template<
class FVElementGeometry,
class ElementVolumeVariables>
64 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
65 const FVElementGeometry& fvGeometry,
66 const ElementVolumeVariables& elemVolVars)
68 bindElement(element, fvGeometry, elemVolVars);
71 template<
class FVElementGeometry,
class ElementVolumeVariables>
72 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
73 const FVElementGeometry& fvGeometry,
74 const ElementVolumeVariables& elemVolVars)
76 eIdx_ = fvGeometry.gridGeometry().elementMapper().index(element);
79 template<
class FVElementGeometry,
class ElementVolumeVariables>
80 void bindScvf(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
81 const FVElementGeometry& fvGeometry,
82 const ElementVolumeVariables& elemVolVars,
83 const typename FVElementGeometry::SubControlVolumeFace& scvf)
85 bindElement(element, fvGeometry, elemVolVars);
89 template<
class SubControlVolumeFace>
91 {
return gridFluxVarsCache().cache(eIdx_, scvf.index()); }
95 {
return *gridFluxVarsCachePtr_; }
98 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
117 : gridFluxVarsCachePtr_(&global) {}
121 template<
class FVElementGeometry,
class ElementVolumeVariables>
122 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
123 const FVElementGeometry& fvGeometry,
124 const ElementVolumeVariables& elemVolVars)
126 bindElement(element, fvGeometry, elemVolVars);
129 template<
class FVElementGeometry,
class ElementVolumeVariables>
130 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
131 const FVElementGeometry& fvGeometry,
132 const ElementVolumeVariables& elemVolVars)
135 fluxVarsCache_.resize(fvGeometry.numScvf());
136 for (
auto&& scvf : scvfs(fvGeometry))
137 (*this)[scvf].update(gridFluxVarsCache().problem(), element, fvGeometry, elemVolVars, scvf);
140 template<
class FVElementGeometry,
class ElementVolumeVariables>
141 void bindScvf(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
142 const FVElementGeometry& fvGeometry,
143 const ElementVolumeVariables& elemVolVars,
144 const typename FVElementGeometry::SubControlVolumeFace& scvf)
146 fluxVarsCache_.resize(fvGeometry.numScvf());
147 (*this)[scvf].update(gridFluxVarsCache().problem(), element, fvGeometry, elemVolVars, scvf);
151 template<
class SubControlVolumeFace>
153 {
return fluxVarsCache_[scvf.index()]; }
156 template<
class SubControlVolumeFace>
158 {
return fluxVarsCache_[scvf.index()]; }
162 {
return *gridFluxVarsCachePtr_; }
165 const GridFluxVariablesCache* gridFluxVarsCachePtr_;
166 std::vector<FluxVariablesCache> fluxVarsCache_;
The flux variables caches for an element.
Definition: box/elementfluxvariablescache.hh:42
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Definition: box/elementfluxvariablescache.hh:72
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: box/elementfluxvariablescache.hh:56
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Definition: box/elementfluxvariablescache.hh:64
BoxElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: box/elementfluxvariablescache.hh:58
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: box/elementfluxvariablescache.hh:53
void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf)
Definition: box/elementfluxvariablescache.hh:80
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: box/elementfluxvariablescache.hh:94
const GridFluxVariablesCache & gridFluxVarsCache() const
The global object we are a restriction of.
Definition: box/elementfluxvariablescache.hh:161
void bindScvf(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf)
Definition: box/elementfluxvariablescache.hh:141
BoxElementFluxVariablesCache(const GridFluxVariablesCache &global)
Definition: box/elementfluxvariablescache.hh:116
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Definition: box/elementfluxvariablescache.hh:130
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars)
Definition: box/elementfluxvariablescache.hh:122
GFVC GridFluxVariablesCache
export the type of the grid flux variables cache
Definition: box/elementfluxvariablescache.hh:111
typename GFVC::FluxVariablesCache FluxVariablesCache
export the type of the flux variables cache
Definition: box/elementfluxvariablescache.hh:114