TTK
Loading...
Searching...
No Matches
MultiresTriangulation.cpp
Go to the documentation of this file.
2
5
7 decimation_ = 1;
8 decimationLevel_ = 0;
9 debugLevel_ = 0;
10 gridDimensions_[0] = gridDimensions_[1] = gridDimensions_[2] = -1;
11 triangulation_ = nullptr;
12 this->setDebugMsgPrefix("MultiresTriangulation");
13}
14
16
18 vertexPositions_.resize(vertexNumber_);
19 vertexCoords_.resize(vertexNumber_);
20
21 if(dimensionality_ == 1) {
22 vertexPositions_[0] = VertexPosition::LEFT_CORNER_1D;
23#ifdef TTK_ENABLE_OPENMP
24#pragma omp parallel for num_threads(threadNumber_)
25#endif // TTK_ENABLE_OPENMP
26 for(SimplexId i = 1; i < vertexNumber_ - 1; ++i) {
27 vertexPositions_[i] = VertexPosition::CENTER_1D;
28 }
29 vertexPositions_[vertexNumber_ - 1] = VertexPosition::RIGHT_CORNER_1D;
30
31 } else if(dimensionality_ == 2) {
32#ifdef TTK_ENABLE_OPENMP
33#pragma omp parallel for num_threads(threadNumber_)
34#endif // TTK_ENABLE_OPENMP
35 for(SimplexId i = 0; i < vertexNumber_; ++i) {
36 std::array<SimplexId, 3> p{};
37 vertexToPosition2d(i, p);
38
39 if(0 < p[0] and p[0] < nbvoxels_[Di_]) {
40 if(0 < p[1] and p[1] < nbvoxels_[Dj_])
41 vertexPositions_[i] = VertexPosition::CENTER_2D;
42 else if(p[1] == 0)
43 vertexPositions_[i] = VertexPosition::TOP_EDGE_2D; // ab
44 else
45 vertexPositions_[i] = VertexPosition::BOTTOM_EDGE_2D; // cd
46 } else if(p[0] == 0) {
47 if(0 < p[1] and p[1] < nbvoxels_[Dj_])
48 vertexPositions_[i] = VertexPosition::LEFT_EDGE_2D; // ac
49 else if(p[1] == 0)
50 vertexPositions_[i] = VertexPosition::TOP_LEFT_CORNER_2D; // a
51 else
52 vertexPositions_[i] = VertexPosition::BOTTOM_LEFT_CORNER_2D; // c
53 } else {
54 if(0 < p[1] and p[1] < nbvoxels_[Dj_])
55 vertexPositions_[i] = VertexPosition::RIGHT_EDGE_2D; // bd
56 else if(p[1] == 0)
57 vertexPositions_[i] = VertexPosition::TOP_RIGHT_CORNER_2D; // b
58 else
59 vertexPositions_[i] = VertexPosition::BOTTOM_RIGHT_CORNER_2D; // d
60 }
61 vertexCoords_[i] = p;
62 }
63
64 } else if(dimensionality_ == 3) {
65#ifdef TTK_ENABLE_OPENMP
66#pragma omp parallel for num_threads(threadNumber_)
67#endif // TTK_ENABLE_OPENMP
68 for(SimplexId i = 0; i < vertexNumber_; ++i) {
69 std::array<SimplexId, 3> p{};
70 vertexToPosition(i, p);
71
72 if(0 < p[0] and p[0] < nbvoxels_[0]) {
73 if(0 < p[1] and p[1] < nbvoxels_[1]) {
74 if(0 < p[2] and p[2] < nbvoxels_[2])
75 vertexPositions_[i] = VertexPosition::CENTER_3D;
76 else if(p[2] == 0)
77 vertexPositions_[i] = VertexPosition::FRONT_FACE_3D; // abcd
78 else
79 vertexPositions_[i] = VertexPosition::BACK_FACE_3D; // efgh
80 } else if(p[1] == 0) {
81 if(0 < p[2] and p[2] < nbvoxels_[2])
82 vertexPositions_[i] = VertexPosition::TOP_FACE_3D; // abef
83 else if(p[2] == 0)
84 vertexPositions_[i] = VertexPosition::TOP_FRONT_EDGE_3D; // ab
85 else
86 vertexPositions_[i] = VertexPosition::TOP_BACK_EDGE_3D; // ef
87 } else {
88 if(0 < p[2] and p[2] < nbvoxels_[2])
89 vertexPositions_[i] = VertexPosition::BOTTOM_FACE_3D; // cdgh
90 else if(p[2] == 0)
91 vertexPositions_[i] = VertexPosition::BOTTOM_FRONT_EDGE_3D; // cd
92 else
93 vertexPositions_[i] = VertexPosition::BOTTOM_BACK_EDGE_3D; // gh
94 }
95 } else if(p[0] == 0) {
96 if(0 < p[1] and p[1] < nbvoxels_[1]) {
97 if(0 < p[2] and p[2] < nbvoxels_[2])
98 vertexPositions_[i] = VertexPosition::LEFT_FACE_3D; // aceg
99 else if(p[2] == 0)
100 vertexPositions_[i] = VertexPosition::LEFT_FRONT_EDGE_3D; // ac
101 else
102 vertexPositions_[i] = VertexPosition::LEFT_BACK_EDGE_3D; // eg
103 } else if(p[1] == 0) {
104 if(0 < p[2] and p[2] < nbvoxels_[2])
105 vertexPositions_[i] = VertexPosition::TOP_LEFT_EDGE_3D; // ae
106 else if(p[2] == 0)
107 vertexPositions_[i] = VertexPosition::TOP_LEFT_FRONT_CORNER_3D; // a
108 else
109 vertexPositions_[i] = VertexPosition::TOP_LEFT_BACK_CORNER_3D; // e
110 } else {
111 if(0 < p[2] and p[2] < nbvoxels_[2])
112 vertexPositions_[i] = VertexPosition::BOTTOM_LEFT_EDGE_3D; // cg
113 else if(p[2] == 0)
114 vertexPositions_[i]
115 = VertexPosition::BOTTOM_LEFT_FRONT_CORNER_3D; // c
116 else
117 vertexPositions_[i]
118 = VertexPosition::BOTTOM_LEFT_BACK_CORNER_3D; // g
119 }
120 } else {
121 if(0 < p[1] and p[1] < nbvoxels_[1]) {
122 if(0 < p[2] and p[2] < nbvoxels_[2])
123 vertexPositions_[i] = VertexPosition::RIGHT_FACE_3D; // bdfh
124 else if(p[2] == 0)
125 vertexPositions_[i] = VertexPosition::RIGHT_FRONT_EDGE_3D; // bd
126 else
127 vertexPositions_[i] = VertexPosition::RIGHT_BACK_EDGE_3D; // fh
128 } else if(p[1] == 0) {
129 if(0 < p[2] and p[2] < nbvoxels_[2])
130 vertexPositions_[i] = VertexPosition::TOP_RIGHT_EDGE_3D; // bf
131 else if(p[2] == 0)
132 vertexPositions_[i]
133 = VertexPosition::TOP_RIGHT_FRONT_CORNER_3D; // b
134 else
135 vertexPositions_[i] = VertexPosition::TOP_RIGHT_BACK_CORNER_3D; // f
136 } else {
137 if(0 < p[2] and p[2] < nbvoxels_[2])
138 vertexPositions_[i] = VertexPosition::BOTTOM_RIGHT_EDGE_3D; // dh
139 else if(p[2] == 0)
140 vertexPositions_[i]
141 = VertexPosition::BOTTOM_RIGHT_FRONT_CORNER_3D; // d
142 else
143 vertexPositions_[i]
144 = VertexPosition::BOTTOM_RIGHT_BACK_CORNER_3D; // h
145 }
146 }
147 vertexCoords_[i] = p;
148 }
149 }
150 return 0;
151}
152
154 vertexShifts_.resize(vertexNumber_);
155
156 if(dimensionality_ == 3) {
157#ifdef TTK_ENABLE_OPENMP
158#pragma omp parallel for num_threads(threadNumber_)
159#endif // TTK_ENABLE_OPENMP
160 for(SimplexId i = 0; i < decimatedVertexNumber_; ++i) {
161 const auto v = localToGlobalVertexId(i);
162 const auto &p = this->vertexCoords_[v];
163 std::array<SimplexId, 3> shifts{decimation_, decimation_, decimation_};
164
165 if((nbvoxels_[0] % decimation_) and (p[0] + decimation_ > nbvoxels_[0])) {
166 shifts[0] = nbvoxels_[0] % decimation_;
167 }
168 if((nbvoxels_[1] % decimation_) and (p[1] + decimation_ > nbvoxels_[1])) {
169 shifts[1] = nbvoxels_[1] % decimation_;
170 }
171 if((nbvoxels_[2] % decimation_) and (p[2] + decimation_ > nbvoxels_[2])) {
172 shifts[2] = nbvoxels_[2] % decimation_;
173 }
174 this->vertexShifts_[v] = shifts;
175 }
176 } else if(dimensionality_ == 2) {
177#ifdef TTK_ENABLE_OPENMP
178#pragma omp parallel for num_threads(threadNumber_)
179#endif // TTK_ENABLE_OPENMP
180 for(SimplexId i = 0; i < decimatedVertexNumber_; ++i) {
181 const auto v = localToGlobalVertexId(i);
182 const auto &p = this->vertexCoords_[v];
183 std::array<SimplexId, 3> shifts{decimation_, decimation_, decimation_};
184
185 if((nbvoxels_[Di_] % decimation_)
186 and (p[0] + decimation_ > nbvoxels_[Di_])) {
187 shifts[0] = nbvoxels_[0] % decimation_;
188 }
189 if((nbvoxels_[Dj_] % decimation_)
190 and (p[1] + decimation_ > nbvoxels_[Dj_])) {
191 shifts[1] = nbvoxels_[1] % decimation_;
192 }
193 this->vertexShifts_[v] = shifts;
194 }
195 }
196
197 return 0;
198}
199
201 const SimplexId &vertexId,
202 const SimplexId &neighborId,
203 SimplexId &localNeighborId) const {
204
205#ifndef TTK_ENABLE_KAMIKAZE
206 // if(triangulation_->isEmptyCheck()) {
207 // return -1;
208 // }
209 // if(localNeighborId < 0
210 // or localNeighborId >= getInvertVertexNeighborNumber(vertexId))
211 // return -1;
212#endif
213
214 const auto &p = this->vertexCoords_[vertexId];
215
216 SimplexId shiftX = decimation_;
217 SimplexId shiftY = decimation_;
218 SimplexId shiftZ = decimation_;
219
220 if(dimensionality_ == 3) {
221 if((nbvoxels_[0] % decimation_) and (p[0] + decimation_ > nbvoxels_[0])) {
222 shiftX = nbvoxels_[0] % decimation_;
223 }
224 if((nbvoxels_[1] % decimation_) and (p[1] + decimation_ > nbvoxels_[1])) {
225 shiftY = nbvoxels_[1] % decimation_;
226 }
227 if((nbvoxels_[2] % decimation_) and (p[2] + decimation_ > nbvoxels_[2])) {
228 shiftZ = nbvoxels_[2] % decimation_;
229 }
230 } else if(dimensionality_ == 2) {
231 if((nbvoxels_[Di_] % decimation_)
232 and (p[0] + decimation_ > nbvoxels_[Di_])) {
233 shiftX = nbvoxels_[0] % decimation_;
234 }
235 if((nbvoxels_[Dj_] % decimation_)
236 and (p[1] + decimation_ > nbvoxels_[Dj_])) {
237 shiftY = nbvoxels_[1] % decimation_;
238 }
239 }
240
241 switch(vertexPositions_[vertexId]) {
242 case VertexPosition::CENTER_3D:
244 vertexId, neighborId, shiftX, shiftY, shiftZ); //
245 break;
246 case VertexPosition::FRONT_FACE_3D:
248 vertexId, neighborId, shiftX, shiftY, shiftZ); //
249 break;
250 case VertexPosition::BACK_FACE_3D:
252 vertexId, neighborId, shiftX, shiftY, shiftZ); //
253 break;
254 case VertexPosition::TOP_FACE_3D:
256 vertexId, neighborId, shiftX, shiftY, shiftZ); //
257 break;
258 case VertexPosition::TOP_FRONT_EDGE_3D:
260 vertexId, neighborId, shiftX, shiftY, shiftZ); //
261 break;
262 case VertexPosition::TOP_BACK_EDGE_3D:
264 vertexId, neighborId, shiftX, shiftY, shiftZ); //
265 break;
266 case VertexPosition::BOTTOM_FACE_3D:
268 vertexId, neighborId, shiftX, shiftY, shiftZ); //
269 break;
270 case VertexPosition::BOTTOM_FRONT_EDGE_3D: // cd
272 vertexId, neighborId, shiftX, shiftY, shiftZ); //
273 break;
274 case VertexPosition::BOTTOM_BACK_EDGE_3D: // gh
276 vertexId, neighborId, shiftX, shiftY, shiftZ); //
277 break;
278 case VertexPosition::LEFT_FACE_3D:
280 vertexId, neighborId, shiftX, shiftY, shiftZ); //
281 break;
282 case VertexPosition::LEFT_FRONT_EDGE_3D: // ac
284 vertexId, neighborId, shiftX, shiftY, shiftZ); //
285 break;
286 case VertexPosition::LEFT_BACK_EDGE_3D: // eg
288 vertexId, neighborId, shiftX, shiftY, shiftZ); //
289 break;
290 case VertexPosition::TOP_LEFT_EDGE_3D: // ae
292 vertexId, neighborId, shiftX, shiftY, shiftZ); //
293 break;
294 case VertexPosition::TOP_LEFT_FRONT_CORNER_3D: // a
296 vertexId, neighborId, shiftX, shiftY, shiftZ); // e
297 break;
298 case VertexPosition::TOP_LEFT_BACK_CORNER_3D: // e
300 vertexId, neighborId, shiftX, shiftY, shiftZ); // a
301 break;
302 case VertexPosition::BOTTOM_LEFT_EDGE_3D: // cg
304 vertexId, neighborId, shiftX, shiftY, shiftZ); //
305 break;
306 case VertexPosition::BOTTOM_LEFT_FRONT_CORNER_3D: // c
308 vertexId, neighborId, shiftX, shiftY, shiftZ); // g
309 break;
310 case VertexPosition::BOTTOM_LEFT_BACK_CORNER_3D: // g
312 vertexId, neighborId, shiftX, shiftY, shiftZ); // c
313 break;
314 case VertexPosition::RIGHT_FACE_3D:
316 vertexId, neighborId, shiftX, shiftY, shiftZ); //
317 break;
318 case VertexPosition::RIGHT_FRONT_EDGE_3D: // bd
320 vertexId, neighborId, shiftX, shiftY, shiftZ); //
321 break;
322 case VertexPosition::RIGHT_BACK_EDGE_3D: // fh
324 vertexId, neighborId, shiftX, shiftY, shiftZ); //
325 break;
326 case VertexPosition::TOP_RIGHT_EDGE_3D: // bf
328 vertexId, neighborId, shiftX, shiftY, shiftZ); //
329 break;
330 case VertexPosition::TOP_RIGHT_FRONT_CORNER_3D: // b
332 vertexId, neighborId, shiftX, shiftY, shiftZ); // f
333 break;
334 case VertexPosition::TOP_RIGHT_BACK_CORNER_3D: // f
336 vertexId, neighborId, shiftX, shiftY, shiftZ); // b
337 break;
338 case VertexPosition::BOTTOM_RIGHT_EDGE_3D: // dh
340 vertexId, neighborId, shiftX, shiftY, shiftZ); //
341 break;
342 case VertexPosition::BOTTOM_RIGHT_FRONT_CORNER_3D: // d
344 vertexId, neighborId, shiftX, shiftY, shiftZ); // h
345 break;
346 case VertexPosition::BOTTOM_RIGHT_BACK_CORNER_3D: // h
348 vertexId, neighborId, shiftX, shiftY, shiftZ); // d
349 break;
350 case VertexPosition::CENTER_2D:
352 vertexId, neighborId, shiftX, shiftY); // abcd
353 break;
354 case VertexPosition::TOP_EDGE_2D:
356 vertexId, neighborId, shiftX, shiftY); // ab
357 break;
358 case VertexPosition::BOTTOM_EDGE_2D:
360 vertexId, neighborId, shiftX, shiftY); // cd
361 break;
362 case VertexPosition::LEFT_EDGE_2D:
364 vertexId, neighborId, shiftX, shiftY); // ac
365 break;
366 case VertexPosition::TOP_LEFT_CORNER_2D: // a
368 = getInvertVertexNeighbor2dA(vertexId, neighborId, shiftX, shiftY); // a
369 break;
370 case VertexPosition::BOTTOM_LEFT_CORNER_2D: // c
372 = getInvertVertexNeighbor2dC(vertexId, neighborId, shiftX, shiftY); // c
373 break;
374 case VertexPosition::RIGHT_EDGE_2D:
376 vertexId, neighborId, shiftX, shiftY); // bd
377 break;
378 case VertexPosition::TOP_RIGHT_CORNER_2D: // b
380 = getInvertVertexNeighbor2dB(vertexId, neighborId, shiftX, shiftY); // b
381 break;
382 case VertexPosition::BOTTOM_RIGHT_CORNER_2D: // d
384 = getInvertVertexNeighbor2dD(vertexId, neighborId, shiftX, shiftY); // d
385 break;
386 case VertexPosition::CENTER_1D:
387 localNeighborId = localNeighborId == 0 ? vertexId + decimation_
388 : vertexId - decimation_;
389 break;
390 case VertexPosition::LEFT_CORNER_1D:
391 localNeighborId = vertexId + decimation_;
392 break;
393 case VertexPosition::RIGHT_CORNER_1D:
394 localNeighborId = vertexId - decimation_;
395 break;
396 default:
397 localNeighborId = -1;
398 break;
399 }
400
401 return 0;
402}
404 const int &localNeighborId,
405 SimplexId &neighborId) const {
406#ifndef TTK_ENABLE_KAMIKAZE
407 // if(triangulation_->isEmptyCheck()) {
408 // return -1;
409 // }
410 // if(localNeighborId < 0
411 // or localNeighborId >= getVertexNeighborNumber(vertexId))
412 // return -1;
413#endif
414
415 const auto &s = vertexShifts_[vertexId];
416
417 switch(vertexPositions_[vertexId]) {
418 case VertexPosition::CENTER_3D:
419 neighborId = getVertexNeighborABCDEFGH(
420 vertexId, localNeighborId, s[0], s[1], s[2]);
421 break;
422 case VertexPosition::FRONT_FACE_3D:
423 neighborId
424 = getVertexNeighborABDC(vertexId, localNeighborId, s[0], s[1], s[2]);
425 break;
426 case VertexPosition::BACK_FACE_3D:
427 neighborId
428 = getVertexNeighborEFHG(vertexId, localNeighborId, s[0], s[1], s[2]);
429 break;
430 case VertexPosition::TOP_FACE_3D:
431 neighborId
432 = getVertexNeighborAEFB(vertexId, localNeighborId, s[0], s[1], s[2]);
433 break;
434 case VertexPosition::BOTTOM_FACE_3D:
435 neighborId
436 = getVertexNeighborGHDC(vertexId, localNeighborId, s[0], s[1], s[2]);
437 break;
438 case VertexPosition::LEFT_FACE_3D:
439 neighborId
440 = getVertexNeighborAEGC(vertexId, localNeighborId, s[0], s[1], s[2]);
441 break;
442 case VertexPosition::RIGHT_FACE_3D:
443 neighborId
444 = getVertexNeighborBFHD(vertexId, localNeighborId, s[0], s[1], s[2]);
445 break;
446 case VertexPosition::TOP_FRONT_EDGE_3D: // ab
447 neighborId
448 = getVertexNeighborAB(vertexId, localNeighborId, s[0], s[1], s[2]);
449 break;
450 case VertexPosition::BOTTOM_FRONT_EDGE_3D: // cd
451 neighborId
452 = getVertexNeighborCD(vertexId, localNeighborId, s[0], s[1], s[2]);
453 break;
454 case VertexPosition::LEFT_FRONT_EDGE_3D: // ac
455 neighborId
456 = getVertexNeighborAC(vertexId, localNeighborId, s[0], s[1], s[2]);
457 break;
458 case VertexPosition::RIGHT_FRONT_EDGE_3D: // bd
459 neighborId
460 = getVertexNeighborBD(vertexId, localNeighborId, s[0], s[1], s[2]);
461 break;
462 case VertexPosition::TOP_BACK_EDGE_3D: // ef
463 neighborId
464 = getVertexNeighborEF(vertexId, localNeighborId, s[0], s[1], s[2]);
465 break;
466 case VertexPosition::BOTTOM_BACK_EDGE_3D: // gh
467 neighborId
468 = getVertexNeighborGH(vertexId, localNeighborId, s[0], s[1], s[2]);
469 break;
470 case VertexPosition::LEFT_BACK_EDGE_3D: // eg
471 neighborId
472 = getVertexNeighborEG(vertexId, localNeighborId, s[0], s[1], s[2]);
473 break;
474 case VertexPosition::RIGHT_BACK_EDGE_3D: // fh
475 neighborId
476 = getVertexNeighborFH(vertexId, localNeighborId, s[0], s[1], s[2]);
477 break;
478 case VertexPosition::TOP_LEFT_EDGE_3D: // ae
479 neighborId
480 = getVertexNeighborAE(vertexId, localNeighborId, s[0], s[1], s[2]);
481 break;
482 case VertexPosition::TOP_RIGHT_EDGE_3D: // bf
483 neighborId
484 = getVertexNeighborBF(vertexId, localNeighborId, s[0], s[1], s[2]);
485 break;
486 case VertexPosition::BOTTOM_LEFT_EDGE_3D: // cg
487 neighborId
488 = getVertexNeighborCG(vertexId, localNeighborId, s[0], s[1], s[2]);
489 break;
490 case VertexPosition::BOTTOM_RIGHT_EDGE_3D: // dh
491 neighborId
492 = getVertexNeighborDH(vertexId, localNeighborId, s[0], s[1], s[2]);
493 break;
494 case VertexPosition::TOP_LEFT_FRONT_CORNER_3D: // a
495 neighborId
496 = getVertexNeighborA(vertexId, localNeighborId, s[0], s[1], s[2]);
497 break;
498 case VertexPosition::TOP_RIGHT_FRONT_CORNER_3D: // b
499 neighborId
500 = getVertexNeighborB(vertexId, localNeighborId, s[0], s[1], s[2]);
501 break;
502 case VertexPosition::BOTTOM_LEFT_FRONT_CORNER_3D: // c
503 neighborId
504 = getVertexNeighborC(vertexId, localNeighborId, s[0], s[1], s[2]);
505 break;
506 case VertexPosition::BOTTOM_RIGHT_FRONT_CORNER_3D: // d
507 neighborId
508 = getVertexNeighborD(vertexId, localNeighborId, s[0], s[1], s[2]);
509 break;
510 case VertexPosition::TOP_LEFT_BACK_CORNER_3D: // e
511 neighborId
512 = getVertexNeighborE(vertexId, localNeighborId, s[0], s[1], s[2]);
513 break;
514 case VertexPosition::TOP_RIGHT_BACK_CORNER_3D: // f
515 neighborId
516 = getVertexNeighborF(vertexId, localNeighborId, s[0], s[1], s[2]);
517 break;
518 case VertexPosition::BOTTOM_LEFT_BACK_CORNER_3D: // g
519 neighborId
520 = getVertexNeighborG(vertexId, localNeighborId, s[0], s[1], s[2]);
521 break;
522 case VertexPosition::BOTTOM_RIGHT_BACK_CORNER_3D: // h
523 neighborId
524 = getVertexNeighborH(vertexId, localNeighborId, s[0], s[1], s[2]);
525 break;
526 case VertexPosition::CENTER_2D:
527 neighborId
528 = getVertexNeighbor2dABCD(vertexId, localNeighborId, s[0], s[1]);
529 break;
530 case VertexPosition::TOP_EDGE_2D:
531 neighborId = getVertexNeighbor2dAB(vertexId, localNeighborId, s[0], s[1]);
532 break;
533 case VertexPosition::BOTTOM_EDGE_2D:
534 neighborId = getVertexNeighbor2dCD(vertexId, localNeighborId, s[0], s[1]);
535 break;
536 case VertexPosition::LEFT_EDGE_2D:
537 neighborId = getVertexNeighbor2dAC(vertexId, localNeighborId, s[0], s[1]);
538 break;
539 case VertexPosition::RIGHT_EDGE_2D:
540 neighborId = getVertexNeighbor2dBD(vertexId, localNeighborId, s[0], s[1]);
541 break;
542 case VertexPosition::TOP_LEFT_CORNER_2D: // a
543 neighborId = getVertexNeighbor2dA(vertexId, localNeighborId, s[0], s[1]);
544 break;
545 case VertexPosition::TOP_RIGHT_CORNER_2D: // b
546 neighborId = getVertexNeighbor2dB(vertexId, localNeighborId, s[0], s[1]);
547 break;
548 case VertexPosition::BOTTOM_LEFT_CORNER_2D: // c
549 neighborId = getVertexNeighbor2dC(vertexId, localNeighborId, s[0], s[1]);
550 break;
551 case VertexPosition::BOTTOM_RIGHT_CORNER_2D: // d
552 neighborId = getVertexNeighbor2dD(vertexId, localNeighborId, s[0], s[1]);
553 break;
554 case VertexPosition::CENTER_1D:
555 neighborId = (localNeighborId == 0 ? vertexId + decimation_
556 : vertexId - decimation_);
557 break;
558 case VertexPosition::LEFT_CORNER_1D:
559 neighborId = vertexId + decimation_;
560 break;
561 case VertexPosition::RIGHT_CORNER_1D:
562 neighborId = vertexId - decimation_;
563 break;
564 default:
565 neighborId = -1;
566 break;
567 }
568
569 return 0;
570}
571
573 const SimplexId v,
574 const SimplexId neighborId,
575 const SimplexId shiftX,
576 const SimplexId shiftY) const {
577 // V(a)={b,c}
578 if(neighborId == v + shiftX)
579 return 0; // b
580 else if(neighborId == v + gridDimensions_[Di_] * shiftY)
581 return 1; // c
582 return -1;
583}
584
587 const int id,
588 const SimplexId shiftX,
589 const SimplexId shiftY) const {
590 // V(a)={b,c}
591 switch(id) {
592 case 0:
593 return v + shiftX; // b
594 case 1:
595 return v + gridDimensions_[Di_] * shiftY; // c
596 }
597 return -1;
598}
599
601 const SimplexId v,
602 const SimplexId neighborId,
603 const SimplexId shiftX,
604 const SimplexId shiftY) const {
605 // V(b)={a,c,d}
606 if(neighborId == v - shiftX)
607 return 0; // a
608 else if(neighborId == v + gridDimensions_[Di_] * shiftY)
609 return 1; // d
610 else if(neighborId == v + (gridDimensions_[Di_] * shiftY - shiftX))
611 return 2; // c
612 return -1;
613}
614
617 const int id,
618 const SimplexId shiftX,
619 const SimplexId shiftY) const {
620 // V(b)={a,c,d}
621 switch(id) {
622 case 0:
623 return v - shiftX; // a
624 case 1:
625 return v + gridDimensions_[Di_] * shiftY; // d
626 case 2:
627 return v + (gridDimensions_[Di_] * shiftY - shiftX); // c
628 }
629 return -1;
630}
631
633 const SimplexId v,
634 const SimplexId neighborId,
635 const SimplexId shiftX,
636 const SimplexId shiftY) const {
637 // V(c)={a,b,d}
638 if(neighborId == v + shiftX)
639 return 0;
640 else if(neighborId == v - gridDimensions_[Di_] * shiftY)
641 return 1; // a
642 else if(neighborId == v + (shiftX - gridDimensions_[Di_] * shiftY))
643 return 2; // b
644 return -1;
645}
646
649 const int id,
650 const SimplexId shiftX,
651 const SimplexId shiftY) const {
652 // V(c)={a,b,d}
653 switch(id) {
654 case 0:
655 return v + shiftX;
656 case 1:
657 return v - gridDimensions_[Di_] * shiftY; // a
658 case 2:
659 return v + (shiftX - gridDimensions_[Di_] * shiftY); // b
660 }
661 return -1;
662}
663
665 const SimplexId v,
666 const SimplexId neighborId,
667 const SimplexId shiftX,
668 const SimplexId shiftY) const {
669 // V(d)={c,b}
670 if(neighborId == v - shiftX)
671 return 0; // c
672 else if(neighborId == v - gridDimensions_[Di_] * shiftY)
673 return 1; // b
674 return -1;
675}
676
679 const int id,
680 const SimplexId shiftX,
681 const SimplexId shiftY) const {
682 // V(d)={c,b}
683 switch(id) {
684 case 0:
685 return v - shiftX; // c
686 case 1:
687 return v - gridDimensions_[Di_] * shiftY; // b
688 }
689 return -1;
690}
691
693 const SimplexId v,
694 const SimplexId neighborId,
695 const SimplexId shiftX,
696 const SimplexId shiftY) const {
697 // V(ab)=V(b)::{a,c,d}+V(a)::{b}
698 if(neighborId == v - decimation_)
699 return 0; // V(b)::a
700 else if(neighborId == v + (gridDimensions_[Di_] * shiftY - decimation_))
701 return 1; // V(b)::c
702 else if(neighborId == v + gridDimensions_[Di_] * shiftY)
703 return 2; // V(b)::d
704 else if(neighborId == v + shiftX)
705 return 3; // V(a)::b
706 return -1;
707}
708
711 const int id,
712 const SimplexId shiftX,
713 const SimplexId shiftY) const {
714 // V(ab)=V(b)::{a,c,d}+V(a)::{b}
715 switch(id) {
716 case 0:
717 return v - decimation_; // V(b)::a
718 case 1:
719 return v + (gridDimensions_[Di_] * shiftY - decimation_); // V(b)::c
720 case 2:
721 return v + gridDimensions_[Di_] * shiftY; // V(b)::d
722 case 3:
723 return v + shiftX; // V(a)::b
724 }
725 return -1;
726}
727
729 const SimplexId v,
730 const SimplexId neighborId,
731 const SimplexId shiftX,
732 const SimplexId shiftY) const {
733 // V(cd)=V(c)::{a,b,d}+V(d)::{c}
734 if(neighborId == v - decimation_)
735 return 0; // V(d)::c
736 else if(neighborId == v - gridDimensions_[Di_] * shiftY)
737 return 1; // V(c)::a
738 else if(neighborId == v + (shiftX - gridDimensions_[Di_] * shiftY))
739 return 2; // V(c)::b
740 else if(neighborId == v + shiftX)
741 return 3; // V(c)::d
742 return -1;
743}
744
747 const int id,
748 const SimplexId shiftX,
749 const SimplexId shiftY) const {
750 // V(cd)=V(c)::{a,b,d}+V(d)::{c}
751 switch(id) {
752 case 0:
753 return v - decimation_; // V(d)::c
754 case 1:
755 return v - gridDimensions_[Di_] * shiftY; // V(c)::a
756 case 2:
757 return v + (shiftX - gridDimensions_[Di_] * shiftY); // V(c)::b
758 case 3:
759 return v + shiftX; // V(c)::d
760 }
761 return -1;
762}
763
765 const SimplexId v,
766 const SimplexId neighborId,
767 const SimplexId shiftX,
768 const SimplexId shiftY) const {
769 // V(ac)=V(c)::{a,b,d}+V(a)::{c}
770 if(neighborId == v - gridDimensions_[Di_] * decimation_)
771 return 0; // V(c)::{a}
772 else if(neighborId == v + (shiftX - gridDimensions_[Di_] * decimation_))
773 return 1; // V(c)::{b}
774 else if(neighborId == v + shiftX)
775 return 2; // V(c)::{d}
776 else if(neighborId == v + gridDimensions_[Di_] * shiftY)
777 return 3; // V(a)::{c}
778 return -1;
779}
780
783 const int id,
784 const SimplexId shiftX,
785 const SimplexId shiftY) const {
786 // V(ac)=V(c)::{a,b,d}+V(a)::{c}
787 switch(id) {
788 case 0:
789 return v - gridDimensions_[Di_] * decimation_; // V(c)::{a}
790 case 1:
791 return v + (shiftX - gridDimensions_[Di_] * decimation_); // V(c)::{b}
792 case 2:
793 return v + shiftX; // V(c)::{d}
794 case 3:
795 return v + gridDimensions_[Di_] * shiftY; // V(a)::{c}
796 }
797 return -1;
798}
799
801 const SimplexId v,
802 const SimplexId neighborId,
803 const SimplexId shiftX,
804 const SimplexId shiftY) const {
805 // V(bd)=V(b)::{c,d}+V(d)::{b,c}
806 if(neighborId == v + (gridDimensions_[Di_] * shiftY - shiftX))
807 return 0; // V(b)::{c}
808 else if(neighborId == v + gridDimensions_[Di_] * shiftY)
809 return 1; // V(b)::{d}
810 else if(neighborId == v - gridDimensions_[Di_] * decimation_)
811 return 2; // V(d)::{b}
812 else if(neighborId == v - shiftX)
813 return 3; // V(d)::{c}
814 return -1;
815}
816
819 const int id,
820 const SimplexId shiftX,
821 const SimplexId shiftY) const {
822 // V(bd)=V(b)::{c,d}+V(d)::{b,c}
823 switch(id) {
824 case 0:
825 return v + (gridDimensions_[Di_] * shiftY - shiftX); // V(b)::{c}
826 case 1:
827 return v + gridDimensions_[Di_] * shiftY; // V(b)::{d}
828 case 2:
829 return v - gridDimensions_[Di_] * decimation_; // V(d)::{b}
830 case 3:
831 return v - shiftX; // V(d)::{c}
832 }
833 return -1;
834}
835
837 const SimplexId v,
838 const SimplexId neighborId,
839 const SimplexId shiftX,
840 const SimplexId shiftY) const {
841 // V(abcd)=V(d)::{b,c}+V(c)::{b,d}+V(a)::{b}+V(b)::{c}
842 if(neighborId == v - decimation_)
843 return 0;
844 else if(neighborId == v - gridDimensions_[Di_] * decimation_)
845 return 1;
846 else if(neighborId == v + (shiftX - gridDimensions_[Di_] * decimation_))
847 return 2;
848 else if(neighborId == v + shiftX)
849 return 3;
850 else if(neighborId == v + gridDimensions_[Di_] * shiftY)
851 return 4;
852 else if(neighborId == v + (gridDimensions_[Di_] * shiftY - decimation_))
853 return 5;
854 return -1;
855}
856
859 const int id,
860 const SimplexId shiftX,
861 const SimplexId shiftY) const {
862 // V(abcd)=V(d)::{b,c}+V(c)::{b,d}+V(a)::{b}+V(b)::{c}
863 switch(id) {
864 case 0:
865 return v - decimation_;
866 case 1:
867 return v - gridDimensions_[Di_] * decimation_;
868 case 2:
869 return v + (shiftX - gridDimensions_[Di_] * decimation_);
870 case 3:
871 return v + shiftX;
872 case 4:
873 return v + gridDimensions_[Di_] * shiftY;
874 case 5:
875 return v + (gridDimensions_[Di_] * shiftY - decimation_);
876 }
877 return -1;
878}
879
881 const SimplexId &vertexId) const {
882
883#ifndef TTK_ENABLE_KAMIKAZE
884 if(vertexId < 0 or vertexId >= vertexNumber_)
885 return -1;
886#endif
887
888 switch(vertexPositions_[vertexId]) {
889 case VertexPosition::CENTER_3D:
890 return 14;
891 case VertexPosition::FRONT_FACE_3D:
892 case VertexPosition::BACK_FACE_3D:
893 case VertexPosition::TOP_FACE_3D:
894 case VertexPosition::BOTTOM_FACE_3D:
895 case VertexPosition::LEFT_FACE_3D:
896 case VertexPosition::RIGHT_FACE_3D:
897 return 10;
898 case VertexPosition::TOP_FRONT_EDGE_3D: // ab
899 case VertexPosition::RIGHT_FRONT_EDGE_3D: // bd
900 case VertexPosition::BOTTOM_BACK_EDGE_3D: // gh
901 case VertexPosition::LEFT_BACK_EDGE_3D: // eg
902 case VertexPosition::BOTTOM_LEFT_EDGE_3D: // cg
903 case VertexPosition::TOP_RIGHT_EDGE_3D: // bf
904 return 8;
905 case VertexPosition::TOP_RIGHT_FRONT_CORNER_3D: // b
906 case VertexPosition::BOTTOM_LEFT_BACK_CORNER_3D: // g
907 return 7;
908 case VertexPosition::TOP_BACK_EDGE_3D: // ef
909 case VertexPosition::BOTTOM_FRONT_EDGE_3D: // cd
910 case VertexPosition::LEFT_FRONT_EDGE_3D: // ac
911 case VertexPosition::TOP_LEFT_EDGE_3D: // ae
912 case VertexPosition::RIGHT_BACK_EDGE_3D: // fh
913 case VertexPosition::BOTTOM_RIGHT_EDGE_3D: // dh
914 case VertexPosition::CENTER_2D:
915 return 6;
916 case VertexPosition::TOP_LEFT_FRONT_CORNER_3D: // a
917 case VertexPosition::BOTTOM_LEFT_FRONT_CORNER_3D: // c
918 case VertexPosition::BOTTOM_RIGHT_FRONT_CORNER_3D: // d
919 case VertexPosition::TOP_LEFT_BACK_CORNER_3D: // e
920 case VertexPosition::TOP_RIGHT_BACK_CORNER_3D: // f
921 case VertexPosition::BOTTOM_RIGHT_BACK_CORNER_3D: // h
922 case VertexPosition::TOP_EDGE_2D:
923 case VertexPosition::BOTTOM_EDGE_2D:
924 case VertexPosition::LEFT_EDGE_2D:
925 case VertexPosition::RIGHT_EDGE_2D:
926 return 4;
927 case VertexPosition::TOP_RIGHT_CORNER_2D: // b
928 case VertexPosition::BOTTOM_LEFT_CORNER_2D: // c
929 return 3;
930 case VertexPosition::TOP_LEFT_CORNER_2D: // a
931 case VertexPosition::BOTTOM_RIGHT_CORNER_2D: // d
932 case VertexPosition::CENTER_1D:
933 return 2;
934 case VertexPosition::LEFT_CORNER_1D:
935 case VertexPosition::RIGHT_CORNER_1D:
936 return 1;
937 }
938
939 return -1;
940}
941
943 const SimplexId v,
944 const SimplexId neighborId,
945 const SimplexId shiftX,
946 const SimplexId shiftY,
947 const SimplexId shiftZ) const {
948 // V(a)={b,c,e,g}
949 if(neighborId == v + shiftX)
950 return 0; // b
951 else if(neighborId == v + vshift_[0] * shiftY)
952 return 1; // c
953 else if(neighborId == v + vshift_[1] * shiftZ)
954 return 2; // e
955 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
956 return 3; // g
957 return -1;
958}
959
960inline ttk::SimplexId
962 const int id,
963 const SimplexId shiftX,
964 const SimplexId shiftY,
965 const SimplexId shiftZ) const {
966 // V(a)={b,c,e,g}
967 switch(id) {
968 case 0:
969 return v + shiftX; // b
970 case 1:
971 return v + vshift_[0] * shiftY; // c
972 case 2:
973 return v + vshift_[1] * shiftZ; // e
974 case 3:
975 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // g
976 }
977 return -1;
978}
979
981 const SimplexId v,
982 const SimplexId neighborId,
983 const SimplexId shiftX,
984 const SimplexId shiftY,
985 const SimplexId shiftZ) const {
986 // V(b)={a,c,d,e,f,g,h}
987 if(neighborId == v - shiftX)
988 return 0; // a
989 else if(neighborId == v + (vshift_[0] * shiftY - shiftX))
990 return 1; // c
991 else if(neighborId == v + vshift_[0] * shiftY)
992 return 2; // d
993 else if(neighborId == v + (vshift_[1] * shiftZ - shiftX))
994 return 3; // e
995 else if(neighborId == v + vshift_[1] * shiftZ)
996 return 4; // f
997 else if(neighborId
998 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX))
999 return 5; // g
1000 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1001 return 6; // h
1002 return -1;
1003}
1004
1005inline ttk::SimplexId
1007 const int id,
1008 const SimplexId shiftX,
1009 const SimplexId shiftY,
1010 const SimplexId shiftZ) const {
1011 // V(b)={a,c,d,e,f,g,h}
1012 switch(id) {
1013 case 0:
1014 return v - shiftX; // a
1015 case 1:
1016 return v + (vshift_[0] * shiftY - shiftX); // c
1017 case 2:
1018 return v + vshift_[0] * shiftY; // d
1019 case 3:
1020 return v + (vshift_[1] * shiftZ - shiftX); // e
1021 case 4:
1022 return v + vshift_[1] * shiftZ; // f
1023 case 5:
1024 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX); // g
1025 case 6:
1026 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // h
1027 }
1028 return -1;
1029}
1030
1032 const SimplexId v,
1033 const SimplexId neighborId,
1034 const SimplexId shiftX,
1035 const SimplexId shiftY,
1036 const SimplexId shiftZ) const {
1037 // V(c)={a,b,d,g}
1038 if(neighborId == v - vshift_[0] * shiftY)
1039 return 0; // a
1040 else if(neighborId == v + (shiftX - vshift_[0] * shiftY))
1041 return 1; // b
1042 else if(neighborId == v + shiftX)
1043 return 2; // d
1044 else if(neighborId == v + vshift_[1] * shiftZ)
1045 return 3; // g
1046 return -1;
1047}
1048
1049inline ttk::SimplexId
1051 const int id,
1052 const SimplexId shiftX,
1053 const SimplexId shiftY,
1054 const SimplexId shiftZ) const {
1055 // V(c)={a,b,d,g}
1056 switch(id) {
1057 case 0:
1058 return v - vshift_[0] * shiftY; // a
1059 case 1:
1060 return v + (shiftX - vshift_[0] * shiftY); // b
1061 case 2:
1062 return v + shiftX; // d
1063 case 3:
1064 return v + vshift_[1] * shiftZ; // g
1065 }
1066 return -1;
1067}
1068
1070 const SimplexId v,
1071 const SimplexId neighborId,
1072 const SimplexId shiftX,
1073 const SimplexId shiftY,
1074 const SimplexId shiftZ) const {
1075 // V(d)={b,c,g,h}
1076 if(neighborId == v - vshift_[0] * shiftY)
1077 return 0; // b
1078 else if(neighborId == v - shiftX)
1079 return 1; // c
1080 else if(neighborId == v + (-shiftX + vshift_[1] * shiftZ))
1081 return 2; // g
1082 else if(neighborId == v + vshift_[1] * shiftZ)
1083 return 3; // h
1084 return -1;
1085}
1086
1087inline ttk::SimplexId
1089 const int id,
1090 const SimplexId shiftX,
1091 const SimplexId shiftY,
1092 const SimplexId shiftZ) const {
1093 // V(d)={b,c,g,h}
1094 switch(id) {
1095 case 0:
1096 return v - vshift_[0] * shiftY; // b
1097 case 1:
1098 return v - shiftX; // c
1099 case 2:
1100 return v + (-shiftX + vshift_[1] * shiftZ); // g
1101 case 3:
1102 return v + vshift_[1] * shiftZ; // h
1103 }
1104 return -1;
1105}
1106
1108 const SimplexId v,
1109 const SimplexId neighborId,
1110 const SimplexId shiftX,
1111 const SimplexId shiftY,
1112 const SimplexId shiftZ) const {
1113 // V(e)={a,b,f,g}
1114 if(neighborId == v - vshift_[1] * shiftZ)
1115 return 0; // a
1116 else if(neighborId == v + (shiftX - vshift_[1] * shiftZ))
1117 return 1; // b
1118 else if(neighborId == v + shiftX)
1119 return 2; // f
1120 else if(neighborId == v + vshift_[0] * shiftY)
1121 return 3; // g
1122 return -1;
1123}
1124
1125inline ttk::SimplexId
1127 const int id,
1128 const SimplexId shiftX,
1129 const SimplexId shiftY,
1130 const SimplexId shiftZ) const {
1131 // V(e)={a,b,f,g}
1132 switch(id) {
1133 case 0:
1134 return v - vshift_[1] * shiftZ; // a
1135 case 1:
1136 return v + (shiftX - vshift_[1] * shiftZ); // b
1137 case 2:
1138 return v + shiftX; // f
1139 case 3:
1140 return v + vshift_[0] * shiftY; // g
1141 }
1142 return -1;
1143}
1144
1146 const SimplexId v,
1147 const SimplexId neighborId,
1148 const SimplexId shiftX,
1149 const SimplexId shiftY,
1150 const SimplexId shiftZ) const {
1151 // V(f)={b,e,g,h}
1152 if(neighborId == v - vshift_[1] * shiftZ)
1153 return 0; // b
1154 else if(neighborId == v - shiftX)
1155 return 1; // e
1156 else if(neighborId == v + (vshift_[0] * shiftY - shiftX))
1157 return 2; // g
1158 else if(neighborId == v + vshift_[0] * shiftY)
1159 return 3; // h
1160 return -1;
1161}
1162
1163inline ttk::SimplexId
1165 const int id,
1166 const SimplexId shiftX,
1167 const SimplexId shiftY,
1168 const SimplexId shiftZ) const {
1169 // V(f)={b,e,g,h}
1170 switch(id) {
1171 case 0:
1172 return v - vshift_[1] * shiftZ; // b
1173 case 1:
1174 return v - shiftX; // e
1175 case 2:
1176 return v + (vshift_[0] * shiftY - shiftX); // g
1177 case 3:
1178 return v + vshift_[0] * shiftY; // h
1179 }
1180 return -1;
1181}
1182
1184 const SimplexId v,
1185 const SimplexId neighborId,
1186 const SimplexId shiftX,
1187 const SimplexId shiftY,
1188 const SimplexId shiftZ) const {
1189 // V(g)={a,b,c,d,e,f,h}
1190 if(neighborId == v - (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1191 return 0; // a
1192 else if(neighborId
1193 == v + (shiftX - vshift_[0] * shiftY - vshift_[1] * shiftZ))
1194 return 1; // b
1195 else if(neighborId == v - vshift_[1] * shiftZ)
1196 return 2; // c
1197 else if(neighborId == v + (shiftX - vshift_[1] * shiftZ))
1198 return 3; // d
1199 else if(neighborId == v - vshift_[0] * shiftY)
1200 return 4; // e
1201 else if(neighborId == v + (shiftX - vshift_[0] * shiftY))
1202 return 5; // f
1203 else if(neighborId == v + shiftX)
1204 return 6; // h
1205 return -1;
1206}
1207
1208inline ttk::SimplexId
1210 const int id,
1211 const SimplexId shiftX,
1212 const SimplexId shiftY,
1213 const SimplexId shiftZ) const {
1214 // V(g)={a,b,c,d,e,f,h}
1215 switch(id) {
1216 case 0:
1217 return v - (vshift_[0] * shiftY + vshift_[1] * shiftZ); // a
1218 case 1:
1219 return v + (shiftX - vshift_[0] * shiftY - vshift_[1] * shiftZ); // b
1220 case 2:
1221 return v - vshift_[1] * shiftZ; // c
1222 case 3:
1223 return v + (shiftX - vshift_[1] * shiftZ); // d
1224 case 4:
1225 return v - vshift_[0] * shiftY; // e
1226 case 5:
1227 return v + (shiftX - vshift_[0] * shiftY); // f
1228 case 6:
1229 return v + shiftX; // h
1230 }
1231 return -1;
1232}
1233
1235 const SimplexId v,
1236 const SimplexId neighborId,
1237 const SimplexId shiftX,
1238 const SimplexId shiftY,
1239 const SimplexId shiftZ) const {
1240 // V(h)={b,d,f,g}
1241 if(neighborId == v - (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1242 return 0; // b
1243 else if(neighborId == v - vshift_[1] * shiftZ)
1244 return 1; // d
1245 else if(neighborId == v - vshift_[0] * shiftY)
1246 return 2; // f
1247 else if(neighborId == v - shiftX)
1248 return 3; // g
1249 return -1;
1250}
1251
1252inline ttk::SimplexId
1254 const int id,
1255 const SimplexId shiftX,
1256 const SimplexId shiftY,
1257 const SimplexId shiftZ) const {
1258 // V(h)={b,d,f,g}
1259 switch(id) {
1260 case 0:
1261 return v - (vshift_[0] * shiftY + vshift_[1] * shiftZ); // b
1262 case 1:
1263 return v - vshift_[1] * shiftZ; // d
1264 case 2:
1265 return v - vshift_[0] * shiftY; // f
1266 case 3:
1267 return v - shiftX; // g
1268 }
1269 return -1;
1270}
1271
1273 const SimplexId v,
1274 const SimplexId neighborId,
1275 const SimplexId shiftX,
1276 const SimplexId shiftY,
1277 const SimplexId shiftZ) const {
1278 // V(ab)=V(b)+V(a)::{b}
1279 if(neighborId == v - decimation_)
1280 return 0; // a
1281 else if(neighborId == v + (vshift_[0] * shiftY - decimation_))
1282 return 1; // c
1283 else if(neighborId == v + vshift_[0] * shiftY)
1284 return 2; // d
1285 else if(neighborId == v + (vshift_[1] * shiftZ - decimation_))
1286 return 3; // e
1287 else if(neighborId == v + vshift_[1] * shiftZ)
1288 return 4; // f
1289 else if(neighborId
1290 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - decimation_))
1291 return 5; // g
1292 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1293 return 6; // h
1294 else if(neighborId == v + shiftX)
1295 return 7; // V(a)::{b}
1296 return -1;
1297}
1298
1299inline ttk::SimplexId
1301 const int id,
1302 const SimplexId shiftX,
1303 const SimplexId shiftY,
1304 const SimplexId shiftZ) const {
1305 // V(ab)=V(b)+V(a)::{b}
1306 switch(id) {
1307 case 0:
1308 return v - decimation_; // a
1309 case 1:
1310 return v + (vshift_[0] * shiftY - decimation_); // c
1311 case 2:
1312 return v + vshift_[0] * shiftY; // d
1313 case 3:
1314 return v + (vshift_[1] * shiftZ - decimation_); // e
1315 case 4:
1316 return v + vshift_[1] * shiftZ; // f
1317 case 5:
1318 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - decimation_); // g
1319 case 6:
1320 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // h
1321 case 7:
1322 return v + shiftX; // V(a)::{b}
1323 }
1324 return -1;
1325}
1326
1328 const SimplexId v,
1329 const SimplexId neighborId,
1330 const SimplexId shiftX,
1331 const SimplexId shiftY,
1332 const SimplexId shiftZ) const {
1333 // V(cd)=V(d)+V(c)::{b,d}
1334 if(neighborId == v - vshift_[0] * shiftY)
1335 return 0; // b
1336 else if(neighborId == v - decimation_)
1337 return 1; // c
1338 else if(neighborId == v + (vshift_[1] * shiftZ - decimation_))
1339 return 2; // g
1340 else if(neighborId == v + vshift_[1] * shiftZ)
1341 return 3; // h
1342 else if(neighborId == v + (shiftX - vshift_[0] * shiftY))
1343 return 4; // V(c)::{b}
1344 else if(neighborId == v + shiftX)
1345 return 5; // V(c)::{d}
1346 return -1;
1347}
1348inline ttk::SimplexId
1350 const int id,
1351 const SimplexId shiftX,
1352 const SimplexId shiftY,
1353 const SimplexId shiftZ) const {
1354 // V(cd)=V(d)+V(c)::{b,d}
1355 switch(id) {
1356 case 0:
1357 return v - vshift_[0] * shiftY; // b
1358 case 1:
1359 return v - decimation_; // c
1360 case 2:
1361 return v + (vshift_[1] * shiftZ - decimation_); // g
1362 case 3:
1363 return v + vshift_[1] * shiftZ; // h
1364 case 4:
1365 return v + (shiftX - vshift_[0] * shiftY); // V(c)::{b}
1366 case 5:
1367 return v + shiftX; // V(c)::{d}
1368 }
1369 return -1;
1370}
1371
1373 const SimplexId v,
1374 const SimplexId neighborId,
1375 const SimplexId shiftX,
1376 const SimplexId shiftY,
1377 const SimplexId shiftZ) const {
1378 // V(ef)=V(f)+V(e)::{b,f}
1379 if(neighborId == v - vshift_[1] * shiftZ)
1380 return 0; // b
1381 else if(neighborId == v - decimation_)
1382 return 1; // e
1383 else if(neighborId == v + (vshift_[0] * shiftY - decimation_))
1384 return 2; // g
1385 else if(neighborId == v + vshift_[0] * shiftY)
1386 return 3; // h
1387 else if(neighborId == v + (shiftX - vshift_[1] * shiftZ))
1388 return 4; // V(e)::{b}
1389 else if(neighborId == v + shiftX)
1390 return 5; // V(e)::{f}
1391 return -1;
1392}
1393inline ttk::SimplexId
1395 const int id,
1396 const SimplexId shiftX,
1397 const SimplexId shiftY,
1398 const SimplexId shiftZ) const {
1399 // V(ef)=V(f)+V(e)::{b,f}
1400 switch(id) {
1401 case 0:
1402 return v - vshift_[1] * shiftZ; // b
1403 case 1:
1404 return v - decimation_; // e
1405 case 2:
1406 return v + (vshift_[0] * shiftY - decimation_); // g
1407 case 3:
1408 return v + vshift_[0] * shiftY; // h
1409 case 4:
1410 return v + (shiftX - vshift_[1] * shiftZ); // V(e)::{b}
1411 case 5:
1412 return v + shiftX; // V(e)::{f}
1413 }
1414 return -1;
1415}
1416
1418 const SimplexId v,
1419 const SimplexId neighborId,
1420 const SimplexId shiftX,
1421 const SimplexId shiftY,
1422 const SimplexId shiftZ) const {
1423 // V(gh)=V(g)+V(h)::{g}
1424 if(neighborId == v - (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1425 return 0; // a
1426 else if(neighborId
1427 == v + (shiftX - vshift_[0] * shiftY - vshift_[1] * shiftZ))
1428 return 1; // b
1429 else if(neighborId == v - vshift_[1] * shiftZ)
1430 return 2; // c
1431 else if(neighborId == v + (shiftX - vshift_[1] * shiftZ))
1432 return 3; // d
1433 else if(neighborId == v - vshift_[0] * shiftY)
1434 return 4; // e
1435 else if(neighborId == v + (shiftX - vshift_[0] * shiftY))
1436 return 5; // f
1437 else if(neighborId == v + shiftX)
1438 return 6; // h
1439 else if(neighborId == v - decimation_)
1440 return 7; // V(h)::{g}
1441
1442 return -1;
1443}
1444inline ttk::SimplexId
1446 const int id,
1447 const SimplexId shiftX,
1448 const SimplexId shiftY,
1449 const SimplexId shiftZ) const {
1450 // V(gh)=V(g)+V(h)::{g}
1451 switch(id) {
1452 case 0:
1453 return v - (vshift_[0] * shiftY + vshift_[1] * shiftZ); // a
1454 case 1:
1455 return v + (shiftX - vshift_[0] * shiftY - vshift_[1] * shiftZ); // b
1456 case 2:
1457 return v - vshift_[1] * shiftZ; // c
1458 case 3:
1459 return v + (shiftX - vshift_[1] * shiftZ); // d
1460 case 4:
1461 return v - vshift_[0] * shiftY; // e
1462 case 5:
1463 return v + (shiftX - vshift_[0] * shiftY); // f
1464 case 6:
1465 return v + shiftX; // h
1466 case 7:
1467 return v - decimation_; // V(h)::{g}
1468 }
1469
1470 return -1;
1471}
1472
1474 const SimplexId v,
1475 const SimplexId neighborId,
1476 const SimplexId shiftX,
1477 const SimplexId shiftY,
1478 const SimplexId shiftZ) const {
1479 // V(ac)=V(c)+V(a)::{c,g}
1480 if(neighborId == v - vshift_[0] * decimation_)
1481 return 0; // a
1482 else if(neighborId == v + (shiftX - vshift_[0] * decimation_))
1483 return 1; // b
1484 else if(neighborId == v + shiftX)
1485 return 2; // d
1486 else if(neighborId == v + vshift_[1] * shiftZ)
1487 return 3; // g
1488 else if(neighborId == v + vshift_[0] * shiftY)
1489 return 4; // V(a)::{c}
1490 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1491 return 5; // V(a)::{c}
1492 return -1;
1493}
1494inline ttk::SimplexId
1496 const int id,
1497 const SimplexId shiftX,
1498 const SimplexId shiftY,
1499 const SimplexId shiftZ) const {
1500 // V(ac)=V(c)+V(a)::{c,g}
1501 switch(id) {
1502 case 0:
1503 return v - vshift_[0] * decimation_; // a
1504 case 1:
1505 return v + (shiftX - vshift_[0] * decimation_); // b
1506 case 2:
1507 return v + shiftX; // d
1508 case 3:
1509 return v + vshift_[1] * shiftZ; // g
1510 case 4:
1511 return v + vshift_[0] * shiftY; // V(a)::{c}
1512 case 5:
1513 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // V(a)::{c}
1514 }
1515 return -1;
1516}
1517
1519 const SimplexId v,
1520 const SimplexId neighborId,
1521 const SimplexId shiftX,
1522 const SimplexId shiftY,
1523 const SimplexId shiftZ) const {
1524 // V(bd)=V(b)+V(d)::{b}
1525 if(neighborId == v - shiftX)
1526 return 0; // a
1527 else if(neighborId == v + (vshift_[0] * shiftY - shiftX))
1528 return 1; // c
1529 else if(neighborId == v + vshift_[0] * shiftY)
1530 return 2; // d
1531 else if(neighborId == v + (vshift_[1] * shiftZ - shiftX))
1532 return 3; // e
1533 else if(neighborId == v + vshift_[1] * shiftZ)
1534 return 4; // f
1535 else if(neighborId
1536 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX))
1537 return 5; // g
1538 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1539 return 6; // h
1540 else if(neighborId == v - vshift_[0] * decimation_)
1541 return 7; // V(d)::{b}
1542 return -1;
1543}
1544inline ttk::SimplexId
1546 const int id,
1547 const SimplexId shiftX,
1548 const SimplexId shiftY,
1549 const SimplexId shiftZ) const {
1550 // V(bd)=V(b)+V(d)::{b}
1551 switch(id) {
1552 case 0:
1553 return v - shiftX; // a
1554 case 1:
1555 return v + (vshift_[0] * shiftY - shiftX); // c
1556 case 2:
1557 return v + vshift_[0] * shiftY; // d
1558 case 3:
1559 return v + (vshift_[1] * shiftZ - shiftX); // e
1560 case 4:
1561 return v + vshift_[1] * shiftZ; // f
1562 case 5:
1563 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX); // g
1564 case 6:
1565 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // h
1566 case 7:
1567 return v - vshift_[0] * decimation_; // V(d)::{b}
1568 }
1569 return -1;
1570}
1571
1573 const SimplexId v,
1574 const SimplexId neighborId,
1575 const SimplexId shiftX,
1576 const SimplexId shiftY,
1577 const SimplexId shiftZ) const {
1578 // V(eg)=V(g)+V(e)::{g}
1579 if(neighborId == v - (vshift_[0] * decimation_ + vshift_[1] * shiftZ))
1580 return 0; // a
1581 else if(neighborId
1582 == v + (shiftX - vshift_[0] * decimation_ - vshift_[1] * shiftZ))
1583 return 1; // b
1584 else if(neighborId == v - vshift_[1] * shiftZ)
1585 return 2; // c
1586 else if(neighborId == v + (shiftX - vshift_[1] * shiftZ))
1587 return 3; // d
1588 else if(neighborId == v - vshift_[0] * decimation_)
1589 return 4; // e
1590 else if(neighborId == v + (shiftX - vshift_[0] * decimation_))
1591 return 5; // f
1592 else if(neighborId == v + shiftX)
1593 return 6; // h
1594 else if(neighborId == v + vshift_[0] * shiftY)
1595 return 7; // V(e)::{g}
1596 return -1;
1597}
1598inline ttk::SimplexId
1600 const int id,
1601 const SimplexId shiftX,
1602 const SimplexId shiftY,
1603 const SimplexId shiftZ) const {
1604 // V(eg)=V(g)+V(e)::{g}
1605 switch(id) {
1606 case 0:
1607 return v - (vshift_[0] * decimation_ + vshift_[1] * shiftZ); // a
1608 case 1:
1609 return v + (shiftX - vshift_[0] * decimation_ - vshift_[1] * shiftZ); // b
1610 case 2:
1611 return v - vshift_[1] * shiftZ; // c
1612 case 3:
1613 return v + (shiftX - vshift_[1] * shiftZ); // d
1614 case 4:
1615 return v - vshift_[0] * decimation_; // e
1616 case 5:
1617 return v + (shiftX - vshift_[0] * decimation_); // f
1618 case 6:
1619 return v + shiftX; // h
1620 case 7:
1621 return v + vshift_[0] * shiftY; // V(e)::{g}
1622 }
1623 return -1;
1624}
1625
1627 const SimplexId v,
1628 const SimplexId neighborId,
1629 const SimplexId shiftX,
1630 const SimplexId shiftY,
1631 const SimplexId shiftZ) const {
1632 // V(fh)=V(f)+V(h)::{b,f}
1633 if(neighborId == v - vshift_[1] * shiftZ)
1634 return 0; // b
1635 else if(neighborId == v - shiftX)
1636 return 1; // e
1637 else if(neighborId == v + (vshift_[0] * shiftY - shiftX))
1638 return 2; // g
1639 else if(neighborId == v + vshift_[0] * shiftY)
1640 return 3; // h
1641 else if(neighborId == v - (vshift_[0] * decimation_ + vshift_[1] * shiftZ))
1642 return 4; // V(h)::{b}
1643 else if(neighborId == v - vshift_[0] * decimation_)
1644 return 5; // V(h)::{f}
1645 return -1;
1646}
1647inline ttk::SimplexId
1649 const int id,
1650 const SimplexId shiftX,
1651 const SimplexId shiftY,
1652 const SimplexId shiftZ) const {
1653 // V(fh)=V(f)+V(h)::{b,f}
1654 switch(id) {
1655 case 0:
1656 return v - vshift_[1] * shiftZ; // b
1657 case 1:
1658 return v - shiftX; // e
1659 case 2:
1660 return v + (vshift_[0] * shiftY - shiftX); // g
1661 case 3:
1662 return v + vshift_[0] * shiftY; // h
1663 case 4:
1664 return v - (vshift_[0] * decimation_ + vshift_[1] * shiftZ); // V(h)::{b}
1665 case 5:
1666 return v - vshift_[0] * decimation_; // V(h)::{f}
1667 }
1668 return -1;
1669}
1670
1672 const SimplexId v,
1673 const SimplexId neighborId,
1674 const SimplexId shiftX,
1675 const SimplexId shiftY,
1676 const SimplexId shiftZ) const {
1677 // V(ae)=V(a)+V(e)::{a,b}
1678 if(neighborId == v + shiftX)
1679 return 0; // b
1680 else if(neighborId == v + vshift_[0] * shiftY)
1681 return 1; // c
1682 else if(neighborId == v + vshift_[1] * shiftZ)
1683 return 2; // e
1684 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1685 return 3; // g
1686 else if(neighborId == v - vshift_[1] * decimation_)
1687 return 4; // V(e)::{a}
1688 else if(neighborId == v + (shiftX - vshift_[1] * decimation_))
1689 return 5; // V(e)::{b}
1690 return -1;
1691}
1692inline ttk::SimplexId
1694 const int id,
1695 const SimplexId shiftX,
1696 const SimplexId shiftY,
1697 const SimplexId shiftZ) const {
1698 // V(ae)=V(a)+V(e)::{a,b}
1699 switch(id) {
1700 case 0:
1701 return v + shiftX; // b
1702 case 1:
1703 return v + vshift_[0] * shiftY; // c
1704 case 2:
1705 return v + vshift_[1] * shiftZ; // e
1706 case 3:
1707 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // g
1708 case 4:
1709 return v - vshift_[1] * decimation_; // V(e)::{a}
1710 case 5:
1711 return v + (shiftX - vshift_[1] * decimation_); // V(e)::{b}
1712 }
1713 return -1;
1714}
1715
1717 const SimplexId v,
1718 const SimplexId neighborId,
1719 const SimplexId shiftX,
1720 const SimplexId shiftY,
1721 const SimplexId shiftZ) const {
1722 // V(bf)=V(b)+V(f)::{b}
1723 if(neighborId == v - shiftX)
1724 return 0; // a
1725 else if(neighborId == v + (vshift_[0] * shiftY - shiftX))
1726 return 1; // c
1727 else if(neighborId == v + vshift_[0] * shiftY)
1728 return 2; // d
1729 else if(neighborId == v + (vshift_[1] * shiftZ - shiftX))
1730 return 3; // e
1731 else if(neighborId == v + vshift_[1] * shiftZ)
1732 return 4; // f
1733 else if(neighborId
1734 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX))
1735 return 5; // g
1736 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
1737 return 6; // h
1738 else if(neighborId == v - vshift_[1] * decimation_)
1739 return 7; // V(f)::{b}
1740 return -1;
1741}
1742
1743inline ttk::SimplexId
1745 const int id,
1746 const SimplexId shiftX,
1747 const SimplexId shiftY,
1748 const SimplexId shiftZ) const {
1749 // V(bf)=V(b)+V(f)::{b}
1750 switch(id) {
1751 case 0:
1752 return v - shiftX; // a
1753 case 1:
1754 return v + (vshift_[0] * shiftY - shiftX); // c
1755 case 2:
1756 return v + vshift_[0] * shiftY; // d
1757 case 3:
1758 return v + (vshift_[1] * shiftZ - shiftX); // e
1759 case 4:
1760 return v + vshift_[1] * shiftZ; // f
1761 case 5:
1762 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX); // g
1763 case 6:
1764 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // h
1765 case 7:
1766 return v - vshift_[1] * decimation_; // V(f)::{b}
1767 }
1768 return -1;
1769}
1770
1772 const SimplexId v,
1773 const SimplexId neighborId,
1774 const SimplexId shiftX,
1775 const SimplexId shiftY,
1776 const SimplexId shiftZ) const {
1777 // V(cg)=V(g)+V(c)::{g}
1778 if(neighborId == v - (vshift_[0] * shiftY + vshift_[1] * decimation_))
1779 return 0; // a
1780 else if(neighborId
1781 == v + (shiftX - vshift_[0] * shiftY - vshift_[1] * decimation_))
1782 return 1; // b
1783 else if(neighborId == v - vshift_[1] * decimation_)
1784 return 2; // c
1785 else if(neighborId == v + (shiftX - vshift_[1] * decimation_))
1786 return 3; // d
1787 else if(neighborId == v - vshift_[0] * shiftY)
1788 return 4; // e
1789 else if(neighborId == v + (shiftX - vshift_[0] * shiftY))
1790 return 5; // f
1791 else if(neighborId == v + shiftX)
1792 return 6; // h
1793 else if(neighborId == v + vshift_[1] * shiftZ)
1794 return 7; // V(c)::{g}
1795 return -1;
1796}
1797inline ttk::SimplexId
1799 const int id,
1800 const SimplexId shiftX,
1801 const SimplexId shiftY,
1802 const SimplexId shiftZ) const {
1803 // V(cg)=V(g)+V(c)::{g}
1804 switch(id) {
1805 case 0:
1806 return v - (vshift_[0] * shiftY + vshift_[1] * decimation_); // a
1807 case 1:
1808 return v + (shiftX - vshift_[0] * shiftY - vshift_[1] * decimation_); // b
1809 case 2:
1810 return v - vshift_[1] * decimation_; // c
1811 case 3:
1812 return v + (shiftX - vshift_[1] * decimation_); // d
1813 case 4:
1814 return v - vshift_[0] * shiftY; // e
1815 case 5:
1816 return v + (shiftX - vshift_[0] * shiftY); // f
1817 case 6:
1818 return v + shiftX; // h
1819 case 7:
1820 return v + vshift_[1] * shiftZ; // V(c)::{g}
1821 }
1822 return -1;
1823}
1824
1826 const SimplexId v,
1827 const SimplexId neighborId,
1828 const SimplexId shiftX,
1829 const SimplexId shiftY,
1830 const SimplexId shiftZ) const {
1831 // V(dh)=V(d)+V(h)::{b,d}
1832 if(neighborId == v - vshift_[0] * shiftY)
1833 return 0; // b
1834 else if(neighborId == v - shiftX)
1835 return 1; // c
1836 else if(neighborId == v + (vshift_[1] * shiftZ - shiftX))
1837 return 2; // g
1838 else if(neighborId == v + vshift_[1] * shiftZ)
1839 return 3; // h
1840 else if(neighborId == v - (vshift_[0] * shiftY + vshift_[1] * decimation_))
1841 return 4; // V(h)::{b}
1842 else if(neighborId == v - vshift_[1] * decimation_)
1843 return 5; // V(h)::{d}
1844 return -1;
1845}
1846inline ttk::SimplexId
1848 const int id,
1849 const SimplexId shiftX,
1850 const SimplexId shiftY,
1851 const SimplexId shiftZ) const {
1852 // V(dh)=V(d)+V(h)::{b,d}
1853 switch(id) {
1854 case 0:
1855 return v - vshift_[0] * shiftY; // b
1856 case 1:
1857 return v - shiftX; // c
1858 case 2:
1859 return v + (vshift_[1] * shiftZ - shiftX); // g
1860 case 3:
1861 return v + vshift_[1] * shiftZ; // h
1862 case 4:
1863 return v - (vshift_[0] * shiftY + vshift_[1] * decimation_); // V(h)::{b}
1864 case 5:
1865 return v - vshift_[1] * decimation_; // V(h)::{d}
1866 }
1867 return -1;
1868}
1869
1871 const SimplexId v,
1872 const SimplexId neighborId,
1873 const SimplexId shiftX,
1874 const SimplexId shiftY,
1875 const SimplexId shiftZ) const {
1876 // V(abdc)=V(b)+V(d)::{b}+V(c)::{b}+V(a)::{b}
1877 if(neighborId == v - decimation_)
1878 return 0;
1879 else if(neighborId == v + (vshift_[0] * shiftY - decimation_)) // c
1880 return 1;
1881 else if(neighborId == v + vshift_[0] * shiftY) // d
1882 return 2;
1883 else if(neighborId == v + (vshift_[1] * shiftZ - decimation_)) // e
1884 return 3;
1885 else if(neighborId == v + vshift_[1] * shiftZ) // f
1886 return 4;
1887 else if(neighborId
1888 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - decimation_)) // g
1889 return 5;
1890 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ)) // h
1891 return 6;
1892 else if(neighborId == v - vshift_[0] * decimation_) // V(d)::{b}
1893 return 7;
1894 else if(neighborId == v + (shiftX - vshift_[0] * decimation_)) // V(c)::{b}
1895 return 8;
1896 else if(neighborId == v + shiftX) // V(a)::{b}
1897 return 9;
1898 return -1;
1899}
1900
1901inline ttk::SimplexId
1903 const int id,
1904 const SimplexId shiftX,
1905 const SimplexId shiftY,
1906 const SimplexId shiftZ) const {
1907 // V(abdc)=V(b)+V(d)::{b}+V(c)::{b}+V(a)::{b}
1908 switch(id) {
1909 case 0:
1910 return v - decimation_; // a
1911 case 1:
1912 return v + (vshift_[0] * shiftY - decimation_); // c
1913 case 2:
1914 return v + vshift_[0] * shiftY; // d
1915 case 3:
1916 return v + (vshift_[1] * shiftZ - decimation_); // e
1917 case 4:
1918 return v + vshift_[1] * shiftZ; // f
1919 case 5:
1920 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - decimation_); // g
1921 case 6:
1922 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // h
1923 case 7:
1924 return v - vshift_[0] * decimation_; // V(d)::{b}
1925 case 8:
1926 return v + (shiftX - vshift_[0] * decimation_); // V(c)::{b}
1927 case 9:
1928 return v + shiftX; // V(a)::{b}
1929 }
1930 return -1;
1931}
1932
1934 const SimplexId v,
1935 const SimplexId neighborId,
1936 const SimplexId shiftX,
1937 const SimplexId shiftY,
1938 const SimplexId shiftZ) const {
1939 // V(efhg)=V(g)+V(h)::{g}+V(f)::{g,h}
1940 if(neighborId == v - (vshift_[0] * decimation_ + vshift_[1] * shiftZ))
1941 return 0; // a
1942 else if(neighborId
1943 == v + (shiftX - vshift_[0] * decimation_ - vshift_[1] * shiftZ))
1944 return 1; // b
1945 else if(neighborId == v - vshift_[1] * shiftZ)
1946 return 2; // c
1947 else if(neighborId == v + (shiftX - vshift_[1] * shiftZ))
1948 return 3; // d
1949 else if(neighborId == v - vshift_[0] * decimation_)
1950 return 4; // e
1951 else if(neighborId == v + (shiftX - vshift_[0] * decimation_))
1952 return 5; // f
1953 else if(neighborId == v + shiftX)
1954 return 6; // h
1955 else if(neighborId == v - decimation_)
1956 return 7; // V(h)::{g}
1957 else if(neighborId == v + (vshift_[0] * shiftY - decimation_))
1958 return 8; // V(f)::{g}
1959 else if(neighborId == v + vshift_[0] * shiftY)
1960 return 9; // V(f)::{h}
1961 return -1;
1962}
1963inline ttk::SimplexId
1965 const int id,
1966 const SimplexId shiftX,
1967 const SimplexId shiftY,
1968 const SimplexId shiftZ) const {
1969 // V(efhg)=V(g)+V(h)::{g}+V(f)::{g,h}
1970 switch(id) {
1971 case 0:
1972 return v - (vshift_[0] * decimation_ + vshift_[1] * shiftZ); // a
1973 case 1:
1974 return v + (shiftX - vshift_[0] * decimation_ - vshift_[1] * shiftZ); // b
1975 case 2:
1976 return v - vshift_[1] * shiftZ; // c
1977 case 3:
1978 return v + (shiftX - vshift_[1] * shiftZ); // d
1979 case 4:
1980 return v - vshift_[0] * decimation_; // e
1981 case 5:
1982 return v + (shiftX - vshift_[0] * decimation_); // f
1983 case 6:
1984 return v + shiftX; // h
1985 case 7:
1986 return v - decimation_; // V(h)::{g}
1987 case 8:
1988 return v + (vshift_[0] * shiftY - decimation_); // V(f)::{g}
1989 case 9:
1990 return v + vshift_[0] * shiftY; // V(f)::{h}
1991 }
1992 return -1;
1993}
1994
1996 const SimplexId v,
1997 const SimplexId neighborId,
1998 const SimplexId shiftX,
1999 const SimplexId shiftY,
2000 const SimplexId shiftZ) const {
2001 // V(aegc)=V(g)+V(a)::{c,g}+V(c)::{g}
2002 if(neighborId == v - (vshift_[0] * decimation_ + vshift_[1] * decimation_))
2003 return 0; // a
2004 else if(neighborId
2005 == v + (shiftX - vshift_[0] * decimation_ - vshift_[1] * decimation_))
2006 return 1; // b
2007 else if(neighborId == v - vshift_[1] * decimation_)
2008 return 2; // c
2009 else if(neighborId == v + (shiftX - vshift_[1] * decimation_))
2010 return 3; // d
2011 else if(neighborId == v - vshift_[0] * decimation_)
2012 return 4; // e
2013 else if(neighborId == v + (shiftX - vshift_[0] * decimation_))
2014 return 5; // f
2015 else if(neighborId == v + shiftX)
2016 return 6; // h
2017 else if(neighborId == v + vshift_[0] * shiftY)
2018 return 7; // V(a)::{c}
2019 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
2020 return 8; // V(a)::{g}
2021 else if(neighborId == v + vshift_[1] * shiftZ)
2022 return 9; // V(c)::{g}
2023 return -1;
2024}
2025inline ttk::SimplexId
2027 const int id,
2028 const SimplexId shiftX,
2029 const SimplexId shiftY,
2030 const SimplexId shiftZ) const {
2031 // V(aegc)=V(g)+V(a)::{c,g}+V(c)::{g}
2032 switch(id) {
2033 case 0:
2034 return v - (vshift_[0] * decimation_ + vshift_[1] * decimation_); // a
2035 case 1:
2036 return v
2037 + (shiftX - vshift_[0] * decimation_
2038 - vshift_[1] * decimation_); // b
2039 case 2:
2040 return v - vshift_[1] * decimation_; // c
2041 case 3:
2042 return v + (shiftX - vshift_[1] * decimation_); // d
2043 case 4:
2044 return v - vshift_[0] * decimation_; // e
2045 case 5:
2046 return v + (shiftX - vshift_[0] * decimation_); // f
2047 case 6:
2048 return v + shiftX; // h
2049 case 7:
2050 return v + vshift_[0] * shiftY; // V(a)::{c}
2051 case 8:
2052 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // V(a)::{g}
2053 case 9:
2054 return v + vshift_[1] * shiftZ; // V(c)::{g}
2055 }
2056 return -1;
2057}
2058
2060 const SimplexId v,
2061 const SimplexId neighborId,
2062 const SimplexId shiftX,
2063 const SimplexId shiftY,
2064 const SimplexId shiftZ) const {
2065 // V(bfhd)=V(b)+V(f)::{b}+V(h)::{b}+V(d)::{b}
2066 if(neighborId == v - shiftX)
2067 return 0; // a
2068 else if(neighborId == v + (vshift_[0] * shiftY - shiftX))
2069 return 1; // c
2070 else if(neighborId == v + vshift_[0] * shiftY)
2071 return 2; // d
2072 else if(neighborId == v + (vshift_[1] * shiftZ - shiftX))
2073 return 3; // e
2074 else if(neighborId == v + vshift_[1] * shiftZ)
2075 return 4; // f
2076 else if(neighborId
2077 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX))
2078 return 5; // g
2079 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
2080 return 6; // h
2081 else if(neighborId == v - vshift_[1] * decimation_)
2082 return 7; // V(f)::{b}
2083 else if(neighborId
2084 == v - (vshift_[0] * decimation_ + vshift_[1] * decimation_))
2085 return 8; // V(h)::{b}
2086 else if(neighborId == v - vshift_[0] * decimation_)
2087 return 9; // V(d)::{b}
2088 return -1;
2089}
2090inline ttk::SimplexId
2092 const int id,
2093 const SimplexId shiftX,
2094 const SimplexId shiftY,
2095 const SimplexId shiftZ) const {
2096 // V(bfhd)=V(b)+V(f)::{b}+V(h)::{b}+V(d)::{b}
2097 switch(id) {
2098 case 0:
2099 return v - shiftX; // a
2100 case 1:
2101 return v + (vshift_[0] * shiftY - shiftX); // c
2102 case 2:
2103 return v + vshift_[0] * shiftY; // d
2104 case 3:
2105 return v + (vshift_[1] * shiftZ - shiftX); // e
2106 case 4:
2107 return v + vshift_[1] * shiftZ; // f
2108 case 5:
2109 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - shiftX); // g
2110 case 6:
2111 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // h
2112 case 7:
2113 return v - vshift_[1] * decimation_; // V(f)::{b}
2114 case 8:
2115 return v
2116 - (vshift_[0] * decimation_
2117 + vshift_[1] * decimation_); // V(h)::{b}
2118 case 9:
2119 return v - vshift_[0] * decimation_; // V(d)::{b}
2120 }
2121 return -1;
2122}
2123
2125 const SimplexId v,
2126 const SimplexId neighborId,
2127 const SimplexId shiftX,
2128 const SimplexId shiftY,
2129 const SimplexId shiftZ) const {
2130 // V(aefb)=V(b)+V(a)::{b}+V(e)::{b}+V(f)::{b}
2131 if(neighborId == v - decimation_)
2132 return 0; // a
2133 else if(neighborId == v + (vshift_[0] * shiftY - decimation_))
2134 return 1; // c
2135 else if(neighborId == v + vshift_[0] * shiftY)
2136 return 2; // d
2137 else if(neighborId == v + (vshift_[1] * shiftZ - decimation_))
2138 return 3; // e
2139 else if(neighborId == v + vshift_[1] * shiftZ)
2140 return 4; // f
2141 else if(neighborId
2142 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - decimation_))
2143 return 5; // g
2144 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
2145 return 6; // h
2146 else if(neighborId == v + shiftX)
2147 return 7; // V(a)::{b}
2148 else if(neighborId == v + (shiftX - vshift_[1] * decimation_))
2149 return 8; // V(e)::{b}
2150 else if(neighborId == v - vshift_[1] * decimation_)
2151 return 9; // V(f)::{b}
2152 return -1;
2153}
2154inline ttk::SimplexId
2156 const int id,
2157 const SimplexId shiftX,
2158 const SimplexId shiftY,
2159 const SimplexId shiftZ) const {
2160 // V(aefb)=V(b)+V(a)::{b}+V(e)::{b}+V(f)::{b}
2161 switch(id) {
2162 case 0:
2163 return v - decimation_; // a
2164 case 1:
2165 return v + (vshift_[0] * shiftY - decimation_); // c
2166 case 2:
2167 return v + vshift_[0] * shiftY; // d
2168 case 3:
2169 return v + (vshift_[1] * shiftZ - decimation_); // e
2170 case 4:
2171 return v + vshift_[1] * shiftZ; // f
2172 case 5:
2173 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - decimation_); // g
2174 case 6:
2175 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // h
2176 case 7:
2177 return v + shiftX; // V(a)::{b}
2178 case 8:
2179 return v + (shiftX - vshift_[1] * decimation_); // V(e)::{b}
2180 case 9:
2181 return v - vshift_[1] * decimation_; // V(f)::{b}
2182 }
2183 return -1;
2184}
2185
2187 const SimplexId v,
2188 const SimplexId neighborId,
2189 const SimplexId shiftX,
2190 const SimplexId shiftY,
2191 const SimplexId shiftZ) const {
2192 // V(ghdc)=V(g)+V(h)::{g}+V(d)::{g,h}
2193 if(neighborId == v - (vshift_[0] * shiftY + vshift_[1] * decimation_))
2194 return 0; // a
2195 else if(neighborId
2196 == v + (shiftX - vshift_[0] * shiftY - vshift_[1] * decimation_))
2197 return 1; // b
2198 else if(neighborId == v - vshift_[1] * decimation_)
2199 return 2; // c
2200 else if(neighborId == v + (shiftX - vshift_[1] * decimation_))
2201 return 3; // d
2202 else if(neighborId == v - vshift_[0] * shiftY)
2203 return 4; // e
2204 else if(neighborId == v + (shiftX - vshift_[0] * shiftY))
2205 return 5; // f
2206 else if(neighborId == v + shiftX)
2207 return 6; // h
2208 else if(neighborId == v - decimation_)
2209 return 7; // V(h)::{g}
2210 else if(neighborId == v + (vshift_[1] * shiftZ - decimation_))
2211 return 8; // V(d)::{g}
2212 else if(neighborId == v + vshift_[1] * shiftZ)
2213 return 9; // V(d)::{h}
2214 return -1;
2215}
2216inline ttk::SimplexId
2218 const int id,
2219 const SimplexId shiftX,
2220 const SimplexId shiftY,
2221 const SimplexId shiftZ) const {
2222 // V(ghdc)=V(g)+V(h)::{g}+V(d)::{g,h}
2223 switch(id) {
2224 case 0:
2225 return v - (vshift_[0] * shiftY + vshift_[1] * decimation_); // a
2226 case 1:
2227 return v + (shiftX - vshift_[0] * shiftY - vshift_[1] * decimation_); // b
2228 case 2:
2229 return v - vshift_[1] * decimation_; // c
2230 case 3:
2231 return v + (shiftX - vshift_[1] * decimation_); // d
2232 case 4:
2233 return v - vshift_[0] * shiftY; // e
2234 case 5:
2235 return v + (shiftX - vshift_[0] * shiftY); // f
2236 case 6:
2237 return v + shiftX; // h
2238 case 7:
2239 return v - decimation_; // V(h)::{g}
2240 case 8:
2241 return v + (vshift_[1] * shiftZ - decimation_); // V(d)::{g}
2242 case 9:
2243 return v + vshift_[1] * shiftZ; // V(d)::{h}
2244 }
2245 return -1;
2246}
2247
2249 const SimplexId v,
2250 const SimplexId neighborId,
2251 const SimplexId shiftX,
2252 const SimplexId shiftY,
2253 const SimplexId shiftZ) const {
2254 // V(abcdefgh)=V(g)+V(d)::{g,h}+V(h)::{g}+V(b)::{c,d,g,h}
2255 if(neighborId == v - (vshift_[0] * decimation_ + vshift_[1] * decimation_))
2256 return 0; // a
2257 else if(neighborId
2258 == v + (shiftX - vshift_[0] * decimation_ - vshift_[1] * decimation_))
2259 return 1; // b
2260 else if(neighborId == v - vshift_[1] * decimation_)
2261 return 2; // c
2262 else if(neighborId == v + (shiftX - vshift_[1] * decimation_))
2263 return 3; // d
2264 else if(neighborId == v - vshift_[0] * decimation_)
2265 return 4; // e
2266 else if(neighborId == v + (shiftX - vshift_[0] * decimation_))
2267 return 5; // f
2268 else if(neighborId == v + shiftX)
2269 return 6; // h
2270 else if(neighborId == v + (vshift_[1] * shiftZ - decimation_))
2271 return 7; // V(d)::{g}
2272 else if(neighborId == v + vshift_[1] * shiftZ)
2273 return 8; // V(d)::{h}
2274 else if(neighborId == v - decimation_)
2275 return 9; // V(h)::{g}
2276 else if(neighborId == v + (vshift_[0] * shiftY - decimation_))
2277 return 10; // V(b)::{c}
2278 else if(neighborId == v + vshift_[0] * shiftY)
2279 return 11; // V(b)::{d}
2280 else if(neighborId
2281 == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ - decimation_))
2282 return 12;
2283 else if(neighborId == v + (vshift_[0] * shiftY + vshift_[1] * shiftZ))
2284 return 13;
2285 return -1;
2286}
2288 const SimplexId v,
2289 const int id,
2290 const SimplexId shiftX,
2291 const SimplexId shiftY,
2292 const SimplexId shiftZ) const {
2293 // V(abcdefgh)=V(g)+V(d)::{g,h}+V(h)::{g}+V(b)::{c,d,g,h}
2294 switch(id) {
2295 case 0:
2296 return v - (vshift_[0] * decimation_ + vshift_[1] * decimation_); // a
2297 case 1:
2298 return v
2299 + (shiftX - vshift_[0] * decimation_
2300 - vshift_[1] * decimation_); // b
2301 case 2:
2302 return v - vshift_[1] * decimation_; // c
2303 case 3:
2304 return v + (shiftX - vshift_[1] * decimation_); // d
2305 case 4:
2306 return v - vshift_[0] * decimation_; // e
2307 case 5:
2308 return v + (shiftX - vshift_[0] * decimation_); // f
2309 case 6:
2310 return v + shiftX; // h
2311 case 7:
2312 return v + (vshift_[1] * shiftZ - decimation_); // V(d)::{g}
2313 case 8:
2314 return v + vshift_[1] * shiftZ; // V(d)::{h}
2315 case 9:
2316 return v - decimation_; // V(h)::{g}
2317 case 10:
2318 return v + (vshift_[0] * shiftY - decimation_); // V(b)::{c}
2319 case 11:
2320 return v + vshift_[0] * shiftY; // V(b)::{d}
2321 case 12:
2322 return v
2323 + (vshift_[0] * shiftY + vshift_[1] * shiftZ
2324 - decimation_); // V(b)::{g}
2325 case 13:
2326 return v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // V(b)::{h}
2327 }
2328 return -1;
2329}
2331 const SimplexId v,
2332 const int id,
2333 const SimplexId shiftX,
2334 const SimplexId shiftY,
2335 const SimplexId shiftZ,
2336 SimplexId &invertedLocalNeighbor) const {
2337 // V(abcdefgh)=V(g)+V(d)::{g,h}+V(h)::{g}+V(b)::{c,d,g,h}
2338 SimplexId invertedVertexId = -1;
2339 switch(id) {
2340 case 0:
2341 invertedLocalNeighbor = 13;
2342 invertedVertexId
2343 = v - (vshift_[0] * decimation_ + vshift_[1] * decimation_); // a
2344 break;
2345 case 1:
2346 invertedLocalNeighbor = 12;
2347 invertedVertexId
2348 = v
2349 + (shiftX - vshift_[0] * decimation_ - vshift_[1] * decimation_); // b
2350 break;
2351 case 2:
2352 invertedLocalNeighbor = 8;
2353 invertedVertexId = v - vshift_[1] * decimation_; // c
2354 break;
2355 case 3:
2356 invertedLocalNeighbor = 7;
2357 invertedVertexId = v + (shiftX - vshift_[1] * decimation_); // d
2358 break;
2359 case 4:
2360 invertedLocalNeighbor = 11;
2361 invertedVertexId = v - vshift_[0] * decimation_; // e
2362 break;
2363 case 5:
2364 invertedLocalNeighbor = 10;
2365 invertedVertexId = v + (shiftX - vshift_[0] * decimation_); // f
2366 break;
2367 case 6:
2368 invertedLocalNeighbor = 9;
2369 invertedVertexId = v + shiftX; // h
2370 break;
2371 case 7:
2372 invertedLocalNeighbor = 3;
2373 invertedVertexId = v + (vshift_[1] * shiftZ - decimation_); // V(d)::{g}
2374 break;
2375 case 8:
2376 invertedLocalNeighbor = 2;
2377 invertedVertexId = v + vshift_[1] * shiftZ; // V(d)::{h}
2378 break;
2379 case 9:
2380 invertedLocalNeighbor = 6;
2381 invertedVertexId = v - decimation_; // V(h)::{g}
2382 break;
2383 case 10:
2384 invertedLocalNeighbor = 5;
2385 invertedVertexId = v + (vshift_[0] * shiftY - decimation_); // V(b)::{c}
2386 break;
2387 case 11:
2388 invertedLocalNeighbor = 4;
2389 invertedVertexId = v + vshift_[0] * shiftY; // V(b)::{d}
2390 break;
2391 case 12:
2392 invertedLocalNeighbor = 1;
2393 invertedVertexId = v
2394 + (vshift_[0] * shiftY + vshift_[1] * shiftZ
2395 - decimation_); // V(b)::{g}
2396 break;
2397 case 13:
2398 invertedLocalNeighbor = 0;
2399 invertedVertexId
2400 = v + (vshift_[0] * shiftY + vshift_[1] * shiftZ); // V(b)::{h}
2401 break;
2402 }
2403 return invertedVertexId;
2404}
2406 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2407 switch(id) {
2408 case 0:
2409 invertedLocalNeighbor = 6;
2410 break;
2411 case 1:
2412 invertedLocalNeighbor = 5;
2413 break;
2414 case 2:
2415 invertedLocalNeighbor = 4;
2416 break;
2417 case 3:
2418 invertedLocalNeighbor = 3;
2419 break;
2420 case 4:
2421 invertedLocalNeighbor = 2;
2422 break;
2423 case 5:
2424 invertedLocalNeighbor = 1;
2425 break;
2426 case 6:
2427 invertedLocalNeighbor = 0;
2428 break;
2429 case 9:
2430 invertedLocalNeighbor = 9;
2431 break;
2432 case 10:
2433 invertedLocalNeighbor = 8;
2434 break;
2435 case 11:
2436 invertedLocalNeighbor = 7;
2437 break;
2438 }
2439}
2440
2442 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2443 switch(id) {
2444 case 13:
2445 invertedLocalNeighbor = 0;
2446 break;
2447 case 12:
2448 invertedLocalNeighbor = 1;
2449 break;
2450 case 8:
2451 invertedLocalNeighbor = 2;
2452 break;
2453 case 7:
2454 invertedLocalNeighbor = 3;
2455 break;
2456 case 11:
2457 invertedLocalNeighbor = 4;
2458 break;
2459 case 10:
2460 invertedLocalNeighbor = 5;
2461 break;
2462 case 9:
2463 invertedLocalNeighbor = 6;
2464 break;
2465 case 6:
2466 invertedLocalNeighbor = 7;
2467 break;
2468 case 5:
2469 invertedLocalNeighbor = 8;
2470 break;
2471 case 4:
2472 invertedLocalNeighbor = 9;
2473 break;
2474 }
2475}
2476
2478 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2479 switch(id) {
2480 case 6:
2481 invertedLocalNeighbor = 0;
2482 break;
2483 case 5:
2484 invertedLocalNeighbor = 1;
2485 break;
2486 case 4:
2487 invertedLocalNeighbor = 2;
2488 break;
2489 case 3:
2490 invertedLocalNeighbor = 3;
2491 break;
2492 case 2:
2493 invertedLocalNeighbor = 4;
2494 break;
2495 case 1:
2496 invertedLocalNeighbor = 5;
2497 break;
2498 case 0:
2499 invertedLocalNeighbor = 6;
2500 break;
2501 case 9:
2502 invertedLocalNeighbor = 7;
2503 break;
2504 case 7:
2505 invertedLocalNeighbor = 8;
2506 break;
2507 case 8:
2508 invertedLocalNeighbor = 9;
2509 break;
2510 }
2511}
2513 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2514 switch(id) {
2515 case 13:
2516 invertedLocalNeighbor = 0;
2517 break;
2518 case 12:
2519 invertedLocalNeighbor = 1;
2520 break;
2521 case 8:
2522 invertedLocalNeighbor = 2;
2523 break;
2524 case 7:
2525 invertedLocalNeighbor = 3;
2526 break;
2527 case 11:
2528 invertedLocalNeighbor = 4;
2529 break;
2530 case 10:
2531 invertedLocalNeighbor = 5;
2532 break;
2533 case 9:
2534 invertedLocalNeighbor = 6;
2535 break;
2536 case 6:
2537 invertedLocalNeighbor = 7;
2538 break;
2539 case 3:
2540 invertedLocalNeighbor = 8;
2541 break;
2542 case 2:
2543 invertedLocalNeighbor = 9;
2544 break;
2545 }
2546}
2548 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2549 switch(id) {
2550 case 13:
2551 invertedLocalNeighbor = 0;
2552 break;
2553 case 12:
2554 invertedLocalNeighbor = 1;
2555 break;
2556 case 8:
2557 invertedLocalNeighbor = 2;
2558 break;
2559 case 7:
2560 invertedLocalNeighbor = 3;
2561 break;
2562 case 11:
2563 invertedLocalNeighbor = 4;
2564 break;
2565 case 10:
2566 invertedLocalNeighbor = 5;
2567 break;
2568 case 9:
2569 invertedLocalNeighbor = 6;
2570 break;
2571 case 4:
2572 invertedLocalNeighbor = 7;
2573 break;
2574 case 0:
2575 invertedLocalNeighbor = 8;
2576 break;
2577 case 2:
2578 invertedLocalNeighbor = 9;
2579 break;
2580 }
2581}
2583 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2584 switch(id) {
2585 case 6:
2586 invertedLocalNeighbor = 0;
2587 break;
2588 case 5:
2589 invertedLocalNeighbor = 1;
2590 break;
2591 case 4:
2592 invertedLocalNeighbor = 2;
2593 break;
2594 case 3:
2595 invertedLocalNeighbor = 3;
2596 break;
2597 case 2:
2598 invertedLocalNeighbor = 4;
2599 break;
2600 case 1:
2601 invertedLocalNeighbor = 5;
2602 break;
2603 case 0:
2604 invertedLocalNeighbor = 6;
2605 break;
2606 case 8:
2607 invertedLocalNeighbor = 7;
2608 break;
2609 case 13:
2610 invertedLocalNeighbor = 8;
2611 break;
2612 case 11:
2613 invertedLocalNeighbor = 9;
2614 break;
2615 }
2616}
2618 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2619 switch(id) {
2620 case 6:
2621 invertedLocalNeighbor = 0;
2622 break;
2623 case 5:
2624 invertedLocalNeighbor = 1;
2625 break;
2626 case 4:
2627 invertedLocalNeighbor = 2;
2628 break;
2629 case 3:
2630 invertedLocalNeighbor = 3;
2631 break;
2632 case 2:
2633 invertedLocalNeighbor = 4;
2634 break;
2635 case 1:
2636 invertedLocalNeighbor = 5;
2637 break;
2638 case 0:
2639 invertedLocalNeighbor = 6;
2640 break;
2641 case 9:
2642 invertedLocalNeighbor = 7;
2643 break;
2644 }
2645}
2647 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2648 switch(id) {
2649 case 8:
2650 invertedLocalNeighbor = 0;
2651 break;
2652 case 6:
2653 invertedLocalNeighbor = 1;
2654 break;
2655 case 5:
2656 invertedLocalNeighbor = 2;
2657 break;
2658 case 4:
2659 invertedLocalNeighbor = 3;
2660 break;
2661 case 7:
2662 invertedLocalNeighbor = 4;
2663 break;
2664 case 9:
2665 invertedLocalNeighbor = 5;
2666 break;
2667 }
2668}
2670 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2671 switch(id) {
2672 case 11:
2673 invertedLocalNeighbor = 0;
2674 break;
2675 case 6:
2676 invertedLocalNeighbor = 1;
2677 break;
2678 case 3:
2679 invertedLocalNeighbor = 2;
2680 break;
2681 case 2:
2682 invertedLocalNeighbor = 3;
2683 break;
2684 case 10:
2685 invertedLocalNeighbor = 4;
2686 break;
2687 case 9:
2688 invertedLocalNeighbor = 5;
2689 break;
2690 }
2691}
2693 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2694 switch(id) {
2695 case 13:
2696 invertedLocalNeighbor = 0;
2697 break;
2698 case 12:
2699 invertedLocalNeighbor = 1;
2700 break;
2701 case 8:
2702 invertedLocalNeighbor = 2;
2703 break;
2704 case 7:
2705 invertedLocalNeighbor = 3;
2706 break;
2707 case 11:
2708 invertedLocalNeighbor = 4;
2709 break;
2710 case 10:
2711 invertedLocalNeighbor = 5;
2712 break;
2713 case 9:
2714 invertedLocalNeighbor = 6;
2715 break;
2716 case 6:
2717 invertedLocalNeighbor = 7;
2718 break;
2719 }
2720}
2722 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2723 switch(id) {
2724 case 11:
2725 invertedLocalNeighbor = 0;
2726 break;
2727 case 10:
2728 invertedLocalNeighbor = 1;
2729 break;
2730 case 9:
2731 invertedLocalNeighbor = 2;
2732 break;
2733 case 2:
2734 invertedLocalNeighbor = 3;
2735 break;
2736 case 4:
2737 invertedLocalNeighbor = 4;
2738 break;
2739 case 0:
2740 invertedLocalNeighbor = 5;
2741 break;
2742 }
2743}
2745 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2746 switch(id) {
2747 case 13:
2748 invertedLocalNeighbor = 0;
2749 break;
2750 case 12:
2751 invertedLocalNeighbor = 1;
2752 break;
2753 case 8:
2754 invertedLocalNeighbor = 2;
2755 break;
2756 case 7:
2757 invertedLocalNeighbor = 3;
2758 break;
2759 case 11:
2760 invertedLocalNeighbor = 4;
2761 break;
2762 case 10:
2763 invertedLocalNeighbor = 5;
2764 break;
2765 case 9:
2766 invertedLocalNeighbor = 6;
2767 break;
2768 case 4:
2769 invertedLocalNeighbor = 7;
2770 break;
2771 }
2772}
2774 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2775 switch(id) {
2776 case 9:
2777 invertedLocalNeighbor = 0;
2778 break;
2779 case 4:
2780 invertedLocalNeighbor = 1;
2781 break;
2782 case 2:
2783 invertedLocalNeighbor = 2;
2784 break;
2785 case 0:
2786 invertedLocalNeighbor = 3;
2787 break;
2788 case 8:
2789 invertedLocalNeighbor = 4;
2790 break;
2791 case 7:
2792 invertedLocalNeighbor = 5;
2793 break;
2794 }
2795}
2797 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2798 switch(id) {
2799 case 13:
2800 invertedLocalNeighbor = 0;
2801 break;
2802 case 12:
2803 invertedLocalNeighbor = 1;
2804 break;
2805 case 8:
2806 invertedLocalNeighbor = 2;
2807 break;
2808 case 7:
2809 invertedLocalNeighbor = 3;
2810 break;
2811 case 11:
2812 invertedLocalNeighbor = 4;
2813 break;
2814 case 10:
2815 invertedLocalNeighbor = 5;
2816 break;
2817 case 9:
2818 invertedLocalNeighbor = 6;
2819 break;
2820 case 2:
2821 invertedLocalNeighbor = 7;
2822 break;
2823 }
2824}
2826 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2827 switch(id) {
2828 case 6:
2829 invertedLocalNeighbor = 0;
2830 break;
2831 case 5:
2832 invertedLocalNeighbor = 1;
2833 break;
2834 case 4:
2835 invertedLocalNeighbor = 2;
2836 break;
2837 case 3:
2838 invertedLocalNeighbor = 3;
2839 break;
2840 case 2:
2841 invertedLocalNeighbor = 4;
2842 break;
2843 case 1:
2844 invertedLocalNeighbor = 5;
2845 break;
2846 case 0:
2847 invertedLocalNeighbor = 6;
2848 break;
2849 case 11:
2850 invertedLocalNeighbor = 7;
2851 break;
2852 }
2853}
2855 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2856 switch(id) {
2857 case 8:
2858 invertedLocalNeighbor = 0;
2859 break;
2860 case 6:
2861 invertedLocalNeighbor = 1;
2862 break;
2863 case 5:
2864 invertedLocalNeighbor = 2;
2865 break;
2866 case 4:
2867 invertedLocalNeighbor = 3;
2868 break;
2869 case 13:
2870 invertedLocalNeighbor = 4;
2871 break;
2872 case 11:
2873 invertedLocalNeighbor = 5;
2874 break;
2875 }
2876}
2878 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2879 switch(id) {
2880 case 6:
2881 invertedLocalNeighbor = 0;
2882 break;
2883 case 5:
2884 invertedLocalNeighbor = 1;
2885 break;
2886 case 4:
2887 invertedLocalNeighbor = 2;
2888 break;
2889 case 3:
2890 invertedLocalNeighbor = 3;
2891 break;
2892 case 2:
2893 invertedLocalNeighbor = 4;
2894 break;
2895 case 1:
2896 invertedLocalNeighbor = 5;
2897 break;
2898 case 0:
2899 invertedLocalNeighbor = 6;
2900 break;
2901 case 8:
2902 invertedLocalNeighbor = 7;
2903 break;
2904 }
2905}
2907 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2908 switch(id) {
2909 case 11:
2910 invertedLocalNeighbor = 0;
2911 break;
2912 case 6:
2913 invertedLocalNeighbor = 1;
2914 break;
2915 case 3:
2916 invertedLocalNeighbor = 2;
2917 break;
2918 case 2:
2919 invertedLocalNeighbor = 3;
2920 break;
2921 case 13:
2922 invertedLocalNeighbor = 4;
2923 break;
2924 case 8:
2925 invertedLocalNeighbor = 5;
2926 break;
2927 }
2928}
2930 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2931 switch(id) {
2932 case 9:
2933 invertedLocalNeighbor = 0;
2934 break;
2935 case 4:
2936 invertedLocalNeighbor = 1;
2937 break;
2938 case 2:
2939 invertedLocalNeighbor = 2;
2940 break;
2941 case 0:
2942 invertedLocalNeighbor = 3;
2943 break;
2944 }
2945}
2947 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2948 switch(id) {
2949 case 8:
2950 invertedLocalNeighbor = 0;
2951 break;
2952 case 7:
2953 invertedLocalNeighbor = 1;
2954 break;
2955 case 9:
2956 invertedLocalNeighbor = 2;
2957 break;
2958 case 4:
2959 invertedLocalNeighbor = 3;
2960 break;
2961 }
2962}
2964 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2965 switch(id) {
2966 case 11:
2967 invertedLocalNeighbor = 0;
2968 break;
2969 case 10:
2970 invertedLocalNeighbor = 1;
2971 break;
2972 case 9:
2973 invertedLocalNeighbor = 2;
2974 break;
2975 case 2:
2976 invertedLocalNeighbor = 3;
2977 break;
2978 }
2979}
2981 SimplexId id, SimplexId &invertedLocalNeighbor) const {
2982 switch(id) {
2983 case 13:
2984 invertedLocalNeighbor = 0;
2985 break;
2986 case 12:
2987 invertedLocalNeighbor = 1;
2988 break;
2989 case 8:
2990 invertedLocalNeighbor = 2;
2991 break;
2992 case 7:
2993 invertedLocalNeighbor = 3;
2994 break;
2995 case 11:
2996 invertedLocalNeighbor = 4;
2997 break;
2998 case 10:
2999 invertedLocalNeighbor = 5;
3000 break;
3001 case 9:
3002 invertedLocalNeighbor = 6;
3003 break;
3004 }
3005}
3007 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3008 switch(id) {
3009 case 6:
3010 invertedLocalNeighbor = 0;
3011 break;
3012 case 5:
3013 invertedLocalNeighbor = 1;
3014 break;
3015 case 4:
3016 invertedLocalNeighbor = 2;
3017 break;
3018 case 3:
3019 invertedLocalNeighbor = 3;
3020 break;
3021 case 2:
3022 invertedLocalNeighbor = 4;
3023 break;
3024 case 1:
3025 invertedLocalNeighbor = 5;
3026 break;
3027 case 0:
3028 invertedLocalNeighbor = 6;
3029 break;
3030 }
3031}
3033 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3034 switch(id) {
3035 case 8:
3036 invertedLocalNeighbor = 0;
3037 break;
3038 case 6:
3039 invertedLocalNeighbor = 1;
3040 break;
3041 case 5:
3042 invertedLocalNeighbor = 2;
3043 break;
3044 case 4:
3045 invertedLocalNeighbor = 3;
3046 break;
3047 }
3048}
3050 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3051 switch(id) {
3052 case 11:
3053 invertedLocalNeighbor = 0;
3054 break;
3055 case 6:
3056 invertedLocalNeighbor = 1;
3057 break;
3058 case 3:
3059 invertedLocalNeighbor = 2;
3060 break;
3061 case 2:
3062 invertedLocalNeighbor = 3;
3063 break;
3064 }
3065}
3067 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3068 switch(id) {
3069 case 13:
3070 invertedLocalNeighbor = 0;
3071 break;
3072 case 8:
3073 invertedLocalNeighbor = 1;
3074 break;
3075 case 11:
3076 invertedLocalNeighbor = 2;
3077 break;
3078 case 6:
3079 invertedLocalNeighbor = 3;
3080 break;
3081 }
3082}
3083
3085 const SimplexId vertex, std::array<SimplexId, 3> &p) const {
3086 p[0] = vertex % vshift_[0];
3087 p[1] = vertex / vshift_[0];
3088}
3089
3091 const SimplexId vertex, std::array<SimplexId, 3> &p) const {
3092 p[0] = vertex % vshift_[0];
3093 p[1] = (vertex % vshift_[1]) / vshift_[0];
3094 p[2] = vertex / vshift_[1];
3095}
3096
3098 bool is_in_triangulation = false;
3099 if(dimensionality_ == 1) {
3100 is_in_triangulation = ((vertexId % decimation_) == 0);
3101 } else if(dimensionality_ == 2) {
3102 std::array<SimplexId, 3> p{};
3103 vertexToPosition2d(vertexId, p);
3104 is_in_triangulation
3105 = ((p[0] % decimation_) == 0) and ((p[1] % decimation_) == 0);
3106 } else if(dimensionality_ == 3) {
3107 std::array<SimplexId, 3> p{};
3108 vertexToPosition(vertexId, p);
3109 is_in_triangulation = ((p[0] % decimation_) == 0)
3110 and ((p[1] % decimation_) == 0)
3111 and ((p[2] % decimation_) == 0);
3112 } else {
3113 this->printErr("Unknown dimension " + std::to_string(dimensionality_));
3114 }
3115 return is_in_triangulation;
3116}
3117
3120 // ID in the decimated grid TO ID in the highest resolution grid
3121 if(decimation_ == 1)
3122 return localId;
3123 SimplexId pLocal[3];
3124 pLocal[0] = localId % gridDecimatedDimensions_[Di_];
3125 pLocal[1]
3126 = (localId
3127 % (gridDecimatedDimensions_[Di_] * gridDecimatedDimensions_[Dj_]))
3128 / gridDecimatedDimensions_[Di_];
3129 pLocal[2]
3130 = localId / (gridDecimatedDimensions_[Di_] * gridDecimatedDimensions_[Dj_]);
3131
3132 SimplexId p0 = pLocal[0] * decimation_;
3133 SimplexId p1 = pLocal[1] * decimation_;
3134 SimplexId p2 = pLocal[2] * decimation_;
3135
3136 if(nbvoxels_[0] % decimation_
3137 and pLocal[0] == gridDecimatedDimensions_[Di_] - 1) {
3138 p0 -= decimation_ - nbvoxels_[0] % decimation_;
3139 }
3140 if(nbvoxels_[1] % decimation_
3141 and pLocal[1] == gridDecimatedDimensions_[Dj_] - 1) {
3142 p1 -= decimation_ - nbvoxels_[1] % decimation_;
3143 }
3144 if(nbvoxels_[2] % decimation_
3145 and pLocal[2] == gridDecimatedDimensions_[2] - 1) {
3146 p2 -= decimation_ - nbvoxels_[2] % decimation_;
3147 }
3148 SimplexId globalId = p0 + p1 * gridDimensions_[0]
3149 + p2 * gridDimensions_[0] * gridDimensions_[1];
3150
3151 return globalId;
3152}
3153
3154// Gets impacted vertices v0 and v1 when a new point pops up on an edge.
3155// Fills the v0 and v1 array with 3 values:
3156// v[0] : the local neighbor index of v0 for vertexId
3157// v[1] : the global index of v0
3158// v[2] : the local neighbor index of vertexId for v0
3160 SimplexId v0[3],
3161 SimplexId v1[3]) {
3162
3163 SimplexId localNeighborId0 = -1, localNeighborId1 = -1;
3164 if(dimensionality_ == 3) {
3165 std::array<SimplexId, 3> p{};
3166 vertexToPosition(vertexId, p);
3167
3168 if(0 < p[0] and p[0] < nbvoxels_[0]) {
3169 if(0 < p[1] and p[1] < nbvoxels_[1]) {
3170 if(0 < p[2] and p[2] < nbvoxels_[2])
3171 getImpactedVerticesABCDEFGH(p, localNeighborId0,
3172 localNeighborId1); //
3173 else if(p[2] == 0)
3174 getImpactedVerticesABDC(p, localNeighborId0, localNeighborId1); //
3175 else
3176 getImpactedVerticesEFHG(p, localNeighborId0, localNeighborId1); //
3177 } else if(p[1] == 0) {
3178 if(0 < p[2] and p[2] < nbvoxels_[2])
3179 getImpactedVerticesAEFB(p, localNeighborId0, localNeighborId1); //
3180 else if(p[2] == 0)
3181 getImpactedVerticesAB(p, localNeighborId0, localNeighborId1); //
3182 else
3183 getImpactedVerticesEF(p, localNeighborId0, localNeighborId1); //
3184 } else {
3185 if(0 < p[2] and p[2] < nbvoxels_[2])
3186 getImpactedVerticesGHDC(p, localNeighborId0, localNeighborId1); //
3187 else if(p[2] == 0)
3188 getImpactedVerticesCD(p, localNeighborId0, localNeighborId1); //
3189 else
3190 getImpactedVerticesGH(p, localNeighborId0, localNeighborId1); //
3191 }
3192 } else if(p[0] == 0) {
3193 if(0 < p[1] and p[1] < nbvoxels_[1]) {
3194 if(0 < p[2] and p[2] < nbvoxels_[2])
3195 getImpactedVerticesAEGC(p, localNeighborId0, localNeighborId1); //
3196 else if(p[2] == 0)
3197 getImpactedVerticesAC(p, localNeighborId0,
3198 localNeighborId1); //
3199 else
3200 getImpactedVerticesEG(p, localNeighborId0,
3201 localNeighborId1); //
3202 } else if(p[1] == 0) {
3203 if(0 < p[2] and p[2] < nbvoxels_[2])
3204 getImpactedVerticesAE(p, localNeighborId0,
3205 localNeighborId1); //
3206 } else {
3207 if(0 < p[2] and p[2] < nbvoxels_[2])
3208 getImpactedVerticesCG(p, localNeighborId0,
3209 localNeighborId1); //
3210 }
3211 } else {
3212 if(0 < p[1] and p[1] < nbvoxels_[1]) {
3213 if(0 < p[2] and p[2] < nbvoxels_[2])
3214 getImpactedVerticesBFHD(p, localNeighborId0,
3215 localNeighborId1); //
3216 else if(p[2] == 0)
3217 getImpactedVerticesBD(p, localNeighborId0,
3218 localNeighborId1); //
3219 else
3220 getImpactedVerticesFH(p, localNeighborId0,
3221 localNeighborId1); //
3222 } else if(p[1] == 0) {
3223 if(0 < p[2] and p[2] < nbvoxels_[2])
3224 getImpactedVerticesBF(p, localNeighborId0,
3225 localNeighborId1); //
3226 } else {
3227 if(0 < p[2] and p[2] < nbvoxels_[2])
3228 getImpactedVerticesDH(p, localNeighborId0,
3229 localNeighborId1); //
3230 }
3231 }
3232
3233 } else if(dimensionality_ == 2) {
3234 std::array<SimplexId, 3> p{};
3235 vertexToPosition2d(vertexId, p);
3236
3237 if(0 < p[0] and p[0] < nbvoxels_[Di_]) {
3238 if(0 < p[1] and p[1] < nbvoxels_[Dj_]) {
3239 getImpactedVertices2dABCD(p, localNeighborId0,
3240 localNeighborId1); // abcd
3241 } else if(p[1] == 0) {
3242 getImpactedVertices2dAB(p, localNeighborId0,
3243 localNeighborId1); // ab
3244 } else {
3245 getImpactedVertices2dCD(p, localNeighborId0,
3246 localNeighborId1); // cd
3247 }
3248 } else if(p[0] == 0) {
3249 if(0 < p[1] and p[1] < nbvoxels_[Dj_]) {
3250 getImpactedVertices2dAC(p, localNeighborId0,
3251 localNeighborId1); // ac
3252 }
3253 } else {
3254 if(0 < p[1] and p[1] < nbvoxels_[Dj_]) {
3255 getImpactedVertices2dBD(p, localNeighborId0,
3256 localNeighborId1); // bd
3257 }
3258 }
3259 } else {
3260 this->printWrn("getImpactedVertices not implemented for 1D yet");
3261 }
3262 v0[0] = localNeighborId0;
3263 v1[0] = localNeighborId1;
3264 getVertexNeighbor(vertexId, v0[0], v0[1]);
3265 getVertexNeighbor(vertexId, v1[0], v1[1]);
3266 getInvertVertexNeighbor(v0[1], vertexId, v0[2]);
3267 getInvertVertexNeighbor(v1[1], vertexId, v1[2]);
3268}
3269
3271 SimplexId vertexId) {
3272 this->printMsg("BOUNDARY CASES TO TAKE CARE OF");
3273
3274 SimplexId pLocalNeighbor[3];
3275 pLocalNeighbor[0] = neighborId % gridDecimatedDimensions_[Di_];
3276 pLocalNeighbor[1]
3277 = (neighborId
3278 % (gridDecimatedDimensions_[Di_] * gridDecimatedDimensions_[Dj_]))
3279 / gridDecimatedDimensions_[Di_];
3280 pLocalNeighbor[2]
3281 = neighborId
3282 / (gridDecimatedDimensions_[Di_] * gridDecimatedDimensions_[Dj_]);
3283
3284 SimplexId pLocalVertex[3];
3285 pLocalVertex[0] = vertexId % gridDecimatedDimensions_[Di_];
3286 pLocalVertex[1]
3287 = (vertexId
3288 % (gridDecimatedDimensions_[Di_] * gridDecimatedDimensions_[Dj_]))
3289 / gridDecimatedDimensions_[Di_];
3290 pLocalVertex[2]
3291 = vertexId
3292 / (gridDecimatedDimensions_[Di_] * gridDecimatedDimensions_[Dj_]);
3293
3294 int localNeighbor = -1;
3295
3296 if(dimensionality_ == 2) {
3297 if(pLocalNeighbor[0] == pLocalVertex[0]) {
3298 if(pLocalNeighbor[1] == pLocalVertex[1]) {
3299 this->printErr("localNeighbor: not a neighbor!");
3300 } else if(pLocalNeighbor[1] == pLocalVertex[1] + 1) {
3301 localNeighbor = 4;
3302 } else if(pLocalNeighbor[1] == pLocalVertex[1] - 1) {
3303 localNeighbor = 1;
3304 }
3305 } else if(pLocalNeighbor[0] == pLocalVertex[0] + 1) {
3306 if(pLocalNeighbor[1] == pLocalVertex[1]) {
3307 localNeighbor = 3;
3308 } else if(pLocalNeighbor[1] == pLocalVertex[1] - 1) {
3309 localNeighbor = 2;
3310 } else {
3311 this->printErr("localNeighbor: not a neighbor!");
3312 }
3313 } else if(pLocalNeighbor[0] == pLocalVertex[0] - 1) {
3314 if(pLocalNeighbor[1] == pLocalVertex[1]) {
3315 localNeighbor = 0;
3316 } else if(pLocalNeighbor[1] == pLocalVertex[1] + 1) {
3317 localNeighbor = 5;
3318 } else {
3319 this->printErr("localNeighbor: not a neighbor!");
3320 }
3321 } else {
3322 this->printErr("localNeighbor: not a neighbor!");
3323 }
3324 } else if(dimensionality_ == 3) {
3325 this->printWrn("Local neighbors ids not implemented yet for 3D");
3326 }
3327
3328 return localNeighbor;
3329}
3330
3332 SimplexId vertexId,
3333 SimplexId localNeighborId,
3334 SimplexId &invertedVertexId,
3335 SimplexId &invertedLocalNeighborId) const {
3336
3337 if(dimensionality_ == 3) {
3338 std::array<SimplexId, 3> p{};
3339 vertexToPosition(vertexId, p);
3340 SimplexId shiftX = decimation_;
3341 SimplexId shiftY = decimation_;
3342 SimplexId shiftZ = decimation_;
3343
3344 if((nbvoxels_[0] % decimation_) and (p[0] + decimation_ > nbvoxels_[0])) {
3345 shiftX = nbvoxels_[0] % decimation_;
3346 }
3347 if((nbvoxels_[1] % decimation_) and (p[1] + decimation_ > nbvoxels_[1])) {
3348 shiftY = nbvoxels_[1] % decimation_;
3349 }
3350 if((nbvoxels_[2] % decimation_) and (p[2] + decimation_ > nbvoxels_[2])) {
3351 shiftZ = nbvoxels_[2] % decimation_;
3352 }
3353 invertedVertexId = getInvertedVertexNeighborABCDEFGH(
3354 vertexId, localNeighborId, shiftX, shiftY, shiftZ,
3355 invertedLocalNeighborId); //
3356
3357 if(decimation_ < p[0] and p[0] < nbvoxels_[0] - shiftX) {
3358 if(decimation_ < p[1] and p[1] < nbvoxels_[1] - shiftY) {
3359 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ) {
3360 // do nothing
3361 return 0;
3362 } else if(p[2] == decimation_)
3363 getInvertedLocalNeighborABDC(vertexId, invertedLocalNeighborId);
3364 // boundary = 0;
3365 else
3366 getInvertedLocalNeighborEFHG(vertexId, invertedLocalNeighborId);
3367 // boundary = 1;
3368 } else if(p[1] == decimation_) {
3369 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3370 getInvertedLocalNeighborAEFB(vertexId, invertedLocalNeighborId);
3371 // boundary = 2;
3372 else if(p[2] == decimation_)
3373 getInvertedLocalNeighborAB(vertexId, invertedLocalNeighborId);
3374 // boundary = 6;
3375 else
3376 getInvertedLocalNeighborEF(vertexId, invertedLocalNeighborId);
3377 // boundary = 7;
3378 } else {
3379 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3380 getInvertedLocalNeighborGHDC(vertexId, invertedLocalNeighborId);
3381 // boundary=3;
3382 else if(p[2] == decimation_)
3383 getInvertedLocalNeighborCD(vertexId, invertedLocalNeighborId);
3384 // boundary = 8;
3385 else
3386 getInvertedLocalNeighborGH(vertexId, invertedLocalNeighborId);
3387 // boundary = 9;
3388 }
3389 } else if(p[0] == decimation_) {
3390 if(decimation_ < p[1] and p[1] < nbvoxels_[1] - shiftY) {
3391 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3392 getInvertedLocalNeighborAEGC(vertexId, invertedLocalNeighborId);
3393 // boundary = 4;
3394 else if(p[2] == decimation_)
3395 getInvertedLocalNeighborAC(vertexId, invertedLocalNeighborId);
3396 // boundary = 10;
3397 else
3398 getInvertedLocalNeighborEG(vertexId, invertedLocalNeighborId);
3399 // boundary = 11;
3400 } else if(p[1] == decimation_) {
3401 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3402 getInvertedLocalNeighborAE(vertexId, invertedLocalNeighborId);
3403 // boundary = 12;
3404 else if(p[2] == decimation_)
3405 getInvertedLocalNeighborA(vertexId, invertedLocalNeighborId);
3406 // boundary = 19;
3407 else
3408 getInvertedLocalNeighborE(vertexId, invertedLocalNeighborId);
3409 // boundary = 18;
3410 } else {
3411 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3412 // boundary = 13;
3413 getInvertedLocalNeighborCG(vertexId, invertedLocalNeighborId);
3414 else if(p[2] == decimation_)
3415 getInvertedLocalNeighborC(vertexId, invertedLocalNeighborId);
3416 // boundary = 20;
3417 else
3418 getInvertedLocalNeighborG(vertexId, invertedLocalNeighborId);
3419 // boundary = 21;
3420 }
3421 } else {
3422 if(decimation_ < p[1] and p[1] < nbvoxels_[1] - shiftY) {
3423 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3424 getInvertedLocalNeighborBFHD(vertexId, invertedLocalNeighborId);
3425 // boundary = 5;
3426 else if(p[2] == decimation_)
3427 getInvertedLocalNeighborBD(vertexId, invertedLocalNeighborId);
3428 // boundary = 14;
3429 else
3430 getInvertedLocalNeighborFH(vertexId, invertedLocalNeighborId);
3431 // boundary = 15;
3432 } else if(p[1] == decimation_) {
3433 if(0 < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3434 getInvertedLocalNeighborBF(vertexId, invertedLocalNeighborId);
3435 // boundary = 16;
3436 else if(p[2] == decimation_)
3437 getInvertedLocalNeighborB(vertexId, invertedLocalNeighborId);
3438 // boundary = 22;
3439 else
3440 getInvertedLocalNeighborF(vertexId, invertedLocalNeighborId);
3441 // boundary = 23;
3442 } else {
3443 if(decimation_ < p[2] and p[2] < nbvoxels_[2] - shiftZ)
3444 getInvertedLocalNeighborDH(vertexId, invertedLocalNeighborId);
3445 // boundary = 17;
3446 else if(p[2] == decimation_)
3447 getInvertedLocalNeighborD(vertexId, invertedLocalNeighborId);
3448 // boundary = 24;
3449 else
3450 getInvertedLocalNeighborH(vertexId, invertedLocalNeighborId);
3451 // boundary = 25;
3452 }
3453 }
3454 return -1;
3455
3456 } else if(dimensionality_ == 2) {
3457 std::array<SimplexId, 3> p{};
3458 vertexToPosition2d(vertexId, p);
3459 SimplexId shiftX = decimation_;
3460 SimplexId shiftY = decimation_;
3461
3462 if((nbvoxels_[Di_] % decimation_)
3463 and (p[0] + decimation_ > nbvoxels_[Di_])) {
3464 shiftX = nbvoxels_[0] % decimation_;
3465 }
3466 if((nbvoxels_[Dj_] % decimation_)
3467 and (p[1] + decimation_ > nbvoxels_[Dj_])) {
3468 shiftY = nbvoxels_[1] % decimation_;
3469 }
3470
3471 invertedVertexId = getInvertedVertexNeighbor2dABCD(
3472 vertexId, localNeighborId, shiftX, shiftY,
3473 invertedLocalNeighborId); // abcd
3474
3475 if(0 < p[0] and p[0] < nbvoxels_[Di_] - shiftX) {
3476 if(decimation_ < p[1] and p[1] < nbvoxels_[Dj_]) {
3477 // nothing to do here
3478 } else if(p[1] == decimation_) {
3479 getInvertedLocalNeighbor2dAB(vertexId, invertedLocalNeighborId);
3480 } else {
3481 getInvertedLocalNeighbor2dCD(vertexId, invertedLocalNeighborId); // cd
3482 }
3483 } else if(p[0] == decimation_) {
3484 if(decimation_ < p[1] and p[1] < nbvoxels_[Dj_] - shiftY) {
3485 getInvertedLocalNeighbor2dAC(vertexId, invertedLocalNeighborId); // ac
3486 } else if(p[1] == decimation_) {
3487 getInvertedLocalNeighbor2dA(vertexId, invertedLocalNeighborId); // a
3488 } else {
3489 getInvertedLocalNeighbor2dC(vertexId, invertedLocalNeighborId); // c
3490 }
3491 } else {
3492 if(decimation_ < p[1] and p[1] < nbvoxels_[Dj_] - shiftY) {
3493 getInvertedLocalNeighbor2dBD(vertexId, invertedLocalNeighborId); // bd
3494 } else if(p[1] == decimation_) {
3495 getInvertedLocalNeighbor2dB(vertexId, invertedLocalNeighborId); // b
3496 } else {
3497 getInvertedLocalNeighbor2dD(vertexId, invertedLocalNeighborId); // d
3498 }
3499 }
3500 } else if(dimensionality_ == 1) {
3501 // ab
3502 this->printWrn("NOT TESTED IN 1D");
3503 if(vertexId > decimation_ and vertexId < nbvoxels_[Di_]) {
3504 if(localNeighborId == decimation_)
3505 invertedVertexId = vertexId + decimation_;
3506 else
3507 invertedVertexId = vertexId - decimation_;
3508 } else if(vertexId == decimation_)
3509 invertedVertexId = vertexId + decimation_;
3510 else
3511 invertedVertexId = vertexId - decimation_;
3512 }
3513 return 0;
3514}
3515
3517 const SimplexId v,
3518 const int id,
3519 const SimplexId shiftX,
3520 const SimplexId shiftY,
3521 SimplexId &invertedLocalNeighbor) const {
3522 SimplexId invertedVertexId = -1;
3523 switch(id) {
3524 case 0:
3525 invertedLocalNeighbor = 3;
3526 invertedVertexId = v - decimation_;
3527 break;
3528 case 1:
3529 invertedLocalNeighbor = 4;
3530 invertedVertexId = v - gridDimensions_[Di_] * decimation_;
3531 break;
3532 case 2:
3533 invertedLocalNeighbor = 5;
3534 invertedVertexId = v + (shiftX - gridDimensions_[Di_] * decimation_);
3535 break;
3536 case 3:
3537 invertedLocalNeighbor = 0;
3538 invertedVertexId = v + shiftX;
3539 break;
3540 case 4:
3541 invertedLocalNeighbor = 1;
3542 invertedVertexId = v + gridDimensions_[Di_] * shiftY;
3543 break;
3544 case 5:
3545 invertedLocalNeighbor = 2;
3546 invertedVertexId = v + (gridDimensions_[Di_] * shiftY - decimation_);
3547 break;
3548 }
3549 return invertedVertexId;
3550}
3551
3553 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3554 switch(id) {
3555 case 0:
3556 invertedLocalNeighbor = 0;
3557 break;
3558 case 1:
3559 invertedLocalNeighbor = 1;
3560 break;
3561 }
3562 return 0;
3563}
3564
3566 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3567 switch(id) {
3568 case 3:
3569 invertedLocalNeighbor = 0;
3570 break;
3571 case 1:
3572 invertedLocalNeighbor = 1;
3573 break;
3574 case 2:
3575 invertedLocalNeighbor = 2;
3576 break;
3577 }
3578 return 0;
3579}
3580
3582 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3583 switch(id) {
3584 case 0:
3585 invertedLocalNeighbor = 0;
3586 break;
3587 case 4:
3588 invertedLocalNeighbor = 1;
3589 break;
3590 case 5:
3591 invertedLocalNeighbor = 2;
3592 break;
3593 }
3594 return 0;
3595}
3596
3598 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3599 switch(id) {
3600 case 3:
3601 invertedLocalNeighbor = 0;
3602 break;
3603 case 4:
3604 invertedLocalNeighbor = 1;
3605 break;
3606 }
3607 return 0;
3608}
3609
3611 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3612 switch(id) {
3613 case 3:
3614 invertedLocalNeighbor = 0;
3615 break;
3616 case 2:
3617 invertedLocalNeighbor = 1;
3618 break;
3619 case 1:
3620 invertedLocalNeighbor = 2;
3621 break;
3622 case 0:
3623 invertedLocalNeighbor = 3;
3624 break;
3625 }
3626 return 0;
3627}
3628
3630 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3631 switch(id) {
3632 case 4:
3633 invertedLocalNeighbor = 0;
3634 break;
3635 case 5:
3636 invertedLocalNeighbor = 1;
3637 break;
3638 case 0:
3639 invertedLocalNeighbor = 2;
3640 break;
3641 case 1:
3642 invertedLocalNeighbor = 3;
3643 break;
3644 }
3645 return 0;
3646}
3647
3649 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3650 switch(id) {
3651 case 2:
3652 invertedLocalNeighbor = 0;
3653 break;
3654 case 1:
3655 invertedLocalNeighbor = 1;
3656 break;
3657 case 4:
3658 invertedLocalNeighbor = 2;
3659 break;
3660 case 3:
3661 invertedLocalNeighbor = 3;
3662 break;
3663 }
3664 return 0;
3665}
3666
3668 SimplexId id, SimplexId &invertedLocalNeighbor) const {
3669 switch(id) {
3670 case 3:
3671 invertedLocalNeighbor = 0;
3672 break;
3673 case 2:
3674 invertedLocalNeighbor = 1;
3675 break;
3676 case 1:
3677 invertedLocalNeighbor = 2;
3678 break;
3679 case 0:
3680 invertedLocalNeighbor = 3;
3681 break;
3682 }
3683 return 0;
3684}
3685
3687 const int prev_decim, const std::array<SimplexId, 3> &p) const {
3688 this->printErr("THIS SHOULDNT HAPPEN");
3689 this->printErr("previous decimation: " + std::to_string(prev_decim));
3690 this->printErr("position: " + std::to_string(p[0]) + " "
3691 + std::to_string(p[1]) + " " + std::to_string(p[2]));
3692 this->printErr("grid size: " + std::to_string(gridDimensions_[0]) + " "
3693 + std::to_string(gridDimensions_[1]) + " "
3694 + std::to_string(gridDimensions_[2]));
3695}
3696
3698 std::array<SimplexId, 3> &p,
3699 SimplexId &localNeighborId0,
3700 SimplexId &localNeighborId1) const {
3701
3702 int previous_decimation = pow(2, (decimationLevel_ + 1));
3703 if((p[0] % previous_decimation) and (p[1] % previous_decimation)
3704 and (p[2] % previous_decimation)) {
3705 localNeighborId0 = 1;
3706 localNeighborId1 = 12;
3707
3708 } else if((p[0] % previous_decimation) and (p[1] % previous_decimation)) {
3709 localNeighborId0 = 5;
3710 localNeighborId1 = 10;
3711 } else if((p[0] % previous_decimation) and (p[2] % previous_decimation)) {
3712 localNeighborId0 = 3;
3713 localNeighborId1 = 7;
3714
3715 } else if((p[1] % previous_decimation) and (p[2] % previous_decimation)) {
3716 localNeighborId0 = 0;
3717 localNeighborId1 = 13;
3718
3719 } else if(p[0] % previous_decimation) {
3720 localNeighborId0 = 6;
3721 localNeighborId1 = 9;
3722
3723 } else if(p[1] % previous_decimation) {
3724 localNeighborId0 = 4;
3725 localNeighborId1 = 11;
3726
3727 } else if(p[2] % previous_decimation) {
3728 localNeighborId0 = 2;
3729 localNeighborId1 = 8;
3730 } else {
3731 this->getImpactedVerticesError(previous_decimation, p);
3732 }
3733}
3734
3736 std::array<SimplexId, 3> &p,
3737 SimplexId &localNeighborId0,
3738 SimplexId &localNeighborId1) const {
3739 int previous_decimation = pow(2, (decimationLevel_ + 1));
3740
3741 if((p[0] % previous_decimation) and (p[1] % previous_decimation)) {
3742 localNeighborId0 = 1;
3743 localNeighborId1 = 8;
3744
3745 } else if(p[0] % previous_decimation) {
3746 localNeighborId0 = 0;
3747 localNeighborId1 = 9;
3748
3749 } else if(p[1] % previous_decimation) {
3750 localNeighborId0 = 2;
3751 localNeighborId1 = 7;
3752
3753 } else {
3754 this->getImpactedVerticesError(previous_decimation, p);
3755 }
3756}
3758 std::array<SimplexId, 3> &p,
3759 SimplexId &localNeighborId0,
3760 SimplexId &localNeighborId1) const {
3761 int previous_decimation = pow(2, (decimationLevel_ + 1));
3762
3763 if((p[0] % previous_decimation) and (p[1] % previous_decimation)) {
3764 localNeighborId0 = 5;
3765 localNeighborId1 = 8;
3766
3767 } else if(p[0] % previous_decimation) {
3768 localNeighborId0 = 7;
3769 localNeighborId1 = 6;
3770
3771 } else if(p[1] % previous_decimation) {
3772 localNeighborId0 = 4;
3773 localNeighborId1 = 9;
3774
3775 } else {
3776 this->getImpactedVerticesError(previous_decimation, p);
3777 }
3778}
3780 std::array<SimplexId, 3> &p,
3781 SimplexId &localNeighborId0,
3782 SimplexId &localNeighborId1) const {
3783 int previous_decimation = pow(2, (decimationLevel_ + 1));
3784
3785 if((p[1] % previous_decimation) and (p[2] % previous_decimation)) {
3786 localNeighborId0 = 0;
3787 localNeighborId1 = 8;
3788
3789 } else if(p[1] % previous_decimation) {
3790 localNeighborId0 = 4;
3791 localNeighborId1 = 7;
3792
3793 } else if(p[2] % previous_decimation) {
3794 localNeighborId0 = 2;
3795 localNeighborId1 = 9;
3796 } else {
3797 this->getImpactedVerticesError(previous_decimation, p);
3798 }
3799}
3801 std::array<SimplexId, 3> &p,
3802 SimplexId &localNeighborId0,
3803 SimplexId &localNeighborId1) const {
3804 int previous_decimation = pow(2, (decimationLevel_ + 1));
3805
3806 if((p[1] % previous_decimation) and (p[2] % previous_decimation)) {
3807 localNeighborId0 = 8;
3808 localNeighborId1 = 6;
3809
3810 } else if(p[1] % previous_decimation) {
3811 localNeighborId0 = 9;
3812 localNeighborId1 = 2;
3813
3814 } else if(p[2] % previous_decimation) {
3815 localNeighborId0 = 7;
3816 localNeighborId1 = 4;
3817 } else {
3818 this->getImpactedVerticesError(previous_decimation, p);
3819 }
3820}
3822 std::array<SimplexId, 3> &p,
3823 SimplexId &localNeighborId0,
3824 SimplexId &localNeighborId1) const {
3825 int previous_decimation = pow(2, (decimationLevel_ + 1));
3826
3827 if((p[0] % previous_decimation) and (p[2] % previous_decimation)) {
3828 localNeighborId0 = 3;
3829 localNeighborId1 = 8;
3830
3831 } else if(p[0] % previous_decimation) {
3832 localNeighborId0 = 0;
3833 localNeighborId1 = 7;
3834
3835 } else if(p[2] % previous_decimation) {
3836 localNeighborId0 = 9;
3837 localNeighborId1 = 4;
3838 } else {
3839 this->getImpactedVerticesError(previous_decimation, p);
3840 }
3841}
3843 std::array<SimplexId, 3> &p,
3844 SimplexId &localNeighborId0,
3845 SimplexId &localNeighborId1) const {
3846 int previous_decimation = pow(2, (decimationLevel_ + 1));
3847
3848 if((p[0] % previous_decimation) and (p[2] % previous_decimation)) {
3849 localNeighborId0 = 3;
3850 localNeighborId1 = 8;
3851
3852 } else if(p[0] % previous_decimation) {
3853 localNeighborId0 = 7;
3854 localNeighborId1 = 6;
3855
3856 } else if(p[2] % previous_decimation) {
3857 localNeighborId0 = 2;
3858 localNeighborId1 = 9;
3859 } else {
3860 this->getImpactedVerticesError(previous_decimation, p);
3861 }
3862}
3864 std::array<SimplexId, 3> &p,
3865 SimplexId &localNeighborId0,
3866 SimplexId &localNeighborId1) const {
3867 int previous_decimation = pow(2, (decimationLevel_ + 1));
3868
3869 if(p[0] % previous_decimation) {
3870 localNeighborId0 = 0;
3871 localNeighborId1 = 7;
3872 } else {
3873 this->getImpactedVerticesError(previous_decimation, p);
3874 }
3875}
3877 std::array<SimplexId, 3> &p,
3878 SimplexId &localNeighborId0,
3879 SimplexId &localNeighborId1) const {
3880 int previous_decimation = pow(2, (decimationLevel_ + 1));
3881
3882 if(p[0] % previous_decimation) {
3883 localNeighborId0 = 1;
3884 localNeighborId1 = 5;
3885 } else {
3886 this->getImpactedVerticesError(previous_decimation, p);
3887 }
3888}
3890 std::array<SimplexId, 3> &p,
3891 SimplexId &localNeighborId0,
3892 SimplexId &localNeighborId1) const {
3893 int previous_decimation = pow(2, (decimationLevel_ + 1));
3894
3895 if(p[0] % previous_decimation) {
3896 localNeighborId0 = 1;
3897 localNeighborId1 = 5;
3898 } else {
3899 this->getImpactedVerticesError(previous_decimation, p);
3900 }
3901}
3903 std::array<SimplexId, 3> &p,
3904 SimplexId &localNeighborId0,
3905 SimplexId &localNeighborId1) const {
3906 int previous_decimation = pow(2, (decimationLevel_ + 1));
3907
3908 if(p[0] % previous_decimation) {
3909 localNeighborId0 = 7;
3910 localNeighborId1 = 6;
3911 } else {
3912 this->getImpactedVerticesError(previous_decimation, p);
3913 }
3914}
3916 std::array<SimplexId, 3> &p,
3917 SimplexId &localNeighborId0,
3918 SimplexId &localNeighborId1) const {
3919 int previous_decimation = pow(2, (decimationLevel_ + 1));
3920
3921 if(p[1] % previous_decimation) {
3922 localNeighborId0 = 0;
3923 localNeighborId1 = 4;
3924 } else {
3925 this->getImpactedVerticesError(previous_decimation, p);
3926 }
3927}
3929 std::array<SimplexId, 3> &p,
3930 SimplexId &localNeighborId0,
3931 SimplexId &localNeighborId1) const {
3932 int previous_decimation = pow(2, (decimationLevel_ + 1));
3933
3934 if(p[1] % previous_decimation) {
3935 localNeighborId0 = 2;
3936 localNeighborId1 = 7;
3937 } else {
3938 this->getImpactedVerticesError(previous_decimation, p);
3939 }
3940}
3942 std::array<SimplexId, 3> &p,
3943 SimplexId &localNeighborId0,
3944 SimplexId &localNeighborId1) const {
3945 int previous_decimation = pow(2, (decimationLevel_ + 1));
3946
3947 if(p[1] % previous_decimation) {
3948 localNeighborId0 = 4;
3949 localNeighborId1 = 7;
3950 } else {
3951 this->getImpactedVerticesError(previous_decimation, p);
3952 }
3953}
3955 std::array<SimplexId, 3> &p,
3956 SimplexId &localNeighborId0,
3957 SimplexId &localNeighborId1) const {
3958 int previous_decimation = pow(2, (decimationLevel_ + 1));
3959
3960 if(p[1] % previous_decimation) {
3961 localNeighborId0 = 5;
3962 localNeighborId1 = 3;
3963 } else {
3964 this->getImpactedVerticesError(previous_decimation, p);
3965 }
3966}
3968 std::array<SimplexId, 3> &p,
3969 SimplexId &localNeighborId0,
3970 SimplexId &localNeighborId1) const {
3971 int previous_decimation = pow(2, (decimationLevel_ + 1));
3972
3973 if(p[2] % previous_decimation) {
3974 localNeighborId0 = 4;
3975 localNeighborId1 = 2;
3976 } else {
3977 this->getImpactedVerticesError(previous_decimation, p);
3978 }
3979}
3980
3982 std::array<SimplexId, 3> &p,
3983 SimplexId &localNeighborId0,
3984 SimplexId &localNeighborId1) const {
3985 int previous_decimation = pow(2, (decimationLevel_ + 1));
3986
3987 if(p[2] % previous_decimation) {
3988 localNeighborId0 = 7;
3989 localNeighborId1 = 4;
3990 } else {
3991 this->getImpactedVerticesError(previous_decimation, p);
3992 }
3993}
3994
3996 std::array<SimplexId, 3> &p,
3997 SimplexId &localNeighborId0,
3998 SimplexId &localNeighborId1) const {
3999 int previous_decimation = pow(2, (decimationLevel_ + 1));
4000
4001 if(p[2] % previous_decimation) {
4002 localNeighborId0 = 2;
4003 localNeighborId1 = 7;
4004 } else {
4005 this->getImpactedVerticesError(previous_decimation, p);
4006 }
4007}
4008
4010 std::array<SimplexId, 3> &p,
4011 SimplexId &localNeighborId0,
4012 SimplexId &localNeighborId1) const {
4013 int previous_decimation = pow(2, (decimationLevel_ + 1));
4014
4015 if(p[2] % previous_decimation) {
4016 localNeighborId0 = 5;
4017 localNeighborId1 = 3;
4018 } else {
4019 this->getImpactedVerticesError(previous_decimation, p);
4020 }
4021}
4022
4024 std::array<SimplexId, 3> &p,
4025 SimplexId &localNeighborId0,
4026 SimplexId &localNeighborId1) const {
4027 int previous_decimation = pow(2, (decimationLevel_ + 1));
4028
4029 if((p[0] % previous_decimation) and (p[1] % previous_decimation)) {
4030 localNeighborId0 = 2;
4031 localNeighborId1 = 5;
4032
4033 } else if(p[0] % previous_decimation) {
4034 localNeighborId0 = 0;
4035 localNeighborId1 = 3;
4036
4037 } else if(p[1] % previous_decimation) {
4038 localNeighborId0 = 1;
4039 localNeighborId1 = 4;
4040 } else {
4041 this->getImpactedVerticesError(previous_decimation, p);
4042 }
4043}
4044
4046 std::array<SimplexId, 3> &p,
4047 SimplexId &localNeighborId0,
4048 SimplexId &localNeighborId1) const {
4049 int previous_decimation = pow(2, (decimationLevel_ + 1));
4050
4051 if(p[0] % previous_decimation) {
4052 localNeighborId0 = 0;
4053 localNeighborId1 = 3;
4054 } else {
4055 this->getImpactedVerticesError(previous_decimation, p);
4056 }
4057}
4058
4060 std::array<SimplexId, 3> &p,
4061 SimplexId &localNeighborId0,
4062 SimplexId &localNeighborId1) const {
4063 int previous_decimation = pow(2, (decimationLevel_ + 1));
4064
4065 if(p[0] % previous_decimation) {
4066 localNeighborId0 = 0;
4067 localNeighborId1 = 3;
4068 } else {
4069 this->getImpactedVerticesError(previous_decimation, p);
4070 }
4071}
4072
4074 std::array<SimplexId, 3> &p,
4075 SimplexId &localNeighborId0,
4076 SimplexId &localNeighborId1) const {
4077 int previous_decimation = pow(2, (decimationLevel_ + 1));
4078
4079 if(p[1] % previous_decimation) {
4080 localNeighborId0 = 0;
4081 localNeighborId1 = 3;
4082 } else {
4083 this->getImpactedVerticesError(previous_decimation, p);
4084 }
4085}
4087 std::array<SimplexId, 3> &p,
4088 SimplexId &localNeighborId0,
4089 SimplexId &localNeighborId1) const {
4090 int previous_decimation = pow(2, (decimationLevel_ + 1));
4091
4092 if(p[1] % previous_decimation) {
4093 localNeighborId0 = 2;
4094 localNeighborId1 = 1;
4095 } else {
4096 this->getImpactedVerticesError(previous_decimation, p);
4097 }
4098}
4099
4100std::vector<SimplexId>
4102
4103 std::vector<SimplexId> result;
4104 if(dimensionality_ == 3) {
4105 std::array<SimplexId, 3> p{};
4106 vertexToPosition(vertexId, p);
4107 SimplexId shiftX = decimation_;
4108 SimplexId shiftY = decimation_;
4109 SimplexId shiftZ = decimation_;
4110
4111 if((nbvoxels_[0] % decimation_) and (p[0] + decimation_ > nbvoxels_[0])) {
4112 shiftX = nbvoxels_[0] % decimation_;
4113 }
4114 if((nbvoxels_[1] % decimation_) and (p[1] + decimation_ > nbvoxels_[1])) {
4115 shiftY = nbvoxels_[1] % decimation_;
4116 }
4117 if((nbvoxels_[2] % decimation_) and (p[2] + decimation_ > nbvoxels_[2])) {
4118 shiftZ = nbvoxels_[2] % decimation_;
4119 }
4120
4121 std::vector<SimplexId> vi;
4122 vi.push_back(-decimation_);
4123 vi.push_back(0);
4124 vi.push_back(shiftX);
4125
4126 std::vector<SimplexId> vj;
4127 vj.push_back(-decimation_);
4128 vj.push_back(0);
4129 vj.push_back(shiftY);
4130
4131 std::vector<SimplexId> vk;
4132 vk.push_back(-decimation_);
4133 vk.push_back(0);
4134 vk.push_back(shiftZ);
4135
4136 if(p[0] == 0)
4137 vi.erase(vi.begin() + 0);
4138 if(p[0] == nbvoxels_[0])
4139 vi.erase(vi.begin() + 2);
4140 if(p[1] == 0)
4141 vj.erase(vj.begin() + 0);
4142 if(p[1] == nbvoxels_[1])
4143 vj.erase(vj.begin() + 2);
4144 if(p[2] == 0)
4145 vk.erase(vk.begin() + 0);
4146 if(p[2] == nbvoxels_[2])
4147 vk.erase(vk.begin() + 2);
4148
4149 for(SimplexId i : vi) {
4150 for(SimplexId j : vj) {
4151 for(SimplexId k : vk) {
4152 if(i != 0 or j != 0 or k != 0)
4153 result.push_back(vertexId + i + j * vshift_[0] + k * vshift_[1]);
4154 }
4155 }
4156 }
4157
4158 } else if(dimensionality_ == 2) {
4159 std::array<SimplexId, 3> p{};
4160 vertexToPosition2d(vertexId, p);
4161 SimplexId shiftX = decimation_;
4162 SimplexId shiftY = decimation_;
4163
4164 if((nbvoxels_[Di_] % decimation_)
4165 and (p[0] + decimation_ > nbvoxels_[Di_])) {
4166 shiftX = nbvoxels_[0] % decimation_;
4167 }
4168 if((nbvoxels_[Dj_] % decimation_)
4169 and (p[1] + decimation_ > nbvoxels_[Dj_])) {
4170 shiftY = nbvoxels_[1] % decimation_;
4171 }
4172
4173 std::vector<SimplexId> vi;
4174 vi.push_back(-decimation_);
4175 vi.push_back(0);
4176 vi.push_back(shiftX);
4177
4178 std::vector<SimplexId> vj;
4179 vj.push_back(-decimation_);
4180 vj.push_back(0);
4181 vj.push_back(shiftY);
4182
4183 if(p[0] == 0)
4184 vi.erase(vi.begin() + 0);
4185 if(p[0] == nbvoxels_[0])
4186 vi.erase(vi.begin() + 2);
4187 if(p[1] == 0)
4188 vj.erase(vj.begin() + 0);
4189 if(p[1] == nbvoxels_[1])
4190 vj.erase(vj.begin() + 2);
4191
4192 for(SimplexId i : vi) {
4193 for(SimplexId j : vj) {
4194 if(i != 0 or j != 0) {
4195 result.push_back(vertexId + i + j * vshift_[Di_]);
4196 }
4197 }
4198 }
4199 }
4200 return result;
4201}
4202
4204 const SimplexId vertexId) const {
4205
4206 if(dimensionality_ == 3) {
4207 std::array<SimplexId, 3> p{};
4208 vertexToPosition(vertexId, p);
4209
4210 if(0 < p[0] and p[0] < nbvoxels_[0]) {
4211 if(0 < p[1] and p[1] < nbvoxels_[1]) {
4212 if(0 < p[2] and p[2] < nbvoxels_[2])
4213 return 0;
4214 else if(p[2] == 0)
4215 return 1;
4216 else
4217 return 2;
4218 } else if(p[1] == 0) {
4219 if(0 < p[2] and p[2] < nbvoxels_[2])
4220 return 3;
4221 else if(p[2] == 0)
4222 return 4;
4223 else
4224 return 5;
4225 } else {
4226 if(0 < p[2] and p[2] < nbvoxels_[2])
4227 return 6;
4228 else if(p[2] == 0)
4229 return 7;
4230 else
4231 return 8;
4232 }
4233 } else if(p[0] == 0) {
4234 if(0 < p[1] and p[1] < nbvoxels_[1]) {
4235 if(0 < p[2] and p[2] < nbvoxels_[2])
4236 return 9;
4237 else if(p[2] == 0)
4238 return 10;
4239 else
4240 return 11;
4241 } else if(p[1] == 0) {
4242 if(0 < p[2] and p[2] < nbvoxels_[2])
4243 return 12;
4244 else if(p[2] == 0)
4245 return 13;
4246 else
4247 return 14;
4248 } else {
4249 if(0 < p[2] and p[2] < nbvoxels_[2])
4250 return 15;
4251 else if(p[2] == 0)
4252 return 16;
4253 else
4254 return 17;
4255 }
4256 } else {
4257 if(0 < p[1] and p[1] < nbvoxels_[1]) {
4258 if(0 < p[2] and p[2] < nbvoxels_[2])
4259 return 18;
4260 else if(p[2] == 0)
4261 return 19;
4262 else
4263 return 20;
4264 } else if(p[1] == 0) {
4265 if(0 < p[2] and p[2] < nbvoxels_[2])
4266 return 21;
4267 else if(p[2] == 0)
4268 return 22;
4269 else
4270 return 23;
4271 } else {
4272 if(0 < p[2] and p[2] < nbvoxels_[2])
4273 return 24;
4274 else if(p[2] == 0)
4275 return 25;
4276 else
4277 return 26;
4278 }
4279 }
4280
4281 } else if(dimensionality_ == 2) {
4282 std::array<SimplexId, 3> p{};
4283 vertexToPosition2d(vertexId, p);
4284
4285 if(0 < p[0] and p[0] < nbvoxels_[Di_]) {
4286 if(0 < p[1] and p[1] < nbvoxels_[Dj_]) {
4287 return 0;
4288 } else if(p[1] == 0) {
4289 return 1;
4290 } else {
4291 return 2;
4292 }
4293 } else if(p[0] == 0) {
4294 if(0 < p[1] and p[1] < nbvoxels_[Dj_]) {
4295 return 3;
4296 } else if(p[1] == 0) {
4297 return 4;
4298 } else {
4299 return 5;
4300 }
4301 } else {
4302 if(0 < p[1] and p[1] < nbvoxels_[Dj_]) {
4303 return 6;
4304 } else if(p[1] == 0) {
4305 return 7;
4306 } else {
4307 return 8;
4308 }
4309 }
4310 }
4311 return -1;
4312}
4313
4315 std::vector<SimplexId> &boundaryRepresentatives) {
4316 int currentDecimationLevel = decimationLevel_;
4318 if(dimensionality_ == 3) { // here gridDimension[i] > 1 for all i =0,1,2
4319 boundaryRepresentatives.resize(27, -1);
4320 // ADD THE CORNERS
4321 boundaryRepresentatives[13] = 0; // 0 0 0
4322 boundaryRepresentatives[22] = gridDimensions_[0] - 1; // Nx 0 0
4323 boundaryRepresentatives[16]
4324 = vshift_[0] * (gridDimensions_[1] - 1); // 0 Ny 0
4325 boundaryRepresentatives[14]
4326 = vshift_[1] * (gridDimensions_[2] - 1); // 0 0 Nz
4327 boundaryRepresentatives[25]
4328 = gridDimensions_[0] - 1
4329 + vshift_[0] * (gridDimensions_[1] - 1); // Nx Ny 0
4330 boundaryRepresentatives[23]
4331 = gridDimensions_[0] - 1
4332 + vshift_[1] * (gridDimensions_[2] - 1); // Nx 0 Nz
4333 boundaryRepresentatives[17]
4334 = vshift_[0] * (gridDimensions_[1] - 1)
4335 + vshift_[1] * (gridDimensions_[2] - 1); // 0 Ny Nz
4336 boundaryRepresentatives[26]
4337 = gridDimensions_[0] - 1 + vshift_[0] * (gridDimensions_[1] - 1)
4338 + vshift_[1] * (gridDimensions_[2] - 1); // Nx Ny Nz
4339
4340 if(gridDimensions_[0] > 2) {
4341 boundaryRepresentatives[4] = 1; // 1 0 0
4342 boundaryRepresentatives[7]
4343 = 1 + vshift_[0] * (gridDimensions_[1] - 1); // 1 Ny 0
4344 boundaryRepresentatives[5]
4345 = 1 + vshift_[1] * (gridDimensions_[2] - 1); // 1 0 Nz
4346 boundaryRepresentatives[8]
4347 = 1 + vshift_[0] * (gridDimensions_[1] - 1)
4348 + vshift_[1] * (gridDimensions_[2] - 1); // 1 Ny Nz
4349 }
4350 if(gridDimensions_[1] > 2) {
4351 boundaryRepresentatives[10] = vshift_[0]; // 0 1 0
4352 boundaryRepresentatives[19]
4353 = gridDimensions_[0] - 1 + vshift_[0]; // Nx 1 0
4354 boundaryRepresentatives[11]
4355 = vshift_[0] + vshift_[1] * (gridDimensions_[2] - 1); // 0 1 Nz
4356 boundaryRepresentatives[20]
4357 = gridDimensions_[0] - 1 + vshift_[0]
4358 + vshift_[1] * (gridDimensions_[2] - 1); // Nx 1 Nz
4359 }
4360 if(gridDimensions_[2] > 2) {
4361 boundaryRepresentatives[12] = vshift_[1]; // 0 0 1
4362 boundaryRepresentatives[15]
4363 = vshift_[0] * (gridDimensions_[1] - 1) + vshift_[1]; // 0 Ny 1
4364 boundaryRepresentatives[21]
4365 = (gridDimensions_[0] - 1) + vshift_[1]; // Nx 0 1
4366 boundaryRepresentatives[24] = (gridDimensions_[0] - 1)
4367 + vshift_[0] * (gridDimensions_[1] - 1)
4368 + vshift_[1]; // Nx Ny 1
4369 }
4370 if(gridDimensions_[0] > 2 and gridDimensions_[1] > 2) {
4371 boundaryRepresentatives[1] = 1 + vshift_[0]; // 1 1 0
4372 boundaryRepresentatives[2]
4373 = 1 + vshift_[0] + vshift_[1] * (gridDimensions_[2] - 1); // 1 1 Nz
4374 }
4375 if(gridDimensions_[0] > 2 and gridDimensions_[2] > 2) {
4376 boundaryRepresentatives[3] = 1 + vshift_[1]; // 1 0 1
4377 boundaryRepresentatives[6]
4378 = 1 + vshift_[0] * (gridDimensions_[1] - 1) + vshift_[1]; // 1 Ny 1
4379 }
4380 if(gridDimensions_[1] > 2 and gridDimensions_[2] > 2) {
4381 boundaryRepresentatives[9] = vshift_[0] + vshift_[1]; // 0 1 1
4382 boundaryRepresentatives[18]
4383 = (gridDimensions_[0] - 1) + vshift_[0] + vshift_[1]; // Nx 1 1
4384 }
4385 if(gridDimensions_[0] > 2 and gridDimensions_[1] > 2
4386 and gridDimensions_[2] > 2) {
4387 boundaryRepresentatives[0] = 1 + vshift_[0] + vshift_[1];
4388 }
4389 } else if(dimensionality_ == 2) {
4390 boundaryRepresentatives.resize(9, -1);
4391 boundaryRepresentatives[4] = 0; // 0 0
4392 boundaryRepresentatives[5] = vshift_[0] * (gridDimensions_[1] - 1); // 0 Ny
4393 boundaryRepresentatives[7] = gridDimensions_[0] - 1; // Nx 0
4394 boundaryRepresentatives[8]
4395 = (gridDimensions_[0] - 1)
4396 + vshift_[0] * (gridDimensions_[1] - 1); // Nx Ny
4397
4398 boundaryRepresentatives[1] = 1; // 1 0
4399 boundaryRepresentatives[2]
4400 = 1 + vshift_[0] * (gridDimensions_[1] - 1); // 1 Ny
4401 boundaryRepresentatives[3] = vshift_[0]; // 0 1
4402 boundaryRepresentatives[6] = (gridDimensions_[0] - 1) + vshift_[0]; // Nx 1
4403
4404 boundaryRepresentatives[0] = 1 + vshift_[0]; // 1 1
4405 }
4406 setDecimationLevel(currentDecimationLevel);
4407}
4408
4410 bool ret = false;
4411 if(dimensionality_ == 3) {
4412 std::array<SimplexId, 3> p{};
4413 vertexToPosition(v, p);
4414 if((nbvoxels_[0] % decimation_) and (p[0] + decimation_ > nbvoxels_[0])) {
4415 ret = true;
4416 }
4417 if((nbvoxels_[1] % decimation_) and (p[1] + decimation_ > nbvoxels_[1])) {
4418 ret = true;
4419 }
4420 if((nbvoxels_[2] % decimation_) and (p[2] + decimation_ > nbvoxels_[2])) {
4421 ret = true;
4422 }
4423 }
4424 return ret;
4425}
4426
4428 int maxDim = std::max(
4429 gridDimensions_[0], std::max(gridDimensions_[1], gridDimensions_[2]));
4430 int dl = 0;
4431 while(maxDim > 2) {
4432 maxDim
4433 = ((maxDim - 1) % 2) ? ((maxDim - 1) / 2 + 2) : ((maxDim - 1) / 2 + 1);
4434 dl++;
4435 }
4436 coarsestDL_ = dl;
4437}
4438
4440 if(rl < 0) {
4441 return 0;
4442 } else {
4443 return std::max(coarsestDL_ - rl, 0);
4444 }
4445}
4446
4448 return coarsestDL_ - dl;
4449}
int debugLevel_
Definition: Debug.h:379
int printWrn(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
Definition: Debug.h:159
void setDebugMsgPrefix(const std::string &prefix)
Definition: Debug.h:364
int printMsg(const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
Definition: Debug.h:118
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
Definition: Debug.h:149
void getInvertedLocalNeighborFH(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVerticesFH(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborG(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesABCDEFGH(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
void vertexToPosition(const SimplexId vertex, std::array< SimplexId, 3 > &p) const
SimplexId getInvertedVertexNeighborABCDEFGH(const SimplexId v, const int id, const SimplexId shiftX, const SimplexId shiftY, const SimplexId shiftZ, SimplexId &invertedLocalNeighbor) const
void getInvertedLocalNeighborAE(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertedLocalNeighbor2dA(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVertices(SimplexId vertexId, SimplexId v0[3], SimplexId v1[3])
void getImpactedVerticesAEGC(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborE(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighbor2dA(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
SimplexId getInvertVertexNeighborBFHD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborABDC(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborG(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborAB(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborC(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertedVertexNeighbor2dABCD(const SimplexId v, const int id, const SimplexId shiftX, const SimplexId shiftY, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborAEGC(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborBFHD(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getInvertedLocalNeighborDH(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborAB(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighborGH(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborABCDEFGH(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighbor2dBD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
SimplexId getInvertVertexNeighborCG(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighbor2dAB(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
SimplexId getInvertVertexNeighbor2dB(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
void getInvertedLocalNeighborA(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighbor2dAB(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
void getImpactedVerticesAEFB(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
bool isInTriangulation(const SimplexId vertexId) const
SimplexId getInvertVertexNeighborEF(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertedLocalNeighbor2dAB(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getInvertedLocalNeighborC(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborE(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesGHDC(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
int preconditionVerticesInternal()
Precondition vertices.
int getInteriorInvertedVertexNeighbor(SimplexId, SimplexId, SimplexId &, SimplexId &) const
SimplexId getInvertVertexNeighbor2dAC(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
SimplexId localToGlobalVertexId(const SimplexId localId) const
void getImpactedVerticesEG(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
void getInvertedLocalNeighborEG(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVerticesBD(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
void getInvertedLocalNeighborCD(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getInvertedLocalNeighborCG(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborBF(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesCG(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
void getImpactedVerticesGH(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesDH(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getVertexNeighborFH(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
int getVertexBoundaryIndex(const SimplexId) const
void getInvertedLocalNeighborEF(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborAC(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesEFHG(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborBF(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighbor2dC(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
void getImpactedVerticesError(const int prev_decim, const std::array< SimplexId, 3 > &p) const
std::vector< SimplexId > getExtendedStar(const SimplexId &vertexId) const
SimplexId getInvertedLocalNeighbor2dAC(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVerticesBFHD(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborABCDEFGH(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborAB(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighborEG(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborH(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborC(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertedLocalNeighbor2dD(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborAEGC(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighbor2dB(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
SimplexId getVertexNeighborEG(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighbor2dA(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
void getInvertedLocalNeighborGHDC(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborCG(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborH(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborAE(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertedLocalNeighbor2dC(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborGHDC(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborGH(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborFH(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborAEFB(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getInvertedLocalNeighborF(SimplexId id, SimplexId &invertedLocalNeighbor) const
void vertexToPosition2d(const SimplexId vertex, std::array< SimplexId, 3 > &p) const
SimplexId getInvertVertexNeighborBD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesAC(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
bool isBoundaryImpacted(SimplexId) const
void getInvertedLocalNeighborB(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborABDC(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborBD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighborAE(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void setDecimationLevel(int decimationLevel)
int getVertexNeighbor(const SimplexId &vertexId, const int &localNeighborId, SimplexId &neighborId) const
SimplexId getVertexNeighbor2dAC(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
SimplexId getVertexNeighborAEFB(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVertices2dCD(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighbor2dCD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
SimplexId getInvertVertexNeighbor2dD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
SimplexId getVertexNeighborDH(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborA(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
char localNeighborId(SimplexId neighborId, SimplexId vertexId)
void getInvertedLocalNeighborBF(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertedLocalNeighbor2dBD(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getInvertedLocalNeighborEFHG(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborF(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighborA(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborGHDC(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertedLocalNeighbor2dB(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVerticesABDC(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getVertexNeighborGH(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertedLocalNeighbor2dCD(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighbor2dCD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
SimplexId getVertexNeighborB(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesCD(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborAEFB(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighborEF(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighbor2dC(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
void getImpactedVertices2dAC(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getVertexNeighborBFHD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborBD(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getVertexNeighborNumber(const SimplexId &vertexId) const
void getInvertedLocalNeighborG(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighborDH(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborD(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVertices2dAB(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborEFHG(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getInvertVertexNeighborCD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
SimplexId getVertexNeighbor2dABCD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
SimplexId getInvertVertexNeighborB(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesAB(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
void getImpactedVertices2dABCD(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getVertexNeighborF(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void findBoundaryRepresentatives(std::vector< SimplexId > &boundaryRepresentatives)
SimplexId getVertexNeighborCD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
int getInvertVertexNeighbor(const SimplexId &vertexId, const SimplexId &neighborId, SimplexId &localNeighborId) const
SimplexId getVertexNeighbor2dBD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
SimplexId getVertexNeighborABDC(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborE(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVertices2dBD(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborAC(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getImpactedVerticesEF(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getVertexNeighbor2dD(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY) const
SimplexId getVertexNeighborEFHG(const SimplexId v, const int id, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
void getInvertedLocalNeighborAEGC(SimplexId id, SimplexId &invertedLocalNeighbor) const
SimplexId getInvertVertexNeighbor2dABCD(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY) const
void getInvertedLocalNeighborAC(SimplexId id, SimplexId &invertedLocalNeighbor) const
void getImpactedVerticesBF(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
void getImpactedVerticesAE(std::array< SimplexId, 3 > &p, SimplexId &localNeighborId0, SimplexId &localNeighborId1) const
SimplexId getInvertVertexNeighborH(const SimplexId v, const SimplexId neighborId, SimplexId shiftX, SimplexId shiftY, SimplexId shiftZ) const
int SimplexId
Identifier type for simplices of any dimension.
Definition: DataTypes.h:22