5#ifndef LISTOFORDEREDGRIDS_H
6#define LISTOFORDEREDGRIDS_H
35 IndexPlusi(IndexDimension I_,
unsigned long i_) : I(I_), i(i_) {}
40 bool operator==(IndexPlusi vergleich) {
41 if (I == vergleich.I)
return true;
42 if (i == vergleich.i)
return true;
64 Depth getT() {
return T; }
69 bool addPoint(IndexDimension &p,
unsigned long i);
71 bool isOccupied(IndexDimension &p,
unsigned long i);
92 IndexDimension getPoint() {
97 unsigned long geti() {
104 std::list<SubgridFixedDepth::IndexPlusi>::iterator it;
109 std::list<SubgridFixedDepth::IndexPlusi> listPoints;
124 void addPoint(IndexDimension &p,
unsigned long i);
142 int get_t() {
return t; };
152 std::list<SubgridFixedDepth>::iterator it;
157 bool isIncluded(Depth &T);
159 inline void sortDepths(
bool *Restrictions);
161 inline void SortiereTiefenBoundary(
bool *Restrictions);
165 iterator iter(*
this);
168 Depth Tlocal = iter.getSubgrid()->getT();
169 if (Tlocal == T)
return iter.getSubgrid();
170 }
while (iter.next());
172 cout <<
"error no subgrid of required depth" << endl;
173 return iter.getSubgrid();
177 std::list<Depth> *getSortierteTiefen() {
return &SortierteTiefen; }
180 std::vector<std::list<SubgridFixedDepth>> TiefeVector;
181 std::list<Depth> SortierteTiefen;
182 int MaximalDepth[DimensionSparseGrid];
184 inline void recursiveDepth(
bool *Restrictions,
bool checkProlongation,
int d, Depth *T);
186 inline void recursiveDepthBoundary(
bool *Restrictions,
bool checkProlongation,
int d, Depth *T);
188 void recursiveDepthCoarse(
int d, Depth *T);
193void ListOfDepthOrderedSubgrids::sortDepths(
bool *Restrictions) {
195 SortierteTiefen.clear();
197 recursiveDepth(Restrictions,
true, DimensionSparseGrid - 1, &T);
202inline void ListOfDepthOrderedSubgrids::SortiereTiefenBoundary(
bool *Restrictions) {
204 SortierteTiefen.clear();
206 recursiveDepthBoundary(Restrictions,
true, DimensionSparseGrid - 1, &T);
211inline void ListOfDepthOrderedSubgrids::recursiveDepth(
bool *Restrictions,
bool checkProlongation,
int d, Depth *T) {
212 if (checkProlongation && d > 0) {
213 if (!Restrictions[d]) {
214 for (
int t = 1; t <= MaximalDepth[d]; t++) {
216 recursiveDepth(Restrictions, checkProlongation, d - 1, T);
219 recursiveDepth(Restrictions, checkProlongation, d - 1, T);
223 if (checkProlongation && d == 0) {
224 if (!Restrictions[d]) {
225 for (
int t = 1; t <= MaximalDepth[d]; t++) {
227 recursiveDepth(Restrictions,
false, DimensionSparseGrid - 1, T);
230 recursiveDepth(Restrictions,
false, DimensionSparseGrid - 1, T);
234 if ((!checkProlongation) && d >= 0) {
235 if (Restrictions[d]) {
236 for (
int t = MaximalDepth[d]; t > 1; t--) {
238 recursiveDepth(Restrictions, checkProlongation, d - 1, T);
241 recursiveDepth(Restrictions, checkProlongation, d - 1, T);
245 if (d < 0 && isIncluded(*T)) {
246 SortierteTiefen.push_back(*T);
253ListOfDepthOrderedSubgrids::recursiveDepthBoundary(
bool *Restrictions,
bool checkProlongation,
int d, Depth *T) {
255 if (checkProlongation && d > 0) {
256 if (!Restrictions[d]) {
257 for (
int t = 0; t <= MaximalDepth[d]; t++) {
259 recursiveDepthBoundary(Restrictions, checkProlongation, d - 1, T);
262 recursiveDepthBoundary(Restrictions, checkProlongation, d - 1, T);
266 if (checkProlongation && d == 0) {
267 if (!Restrictions[d]) {
268 for (
int t = 0; t <= MaximalDepth[d]; t++) {
270 recursiveDepthBoundary(Restrictions,
false, DimensionSparseGrid - 1, T);
273 recursiveDepthBoundary(Restrictions,
false, DimensionSparseGrid - 1, T);
277 if ((!checkProlongation) && d >= 0) {
278 if (Restrictions[d]) {
279 for (
int t = MaximalDepth[d]; t >= 1; t--) {
281 recursiveDepthBoundary(Restrictions, checkProlongation, d - 1, T);
284 recursiveDepthBoundary(Restrictions, checkProlongation, d - 1, T);
288 if (d < 0 && isIncluded(*T)) {
289 SortierteTiefen.push_back(*T);
Definition sparseGrid.h:86
Definition ListOfDepthOrderedGrids.h:115
Definition ListOfDepthOrderedGrids.h:82
Definition ListOfDepthOrderedGrids.h:31
bool addPoint(IndexDimension &p, unsigned long i)
Definition ListOfDepthOrderedGrids.cc:32