35                       const std::vector<Scalar>& pcEntry,
 
   36                       const std::vector<int>& throatLabel,
 
   37                       const int inletPoreLabel,
 
   38                       const int outletPoreLabel,
 
   39                       const bool allowDraingeOfOutlet = 
false)
 
   40    : gridView_(gridGeometry.gridView())
 
   42    , throatLabel_(throatLabel)
 
   43    , inletThroatLabel_(inletPoreLabel)
 
   44    , outletThroatLabel_(outletPoreLabel)
 
   45    , allowDraingeOfOutlet_(allowDraingeOfOutlet)
 
 
   57        for (
const auto& element : elements(gridView_))
 
   59            const auto eIdx = gridView_.indexSet().index(element);
 
   62            if (elementIsInvaded[eIdx])
 
   69            if (throatLabel_[eIdx] == inletThroatLabel_  && pcGlobal >= pcEntry_[eIdx])
 
   79                for (
const auto& intersection : intersections(gridView_, element))
 
   81                    if (intersection.neighbor())
 
   83                        const auto& neighborElement = intersection.outside();
 
   84                        const auto nIdx = gridView_.indexSet().index(neighborElement);
 
   85                        if (elementIsInvaded[nIdx] && pcGlobal >= pcEntry_[eIdx] && (allowDraingeOfOutlet_ || throatLabel_[eIdx] != outletThroatLabel_))
 
   98                elementIsInvaded[eIdx] = 
true;
 
  101                using Element = 
typename GridView::template Codim<0>::Entity;
 
  102                std::stack<Element> elementStack;
 
  103                elementStack.push(element);
 
  104                while (!elementStack.empty())
 
  106                    auto e = elementStack.top();
 
  109                    for (
const auto& intersection : intersections(gridView_, e))
 
  111                        if (intersection.neighbor())
 
  113                            const auto& neighborElement = intersection.outside();
 
  114                            const auto nIdx = gridView_.indexSet().index(neighborElement);
 
  115                            if (!elementIsInvaded[nIdx] && pcGlobal >= pcEntry_[nIdx] && (allowDraingeOfOutlet_ || throatLabel_[nIdx] != outletThroatLabel_))
 
  117                                ++numThroatsInvaded_;
 
  118                                elementIsInvaded[nIdx] = 
true;
 
  119                                elementStack.push(neighborElement);