24#ifndef DUMUX_DISCRETIZATION_CVFE_ELEMENT_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_CVFE_ELEMENT_VOLUMEVARIABLES_HH
42template<
class GVV,
bool cachingEnabled>
62 : gridVolVarsPtr_(&gridVolVars) {}
65 {
return gridVolVars().volVars(eIdx_, scvIdx); }
67 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
69 {
return gridVolVars().volVars(eIdx_, scv.indexInElement()); }
76 template<
class FVElementGeometry,
class SolutionVector>
78 const FVElementGeometry& fvGeometry,
79 const SolutionVector& sol) &&
81 this->bindElement(element, fvGeometry, sol);
82 return std::move(*
this);
87 template<
class FVElementGeometry,
class SolutionVector>
88 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
89 const FVElementGeometry& fvGeometry,
90 const SolutionVector& sol) &
92 bindElement(element, fvGeometry, sol);
100 template<
class FVElementGeometry,
class SolutionVector>
102 const FVElementGeometry& fvGeometry,
103 const SolutionVector& sol) &&
105 this->bindElement(element, fvGeometry, sol);
106 return std::move(*
this);
110 template<
class FVElementGeometry,
class SolutionVector>
111 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
112 const FVElementGeometry& fvGeometry,
113 const SolutionVector& sol) &
115 eIdx_ = fvGeometry.gridGeometry().elementMapper().index(element);
120 {
return *gridVolVarsPtr_; }
123 const GridVolumeVariables* gridVolVarsPtr_;
144 : gridVolVarsPtr_(&gridVolVars) {}
151 template<
class FVElementGeometry,
class SolutionVector>
153 const FVElementGeometry& fvGeometry,
154 const SolutionVector& sol) &&
156 this->bindElement(element, fvGeometry, sol);
157 return std::move(*
this);
161 template<
class FVElementGeometry,
class SolutionVector>
162 void bind(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
163 const FVElementGeometry& fvGeometry,
164 const SolutionVector& sol) &
166 bindElement(element, fvGeometry, sol);
174 template<
class FVElementGeometry,
class SolutionVector>
176 const FVElementGeometry& fvGeometry,
177 const SolutionVector& sol) &&
179 this->bindElement(element, fvGeometry, sol);
180 return std::move(*
this);
184 template<
class FVElementGeometry,
class SolutionVector>
185 void bindElement(
const typename FVElementGeometry::GridGeometry::GridView::template Codim<0>::Entity& element,
186 const FVElementGeometry& fvGeometry,
187 const SolutionVector& sol) &
190 auto elemSol =
elementSolution(element, sol, fvGeometry.gridGeometry());
193 volumeVariables_.resize(fvGeometry.numScv());
194 for (
auto&& scv : scvs(fvGeometry))
195 volumeVariables_[scv.indexInElement()].update(elemSol, gridVolVars().problem(), element, scv);
199 {
return volumeVariables_[scvIdx]; }
202 {
return volumeVariables_[scvIdx]; }
204 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
206 {
return volumeVariables_[scv.indexInElement()]; }
208 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
210 {
return volumeVariables_[scv.indexInElement()]; }
214 {
return *gridVolVarsPtr_; }
217 const GridVolumeVariables* gridVolVarsPtr_;
218 std::vector<VolumeVariables> volumeVariables_;
Element solution classes and factory functions.
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:118
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
The local (stencil) volume variables class for control-volume finite element.
Definition: cvfe/elementvolumevariables.hh:43
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &
Definition: cvfe/elementvolumevariables.hh:88
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &
Definition: cvfe/elementvolumevariables.hh:111
CVFEElementVolumeVariables(const GridVolumeVariables &gridVolVars)
Constructor.
Definition: cvfe/elementvolumevariables.hh:61
const GridVolumeVariables & gridVolVars() const
The global volume variables object we are a restriction of.
Definition: cvfe/elementvolumevariables.hh:119
CVFEElementVolumeVariables bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: cvfe/elementvolumevariables.hh:77
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition: cvfe/elementvolumevariables.hh:58
GVV GridVolumeVariables
export type of the grid volume variables
Definition: cvfe/elementvolumevariables.hh:55
CVFEElementVolumeVariables bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: cvfe/elementvolumevariables.hh:101
CVFEElementVolumeVariables bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: cvfe/elementvolumevariables.hh:152
GVV GridVolumeVariables
export type of the grid volume variables
Definition: cvfe/elementvolumevariables.hh:137
const GridVolumeVariables & gridVolVars() const
The global volume variables object we are a restriction of.
Definition: cvfe/elementvolumevariables.hh:213
void bind(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &
Definition: cvfe/elementvolumevariables.hh:162
typename GridVolumeVariables::VolumeVariables VolumeVariables
export type of the volume variables
Definition: cvfe/elementvolumevariables.hh:140
CVFEElementVolumeVariables(const GridVolumeVariables &gridVolVars)
Constructor.
Definition: cvfe/elementvolumevariables.hh:143
void bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &
Definition: cvfe/elementvolumevariables.hh:185
CVFEElementVolumeVariables bindElement(const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const SolutionVector &sol) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: cvfe/elementvolumevariables.hh:175