Skip to content
Snippets Groups Projects
Unverified Commit 712bcf80 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

Initialization is just like the loop itself

parent ecacdb56
Branches
Tags
1 merge request!150UGGrid: append to-be-visited sons at the end of the list
Pipeline #
......@@ -375,23 +375,7 @@ void Dune::UGGrid<dim>::getChildrenOfSubface(const typename Traits::template Cod
&& e.level() < maxl) {
typename UG_NS<dim>::Element* theElement = this->getRealImplementation(e).target_;
UG::INT Sons_of_Side = 0;
typename UG_NS<dim>::Element* SonList[UG_NS<dim>::MAX_SONS];
UG::INT SonSides[UG_NS<dim>::MAX_SONS];
int rv = Get_Sons_of_ElementSide(theElement,
elementSide,
&Sons_of_Side,
SonList, // the output elements
SonSides, // Output element side numbers
true, // Element sons are not precomputed
true); // ioflag: I have no idea what this is supposed to do
if (rv!=0)
DUNE_THROW(GridError, "Get_Sons_of_ElementSide returned with error value " << rv);
for (int i=0; i<Sons_of_Side; i++)
list.emplace_back(SonList[i],SonSides[i]);
list.emplace_back(theElement, elementSide);
}
......@@ -427,6 +411,9 @@ void Dune::UGGrid<dim>::getChildrenOfSubface(const typename Traits::template Cod
}
}
// Remove the element itself. We are only interested in the children.
list.pop_front();
// //////////////////////////////
// Extract result from stack
// //////////////////////////////
......
......@@ -697,26 +697,9 @@ void Dune::UGGridLeafIntersection<GridImp>::constructLeafSubfaces() {
else {
std::list<Face> list;
int levelNeighborSide = numberInNeighbor(center_, levelNeighbor);
UG::INT Sons_of_Side = 0;
typename UG_NS<dim>::Element* SonList[UG_NS<dim>::MAX_SONS];
UG::INT SonSides[UG_NS<dim>::MAX_SONS];
int rv = Get_Sons_of_ElementSide(levelNeighbor,
levelNeighborSide,
&Sons_of_Side,
SonList, // the output elements
SonSides, // Output element side numbers
true, // Element sons are not precomputed
false, // ioflag: Obsolete debugging flag
true);
if (rv!=0)
DUNE_THROW(GridError, "Get_Sons_of_ElementSide returned with error value " << rv);
for (int i=0; i<Sons_of_Side; i++)
list.emplace_back(SonList[i], SonSides[i]);
const int levelNeighborSide = numberInNeighbor(center_, levelNeighbor);
list.emplace_back(levelNeighbor, levelNeighborSide);
// //////////////////////////////////////////////////
// Get_Sons_of_ElementSide only computes direct sons. Therefore in order to get all
......@@ -753,6 +736,11 @@ void Dune::UGGridLeafIntersection<GridImp>::constructLeafSubfaces() {
}
// Remove the element itself.
// We are only interested in leaf elements and in this code branch
// the element we start with is never a leaf.
list.pop_front();
// //////////////////////////////
// Extract result from stack
// //////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment