24#ifndef DUMUX_DISCRETIZATION_CC_GRID_VOLUMEVARIABLES_HH
25#define DUMUX_DISCRETIZATION_CC_GRID_VOLUMEVARIABLES_HH
45template<
class Traits,
bool cachingEnabled = false>
69 template<
class Gr
idGeometry,
class SolutionVector>
72 volumeVariables_.resize(gridGeometry.numScv());
75 const auto element = gridGeometry.element(eIdx);
76 const auto fvGeometry =
localView(gridGeometry).bindElement(element);
77 for (
const auto& scv : scvs(fvGeometry))
80 volumeVariables_[scv.dofIndex()].update(elemSol,
problem, element, scv);
86 {
return volumeVariables_[scvIdx]; }
89 {
return volumeVariables_[scvIdx]; }
91 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
93 {
return volumeVariables_[scv.dofIndex()]; }
95 template<class SubControlVolume, typename std::enable_if_t<!std::is_integral<SubControlVolume>::value,
int> = 0>
97 {
return volumeVariables_[scv.dofIndex()]; }
101 {
return volumeVariables_[scvIdx]; }
105 {
return volumeVariables_[scvIdx]; }
109 {
return *problemPtr_; }
112 const Problem* problemPtr_;
113 std::vector<VolumeVariables> volumeVariables_;
118template<
class Traits>
138 template<
class Gr
idGeometry,
class SolutionVector>
143 {
return *problemPtr_;}
146 const Problem* problemPtr_;
Free function to get the local view of a grid cache object.
Parallel for loop (multithreading).
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==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
void parallelFor(const std::size_t count, const FunctorType &functor)
A parallel for loop (multithreading).
Definition parallel_for.hh:172
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition adapt.hh:29
Definition common/properties.hh:100
Base class for the grid volume variables.
Definition cellcentered/gridvolumevariables.hh:46
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition cellcentered/gridvolumevariables.hh:70
VolumeVariables & volVars(const std::size_t scvIdx)
Definition cellcentered/gridvolumevariables.hh:88
static constexpr bool cachingEnabled
make it possible to query if caching is enabled
Definition cellcentered/gridvolumevariables.hh:62
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition cellcentered/gridvolumevariables.hh:65
VolumeVariables & volVars(const SubControlVolume &scv)
Definition cellcentered/gridvolumevariables.hh:96
const Problem & problem() const
The problem we are solving.
Definition cellcentered/gridvolumevariables.hh:108
const VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx) const
Definition cellcentered/gridvolumevariables.hh:100
const VolumeVariables & volVars(const std::size_t scvIdx) const
Definition cellcentered/gridvolumevariables.hh:85
typename Traits::Problem Problem
export the problem type
Definition cellcentered/gridvolumevariables.hh:56
const VolumeVariables & volVars(const SubControlVolume &scv) const
Definition cellcentered/gridvolumevariables.hh:92
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition cellcentered/gridvolumevariables.hh:59
CCGridVolumeVariables(const Problem &problem)
Definition cellcentered/gridvolumevariables.hh:67
VolumeVariables & volVars(const std::size_t scvIdx, const std::size_t localIdx)
Definition cellcentered/gridvolumevariables.hh:104
typename Traits::VolumeVariables VolumeVariables
export the volume variables type
Definition cellcentered/gridvolumevariables.hh:128
CCGridVolumeVariables(const Problem &problem)
Definition cellcentered/gridvolumevariables.hh:136
typename Traits::Problem Problem
export the problem type
Definition cellcentered/gridvolumevariables.hh:125
const Problem & problem() const
The problem we are solving.
Definition cellcentered/gridvolumevariables.hh:142
void update(const GridGeometry &gridGeometry, const SolutionVector &sol)
Definition cellcentered/gridvolumevariables.hh:139
static constexpr bool cachingEnabled
make it possible to query if caching is enabled
Definition cellcentered/gridvolumevariables.hh:131
typename Traits::template LocalView< ThisType, cachingEnabled > LocalView
export the type of the local view
Definition cellcentered/gridvolumevariables.hh:134
The local element solution class for cell-centered methods.