47 const std::vector<Scalar>& pcEntry,
48 const std::vector<int>& throatLabel,
49 const int inletPoreLabel,
50 const int outletPoreLabel,
51 const bool allowDraingeOfOutlet =
false)
52 : gridView_(gridGeometry.gridView())
54 , throatLabel_(throatLabel)
55 , inletThroatLabel_(inletPoreLabel)
56 , outletThroatLabel_(outletPoreLabel)
57 , allowDraingeOfOutlet_(allowDraingeOfOutlet)
69 for (
const auto& element : elements(gridView_))
71 const auto eIdx = gridView_.indexSet().index(element);
74 if (elementIsInvaded[eIdx])
81 if (throatLabel_[eIdx] == inletThroatLabel_ && pcGlobal >= pcEntry_[eIdx])
91 for (
const auto& intersection : intersections(gridView_, element))
93 if (intersection.neighbor())
95 const auto& neighborElement = intersection.outside();
96 const auto nIdx = gridView_.indexSet().index(neighborElement);
97 if (elementIsInvaded[nIdx] && pcGlobal >= pcEntry_[eIdx] && (allowDraingeOfOutlet_ || throatLabel_[eIdx] != outletThroatLabel_))
110 elementIsInvaded[eIdx] =
true;
113 using Element =
typename GridView::template Codim<0>::Entity;
114 std::stack<Element> elementStack;
115 elementStack.push(element);
116 while (!elementStack.empty())
118 auto e = elementStack.top();
121 for (
const auto& intersection : intersections(gridView_, e))
123 if (intersection.neighbor())
125 const auto& neighborElement = intersection.outside();
126 const auto nIdx = gridView_.indexSet().index(neighborElement);
127 if (!elementIsInvaded[nIdx] && pcGlobal >= pcEntry_[nIdx] && (allowDraingeOfOutlet_ || throatLabel_[nIdx] != outletThroatLabel_))
129 ++numThroatsInvaded_;
130 elementIsInvaded[nIdx] =
true;
131 elementStack.push(neighborElement);