134class gsOverlapCompare : public gsHBoxCheck<d,T>
143 gsOverlapCompare(const gsHBoxContainer<d,T> & markedRef, index_t m) //, patchHContainer & markedCrs
147 gsHBoxContainer<d,T> tmp(markedRef);
148 m_markedRefChildren = gsHBoxUtils<d,T>::Unique(tmp.getChildren());
151 bool check(const gsHBox<d,T> & box) const
153 // We are going to check if the coarsening extension (closely related to the coarsening neighborhood) of the parent of \a box (since it will be elevated) fulfills the conditions of an empty coarsening neighborhood, as well as the condition of an empty coasening neighborhood provided that there is no element that will be refined herein.
156 // if (m_m>=2) // admissiblity part
158 // 1) Check if the coarsening neighborhood is empty
159 gsHBox<d,T> parent = box.getParent();
160 typename gsHBox<d,T>::Container Cextension = parent.getCextension(m_m);
161 Cextension = gsHBoxUtils<d,T>::Unique(Cextension);
163 for (typename gsHBox<d,T>::Iterator it = Cextension.begin(); it != Cextension.end() && clean; it++)
167 // the level is even larger (i.e. even higher decendant); then it is not clean
168 (!((it->levelInCenter()>=it->level()))
173 if (!clean) return clean;
176 // 2) Now we check if the parents of any of the cells in the extensions overlap with the marked cells. If so, it would cause a problem with the coarsening.
177 typename gsHBox<d,T>::Container intersection = gsHBoxUtils<d,T>::ContainedIntersection(Cextension,m_markedRefChildren);
178 clean = intersection.size()==0;
183 typename gsHBox<d,T>::Container m_markedRefChildren;