12#ifndef DUMUX_DISCRETIZATION_MPFA_O_INTERACTIONVOLUME_INDEXSET_HH 
   13#define DUMUX_DISCRETIZATION_MPFA_O_INTERACTIONVOLUME_INDEXSET_HH 
   15#include <dune/common/reservedvector.hh> 
   27template< 
class DualGr
idNodalIndexSet >
 
   47    template< 
class FlipScvfIndexSet >
 
   54        nodeToIvScvf_.resize(numNodalScvfs);
 
   55        std::vector<bool> isHandled(numNodalScvfs, 
false);
 
   69                scvfNeighborScvLocalIndices_.push_back({
nodalIndexSet.insideScvLocalIndex(i)});
 
   70                nodeToIvScvf_[i] = ivToNodeScvf_.size();
 
   72                ivToNodeScvf_.push_back(i);
 
   78            const auto curIvLocalScvfIdx = ivToNodeScvf_.size();
 
   79            nodeToIvScvf_[i] = curIvLocalScvfIdx;
 
   83            const auto& flipScvfIndices = flipScvfIndexSet[
nodalIndexSet.gridScvfIndex(i)];
 
   84            const auto numFlipIndices = flipScvfIndices.size();
 
   87            neighborsLocal.resize(numFlipIndices + 1);
 
   91            for (
unsigned int j = 0; j < numFlipIndices; ++j)
 
   93                const auto outsideScvfIdx = flipScvfIndices[j];
 
   94                for (
unsigned int nodeLocalIdx = 0; nodeLocalIdx < 
nodalIndexSet.numScvfs(); ++nodeLocalIdx)
 
   96                    if (
nodalIndexSet.gridScvfIndex(nodeLocalIdx) == outsideScvfIdx)
 
   98                        neighborsLocal[j+1] = 
nodalIndexSet.insideScvLocalIndex(nodeLocalIdx);
 
   99                        nodeToIvScvf_[nodeLocalIdx] = curIvLocalScvfIdx;
 
  100                        isHandled[nodeLocalIdx] = 
true;
 
  106            scvfNeighborScvLocalIndices_.push_back(neighborsLocal);
 
  107            ivToNodeScvf_.push_back(i);
 
 
  114    { 
return nodalIndexSet_; }
 
 
  118    { 
return nodalIndexSet_.gridScvIndices(); }
 
 
  122    { 
return nodalIndexSet_.gridScvfIndices(); }
 
 
  126    { 
return numFaces_; }
 
 
  130    { 
return nodalIndexSet_.numScvs(); }
 
 
  135        assert(ivLocalScvIdx < 
numScvs());
 
 
  142        assert(ivLocalScvfIdx < 
numFaces());
 
  143        return nodalIndexSet_.gridScvfIndex( ivToNodeScvf_[ivLocalScvfIdx] );
 
 
  149        assert(nodalIndexSet_.localScvfIndex(scvIdxLocal, i) < nodeToIvScvf_.size());
 
  150        return nodeToIvScvf_[ nodalIndexSet_.localScvfIndex(scvIdxLocal, i) ];
 
 
  156        assert(ivLocalScvfIdx < 
numFaces());
 
  157        return scvfNeighborScvLocalIndices_[ivLocalScvfIdx];
 
 
  163    std::size_t numFaces_;
 
  164    const NI& nodalIndexSet_;
 
  168    typename NI::Traits::template NodalScvfDataStorage< LocalIndexType > ivToNodeScvf_;
 
  169    typename NI::Traits::template NodalScvfDataStorage< LocalIndexType > nodeToIvScvf_;
 
  172    typename NI::Traits::template NodalScvfDataStorage< ScvfNeighborLocalIndexSet > scvfNeighborScvLocalIndices_;
 
 
const NodalGridStencilType & gridScvIndices() const
returns the global scv indices connected to this dual grid node
Definition interactionvolumeindexset.hh:117
GridIndexType gridScvfIndex(LocalIndexType ivLocalScvfIdx) const
returns a grid scvf idx for a given iv-local scvf index
Definition interactionvolumeindexset.hh:140
CCMpfaOInteractionVolumeIndexSet(const NodalIndexSet &nodalIndexSet, const FlipScvfIndexSet &flipScvfIndexSet)
The constructor.
Definition interactionvolumeindexset.hh:48
const NodalGridScvfStencilType & gridScvfIndices() const
returns the global scvf indices embedded in this interaction volume
Definition interactionvolumeindexset.hh:121
const ScvfNeighborLocalIndexSet & neighboringLocalScvIndices(LocalIndexType ivLocalScvfIdx) const
returns the local indices of the neighboring scvs of an scvf
Definition interactionvolumeindexset.hh:154
typename NodalIndexSet::LocalIndexType LocalIndexType
Definition interactionvolumeindexset.hh:35
typename NodalIndexSet::NodalGridStencilType NodalGridStencilType
Definition interactionvolumeindexset.hh:39
GridIndexType gridScvIndex(LocalIndexType ivLocalScvIdx) const
returns a grid scv idx for a given iv-local scv index
Definition interactionvolumeindexset.hh:133
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:147
typename NodalIndexSet::NodalLocalStencilType NodalLocalStencilType
Definition interactionvolumeindexset.hh:40
typename NodalIndexSet::NodalGridScvfStencilType NodalGridScvfStencilType
Definition interactionvolumeindexset.hh:41
std::size_t numFaces() const
returns the number of faces in the interaction volume
Definition interactionvolumeindexset.hh:125
NodalIndexSet NodalIndexSet
Definition interactionvolumeindexset.hh:32
typename NodalIndexSet::ScvfNeighborLocalIndexSet ScvfNeighborLocalIndexSet
Definition interactionvolumeindexset.hh:44
typename NodalIndexSet::GridIndexType GridIndexType
Definition interactionvolumeindexset.hh:36
const NodalIndexSet & nodalIndexSet() const
Definition interactionvolumeindexset.hh:113
std::size_t numScvs() const
returns the number of scvs in the interaction volume
Definition interactionvolumeindexset.hh:129
Class for the index sets of the dual grid in mpfa schemes.