24#ifndef DUMUX_DISCRETIZATION_MPFA_O_INTERACTIONVOLUME_INDEXSET_HH
25#define DUMUX_DISCRETIZATION_MPFA_O_INTERACTIONVOLUME_INDEXSET_HH
27#include <dune/common/reservedvector.hh>
39template<
class DualGr
idNodalIndexSet >
59 template<
class FlipScvfIndexSet >
66 nodeToIvScvf_.resize(numNodalScvfs);
67 std::vector<bool> isHandled(numNodalScvfs,
false);
81 scvfNeighborScvLocalIndices_.push_back({
nodalIndexSet.insideScvLocalIndex(i)});
82 nodeToIvScvf_[i] = ivToNodeScvf_.size();
84 ivToNodeScvf_.push_back(i);
90 const auto curIvLocalScvfIdx = ivToNodeScvf_.size();
91 nodeToIvScvf_[i] = curIvLocalScvfIdx;
95 const auto& flipScvfIndices = flipScvfIndexSet[
nodalIndexSet.gridScvfIndex(i)];
96 const auto numFlipIndices = flipScvfIndices.size();
99 neighborsLocal.resize(numFlipIndices + 1);
103 for (
unsigned int j = 0; j < numFlipIndices; ++j)
105 const auto outsideScvfIdx = flipScvfIndices[j];
106 for (
unsigned int nodeLocalIdx = 0; nodeLocalIdx <
nodalIndexSet.numScvfs(); ++nodeLocalIdx)
108 if (
nodalIndexSet.gridScvfIndex(nodeLocalIdx) == outsideScvfIdx)
110 neighborsLocal[j+1] =
nodalIndexSet.insideScvLocalIndex(nodeLocalIdx);
111 nodeToIvScvf_[nodeLocalIdx] = curIvLocalScvfIdx;
112 isHandled[nodeLocalIdx] =
true;
118 scvfNeighborScvLocalIndices_.push_back(neighborsLocal);
119 ivToNodeScvf_.push_back(i);
126 {
return nodalIndexSet_; }
130 {
return nodalIndexSet_.gridScvIndices(); }
134 {
return nodalIndexSet_.gridScvfIndices(); }
138 {
return numFaces_; }
142 {
return nodalIndexSet_.numScvs(); }
147 assert(ivLocalScvIdx <
numScvs());
154 assert(ivLocalScvfIdx <
numFaces());
155 return nodalIndexSet_.gridScvfIndex( ivToNodeScvf_[ivLocalScvfIdx] );
161 assert(nodalIndexSet_.localScvfIndex(scvIdxLocal, i) < nodeToIvScvf_.size());
162 return nodeToIvScvf_[ nodalIndexSet_.localScvfIndex(scvIdxLocal, i) ];
168 assert(ivLocalScvfIdx <
numFaces());
169 return scvfNeighborScvLocalIndices_[ivLocalScvfIdx];
175 std::size_t numFaces_;
176 const NI& nodalIndexSet_;
180 typename NI::Traits::template NodalScvfDataStorage< LocalIndexType > ivToNodeScvf_;
181 typename NI::Traits::template NodalScvfDataStorage< LocalIndexType > nodeToIvScvf_;
184 typename NI::Traits::template NodalScvfDataStorage< ScvfNeighborLocalIndexSet > scvfNeighborScvLocalIndices_;
Class for the index sets of the dual grid in mpfa schemes.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
The interaction volume index set class for the mpfa-o scheme.
Definition: interactionvolumeindexset.hh:41
const NodalGridStencilType & gridScvIndices() const
returns the global scv indices connected to this dual grid node
Definition: interactionvolumeindexset.hh:129
GridIndexType gridScvfIndex(LocalIndexType ivLocalScvfIdx) const
returns a grid scvf idx for a given iv-local scvf index
Definition: interactionvolumeindexset.hh:152
CCMpfaOInteractionVolumeIndexSet(const NodalIndexSet &nodalIndexSet, const FlipScvfIndexSet &flipScvfIndexSet)
The constructor.
Definition: interactionvolumeindexset.hh:60
const NodalGridScvfStencilType & gridScvfIndices() const
returns the global scvf indices embedded in this interaction volume
Definition: interactionvolumeindexset.hh:133
const ScvfNeighborLocalIndexSet & neighboringLocalScvIndices(LocalIndexType ivLocalScvfIdx) const
returns the local indices of the neighboring scvs of an scvf
Definition: interactionvolumeindexset.hh:166
typename DualGridNodalIndexSet::LocalIndexType LocalIndexType
Export the types used for local/grid indices.
Definition: interactionvolumeindexset.hh:47
typename DualGridNodalIndexSet::NodalGridStencilType NodalGridStencilType
Export the stencil types used.
Definition: interactionvolumeindexset.hh:51
GridIndexType gridScvIndex(LocalIndexType ivLocalScvIdx) const
returns a grid scv idx for a given iv-local scv index
Definition: interactionvolumeindexset.hh:145
LocalIndexType localScvfIndex(LocalIndexType scvIdxLocal, unsigned int i) const
returns the iv-local scvf idx of the i-th scvf embedded in a local scv
Definition: interactionvolumeindexset.hh:159
typename DualGridNodalIndexSet::NodalLocalStencilType NodalLocalStencilType
Definition: interactionvolumeindexset.hh:52
typename DualGridNodalIndexSet::NodalGridScvfStencilType NodalGridScvfStencilType
Definition: interactionvolumeindexset.hh:53
std::size_t numFaces() const
returns the number of faces in the interaction volume
Definition: interactionvolumeindexset.hh:137
DualGridNodalIndexSet NodalIndexSet
Export the type used for the nodal grid index sets.
Definition: interactionvolumeindexset.hh:44
typename DualGridNodalIndexSet::ScvfNeighborLocalIndexSet ScvfNeighborLocalIndexSet
Export the type used for the neighbor scv index sets of the scvfs.
Definition: interactionvolumeindexset.hh:56
typename DualGridNodalIndexSet::GridIndexType GridIndexType
Definition: interactionvolumeindexset.hh:48
const NodalIndexSet & nodalIndexSet() const
returns the corresponding nodal index set
Definition: interactionvolumeindexset.hh:125
std::size_t numScvs() const
returns the number of scvs in the interaction volume
Definition: interactionvolumeindexset.hh:141