24#ifndef DUMUX_DISCRETIZATION_CC_GRID_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_CC_GRID_VOLUMEVARIABLES_HH
43template<
class Traits,
bool cachingEnabled = false>
60 static constexpr bool cachingEnabled =
true;
67 template<
class Gr
idGeometry,
class SolutionVector>
68 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol)
70 const auto numScv = gridGeometry.numScv();
71 volumeVariables_.resize(numScv);
73 for (
const auto& element : elements(gridGeometry.gridView()))
75 auto fvGeometry =
localView(gridGeometry);
76 fvGeometry.bindElement(element);
78 for (
auto&& scv : scvs(fvGeometry))
81 volumeVariables_[scv.dofIndex()].update(elemSol, problem(), element, scv);
87 {
return volumeVariables_[scvIdx]; }
90 {
return volumeVariables_[scvIdx]; }
92 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
94 {
return volumeVariables_[scv.dofIndex()]; }
96 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
98 {
return volumeVariables_[scv.dofIndex()]; }
102 {
return volumeVariables_[scvIdx]; }
106 {
return volumeVariables_[scvIdx]; }
110 {
return *problemPtr_; }
113 const Problem* problemPtr_;
114 std::vector<VolumeVariables> volumeVariables_;
119template<
class Traits>
132 static constexpr bool cachingEnabled =
false;
139 template<
class Gr
idGeometry,
class SolutionVector>
140 void update(
const GridGeometry& gridGeometry,
const SolutionVector& sol) {}
144 {
return *problemPtr_;}
147 const Problem* problemPtr_;
Free function to get the local view of a grid cache object.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
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
Base class for the grid volume variables.
Definition: cellcentered/gridvolumevariables.hh:44
specialization in case of storing the volume variables
Definition: cellcentered/gridvolumevariables.hh:49
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: cellcentered/gridvolumevariables.hh:68
VolumeVariables & volVars(const std::size_t scvIdx)
Definition: cellcentered/gridvolumevariables.hh:89
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: cellcentered/gridvolumevariables.hh:63
VolumeVariables & volVars(const SubControlVolume &scv)
Definition: cellcentered/gridvolumevariables.hh:97
const Problem & problem() const
The problem we are solving.
Definition: cellcentered/gridvolumevariables.hh:109
const VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx) const
Definition: cellcentered/gridvolumevariables.hh:101
const VolumeVariables & volVars(const std::size_t scvIdx) const
Definition: cellcentered/gridvolumevariables.hh:86
typename Traits::Problem Problem
export the problem type
Definition: cellcentered/gridvolumevariables.hh:54
const VolumeVariables & volVars(const SubControlVolume &scv) const
Definition: cellcentered/gridvolumevariables.hh:93
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: cellcentered/gridvolumevariables.hh:57
CCGridVolumeVariables(const Problem &problem)
Definition: cellcentered/gridvolumevariables.hh:65
VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx)
Definition: cellcentered/gridvolumevariables.hh:105
Specialization when the current volume variables are not stored globally.
Definition: cellcentered/gridvolumevariables.hh:121
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition: cellcentered/gridvolumevariables.hh:129
CCGridVolumeVariables(const Problem &problem)
Definition: cellcentered/gridvolumevariables.hh:137
typename Traits::Problem Problem
export the problem type
Definition: cellcentered/gridvolumevariables.hh:126
const Problem & problem() const
The problem we are solving.
Definition: cellcentered/gridvolumevariables.hh:143
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition: cellcentered/gridvolumevariables.hh:140
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition: cellcentered/gridvolumevariables.hh:135
The local element solution class for cell-centered methods.