12#ifndef DUMUX_DISCRETIZATION_CVFE_ELEMENT_INTERPOLATION_POINT_DATA_CACHE_HH
13#define DUMUX_DISCRETIZATION_CVFE_ELEMENT_INTERPOLATION_POINT_DATA_CACHE_HH
28template<
class InterpolationPo
intData>
32 template<
class Problem,
class ElementDiscretization,
class ElementVariables>
34 const typename ElementDiscretization::Element& element,
35 const ElementDiscretization& elemDisc,
36 const ElementVariables& elemVars)
39 if (scvfCache_.empty())
41 std::size_t numQps = 0;
42 for (
const auto& scvf : scvfs(elemDisc))
44 scvfCache_.reserve(numQps);
47 qpsOffset_.resize(elemDisc.numScvf());
48 std::size_t numQps = 0;
49 for (
const auto& scvf : scvfs(elemDisc))
51 qpsOffset_[scvf.index()] = numQps;
54 if (numQps == scvfCache_.size())
55 scvfCache_.emplace_back();
56 scvfCache_[numQps++].update(problem, element, elemDisc, elemVars, qpData.ipData());
59 scvfCache_.resize(numQps);
62 const InterpolationPointData&
scvfCache(std::size_t scvfIdx, std::size_t qpIdx)
const
63 {
return scvfCache_[qpsOffset_[scvfIdx] + qpIdx]; }
65 InterpolationPointData&
scvfCache(std::size_t scvfIdx, std::size_t qpIdx)
66 {
return scvfCache_[qpsOffset_[scvfIdx] + qpIdx]; }
69 std::vector<InterpolationPointData> scvfCache_;
70 std::vector<std::size_t> qpsOffset_;
78template<
class InterpolationPo
intData>
82 template<
class Problem,
class ElementDiscretization,
class ElementVariables>
84 const typename ElementDiscretization::Element& element,
85 const ElementDiscretization& elemDisc,
86 const ElementVariables& elemVars)
89 elementCache_.resize(std::ranges::size(elemQuadRule));
90 for (
const auto& qpData : elemQuadRule)
91 elementCache_[qpData.ipData().qpIndex()].update(problem, element, elemDisc, elemVars, qpData.ipData());
93 boundaryFaceCache_.resize(std::ranges::size(boundaryFaces(elemDisc)));
94 for (
const auto& boundaryFace : boundaryFaces(elemDisc))
96 auto& bfCache = boundaryFaceCache_[boundaryFace.index()];
98 bfCache.resize(std::ranges::size(quadRule));
99 for (
const auto& qpData : quadRule)
100 bfCache[qpData.ipData().qpIndex()].update(problem, element, elemDisc, elemVars, qpData.ipData());
105 {
return elementCache_[qpIdx]; }
108 {
return elementCache_[qpIdx]; }
111 {
return boundaryFaceCache_[bfIdx][qpIdx]; }
114 {
return boundaryFaceCache_[bfIdx][qpIdx]; }
117 std::vector<InterpolationPointData> elementCache_;
118 std::vector<std::vector<InterpolationPointData>> boundaryFaceCache_;
126template<
class InterpolationPo
intData>
130 template<
class Problem,
class ElementDiscretization,
class ElementVariables>
132 const typename ElementDiscretization::Element& element,
133 const ElementDiscretization& elemDisc,
134 const ElementVariables& elemVars)
136 scvfCache_.update(problem, element, elemDisc, elemVars);
137 elementAndBoundaryCache_.update(problem, element, elemDisc, elemVars);
140 const InterpolationPointData&
scvfCache(std::size_t scvfIdx, std::size_t qpIdx)
const
141 {
return scvfCache_.scvfCache(scvfIdx, qpIdx); }
143 InterpolationPointData&
scvfCache(std::size_t scvfIdx, std::size_t qpIdx)
144 {
return scvfCache_.scvfCache(scvfIdx, qpIdx); }
147 {
return elementAndBoundaryCache_.elementCache(qpIdx); }
150 {
return elementAndBoundaryCache_.elementCache(qpIdx); }
153 {
return elementAndBoundaryCache_.boundaryFaceCache(bfIdx, qpIdx); }
156 {
return elementAndBoundaryCache_.boundaryFaceCache(bfIdx, qpIdx); }
Interpolation point data at the quadrature points of an element and of its boundary faces.
Definition elementinterpolationpointdatacache.hh:80
InterpolationPointData & elementCache(std::size_t qpIdx)
Definition elementinterpolationpointdatacache.hh:107
const InterpolationPointData & elementCache(std::size_t qpIdx) const
Definition elementinterpolationpointdatacache.hh:104
InterpolationPointData & boundaryFaceCache(std::size_t bfIdx, std::size_t qpIdx)
Definition elementinterpolationpointdatacache.hh:113
void update(const Problem &problem, const typename ElementDiscretization::Element &element, const ElementDiscretization &elemDisc, const ElementVariables &elemVars)
Definition elementinterpolationpointdatacache.hh:83
const InterpolationPointData & boundaryFaceCache(std::size_t bfIdx, std::size_t qpIdx) const
Definition elementinterpolationpointdatacache.hh:110
Interpolation point data at the quadrature points of the sub-control volume faces,...
Definition elementinterpolationpointdatacache.hh:128
InterpolationPointData & elementCache(std::size_t qpIdx)
Definition elementinterpolationpointdatacache.hh:149
InterpolationPointData & boundaryFaceCache(std::size_t bfIdx, std::size_t qpIdx)
Definition elementinterpolationpointdatacache.hh:155
void update(const Problem &problem, const typename ElementDiscretization::Element &element, const ElementDiscretization &elemDisc, const ElementVariables &elemVars)
Definition elementinterpolationpointdatacache.hh:131
const InterpolationPointData & elementCache(std::size_t qpIdx) const
Definition elementinterpolationpointdatacache.hh:146
const InterpolationPointData & scvfCache(std::size_t scvfIdx, std::size_t qpIdx) const
Definition elementinterpolationpointdatacache.hh:140
InterpolationPointData & scvfCache(std::size_t scvfIdx, std::size_t qpIdx)
Definition elementinterpolationpointdatacache.hh:143
const InterpolationPointData & boundaryFaceCache(std::size_t bfIdx, std::size_t qpIdx) const
Definition elementinterpolationpointdatacache.hh:152
Interpolation point data at the quadrature points of the sub-control volume faces of an element.
Definition elementinterpolationpointdatacache.hh:30
InterpolationPointData & scvfCache(std::size_t scvfIdx, std::size_t qpIdx)
Definition elementinterpolationpointdatacache.hh:65
void update(const Problem &problem, const typename ElementDiscretization::Element &element, const ElementDiscretization &elemDisc, const ElementVariables &elemVars)
Definition elementinterpolationpointdatacache.hh:33
const InterpolationPointData & scvfCache(std::size_t scvfIdx, std::size_t qpIdx) const
Definition elementinterpolationpointdatacache.hh:62
auto quadratureRule(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolume &scv, QuadratureRules::MidpointQuadrature)
Midpoint quadrature for scv.
Definition quadraturerules.hh:160
Definition elementinterpolationpointdatacache.hh:21
Quadrature rules over sub-control volumes and sub-control volume faces.