34 #ifndef OPENVDB_MATH_STENCILS_HAS_BEEN_INCLUDED
35 #define OPENVDB_MATH_STENCILS_HAS_BEEN_INCLUDED
39 #include <openvdb/math/Math.h>
40 #include <openvdb/Types.h>
41 #include <openvdb/math/Coord.h>
42 #include <openvdb/math/FiniteDifference.h>
53 template<
typename _Gr
idType,
typename StencilType>
61 typedef typename BufferType::iterator
IterType;
68 mStencil[0] = mCache.getValue(ijk);
69 static_cast<StencilType&
>(*this).init(mCenter);
76 template<
typename IterType>
79 mCenter = iter.getCoord();
81 static_cast<StencilType&
>(*this).init(mCenter);
91 assert(pos < mStencil.size());
96 template<
int i,
int j,
int k>
99 return mStencil[
static_cast<const StencilType&
>(*this).template pos<i,j,k>()];
103 template<
int i,
int j,
int k>
106 mStencil[
static_cast<const StencilType&
>(*this).template pos<i,j,k>()] = value;
110 inline int size() {
return mStencil.size(); }
115 std::vector<ValueType> tmp(mStencil);
116 assert(!tmp.empty());
117 size_t midpoint = (tmp.size() - 1) >> 1;
119 std::nth_element(tmp.begin(), tmp.begin() + midpoint, tmp.end());
120 return tmp[midpoint];
127 for (
int n=0, s=mStencil.size(); n<s; ++n) sum += mStencil[n];
128 return sum / mStencil.size();
134 IterType iter = std::min_element(mStencil.begin(), mStencil.end());
141 IterType iter = std::max_element(mStencil.begin(), mStencil.end());
155 const bool less = this->getValue< 0, 0, 0>() < isoValue;
156 return (less ^ (this->getValue<-1, 0, 0>() < isoValue)) ||
157 (less ^ (this->getValue< 1, 0, 0>() < isoValue)) ||
158 (less ^ (this->getValue< 0,-1, 0>() < isoValue)) ||
159 (less ^ (this->getValue< 0, 1, 0>() < isoValue)) ||
160 (less ^ (this->getValue< 0, 0,-1>() < isoValue)) ||
161 (less ^ (this->getValue< 0, 0, 1>() < isoValue)) ;
167 mCache(grid.getConstAccessor()),
185 template<
int i,
int j,
int k>
struct SevenPt {};
186 template<>
struct SevenPt< 0, 0, 0> {
enum { idx = 0 }; };
187 template<>
struct SevenPt< 1, 0, 0> {
enum { idx = 1 }; };
188 template<>
struct SevenPt< 0, 1, 0> {
enum { idx = 2 }; };
189 template<>
struct SevenPt< 0, 0, 1> {
enum { idx = 3 }; };
190 template<>
struct SevenPt<-1, 0, 0> {
enum { idx = 4 }; };
191 template<>
struct SevenPt< 0,-1, 0> {
enum { idx = 5 }; };
192 template<>
struct SevenPt< 0, 0,-1> {
enum { idx = 6 }; };
197 template<
typename Gr
idType>
205 static const int SIZE = 7;
210 template<
int i,
int j,
int k>
211 unsigned int pos()
const {
return SevenPt<i,j,k>::idx; }
214 inline void init(
const Coord& ijk)
216 BaseType::template setValue<-1, 0, 0>(mCache.getValue(ijk.
offsetBy(-1, 0, 0)));
217 BaseType::template setValue< 1, 0, 0>(mCache.getValue(ijk.
offsetBy( 1, 0, 0)));
219 BaseType::template setValue< 0,-1, 0>(mCache.getValue(ijk.
offsetBy( 0,-1, 0)));
220 BaseType::template setValue< 0, 1, 0>(mCache.getValue(ijk.
offsetBy( 0, 1, 0)));
222 BaseType::template setValue< 0, 0,-1>(mCache.getValue(ijk.
offsetBy( 0, 0,-1)));
223 BaseType::template setValue< 0, 0, 1>(mCache.getValue(ijk.
offsetBy( 0, 0, 1)));
227 using BaseType::mCache;
228 using BaseType::mStencil;
238 template<
int i,
int j,
int k>
struct DensePt {};
239 template<>
struct DensePt< 0, 0, 0> {
enum { idx = 0 }; };
241 template<>
struct DensePt< 1, 0, 0> {
enum { idx = 1 }; };
242 template<>
struct DensePt< 0, 1, 0> {
enum { idx = 2 }; };
243 template<>
struct DensePt< 0, 0, 1> {
enum { idx = 3 }; };
245 template<>
struct DensePt<-1, 0, 0> {
enum { idx = 4 }; };
246 template<>
struct DensePt< 0,-1, 0> {
enum { idx = 5 }; };
247 template<>
struct DensePt< 0, 0,-1> {
enum { idx = 6 }; };
249 template<>
struct DensePt<-1,-1, 0> {
enum { idx = 7 }; };
250 template<>
struct DensePt< 0,-1,-1> {
enum { idx = 8 }; };
251 template<>
struct DensePt<-1, 0,-1> {
enum { idx = 9 }; };
253 template<>
struct DensePt< 1,-1, 0> {
enum { idx = 10 }; };
254 template<>
struct DensePt< 0, 1,-1> {
enum { idx = 11 }; };
255 template<>
struct DensePt<-1, 0, 1> {
enum { idx = 12 }; };
257 template<>
struct DensePt<-1, 1, 0> {
enum { idx = 13 }; };
258 template<>
struct DensePt< 0,-1, 1> {
enum { idx = 14 }; };
259 template<>
struct DensePt< 1, 0,-1> {
enum { idx = 15 }; };
261 template<>
struct DensePt< 1, 1, 0> {
enum { idx = 16 }; };
262 template<>
struct DensePt< 0, 1, 1> {
enum { idx = 17 }; };
263 template<>
struct DensePt< 1, 0, 1> {
enum { idx = 18 }; };
268 template<
typename Gr
idType>
277 static const int SIZE = 19;
282 template<
int i,
int j,
int k>
283 unsigned int pos()
const {
return DensePt<i,j,k>::idx; }
286 inline void init(
const Coord& ijk)
288 mStencil[DensePt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
289 mStencil[DensePt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
290 mStencil[DensePt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
292 mStencil[DensePt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
293 mStencil[DensePt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
294 mStencil[DensePt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
296 mStencil[DensePt<-1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, -1, 0));
297 mStencil[DensePt< 1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, -1, 0));
298 mStencil[DensePt<-1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
299 mStencil[DensePt< 1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
301 mStencil[DensePt<-1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, -1));
302 mStencil[DensePt< 1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, -1));
303 mStencil[DensePt<-1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
304 mStencil[DensePt< 1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
306 mStencil[DensePt< 0,-1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, -1));
307 mStencil[DensePt< 0, 1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, -1));
308 mStencil[DensePt< 0,-1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 1));
309 mStencil[DensePt< 0, 1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
313 using BaseType::mCache;
314 using BaseType::mStencil;
324 template<
int i,
int j,
int k>
struct ThirteenPt {};
325 template<>
struct ThirteenPt< 0, 0, 0> {
enum { idx = 0 }; };
327 template<>
struct ThirteenPt< 1, 0, 0> {
enum { idx = 1 }; };
328 template<>
struct ThirteenPt< 0, 1, 0> {
enum { idx = 2 }; };
329 template<>
struct ThirteenPt< 0, 0, 1> {
enum { idx = 3 }; };
331 template<>
struct ThirteenPt<-1, 0, 0> {
enum { idx = 4 }; };
332 template<>
struct ThirteenPt< 0,-1, 0> {
enum { idx = 5 }; };
333 template<>
struct ThirteenPt< 0, 0,-1> {
enum { idx = 6 }; };
335 template<>
struct ThirteenPt< 2, 0, 0> {
enum { idx = 7 }; };
336 template<>
struct ThirteenPt< 0, 2, 0> {
enum { idx = 8 }; };
337 template<>
struct ThirteenPt< 0, 0, 2> {
enum { idx = 9 }; };
339 template<>
struct ThirteenPt<-2, 0, 0> {
enum { idx = 10 }; };
340 template<>
struct ThirteenPt< 0,-2, 0> {
enum { idx = 11 }; };
341 template<>
struct ThirteenPt< 0, 0,-2> {
enum { idx = 12 }; };
346 template<
typename Gr
idType>
355 static const int SIZE = 13;
360 template<
int i,
int j,
int k>
361 unsigned int pos()
const {
return ThirteenPt<i,j,k>::idx; }
364 inline void init(
const Coord& ijk)
366 mStencil[ThirteenPt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
367 mStencil[ThirteenPt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
368 mStencil[ThirteenPt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
369 mStencil[ThirteenPt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
371 mStencil[ThirteenPt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
372 mStencil[ThirteenPt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
373 mStencil[ThirteenPt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
374 mStencil[ThirteenPt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -2, 0));
376 mStencil[ThirteenPt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
377 mStencil[ThirteenPt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
378 mStencil[ThirteenPt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
379 mStencil[ThirteenPt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -2));
383 using BaseType::mCache;
384 using BaseType::mStencil;
394 template<
int i,
int j,
int k>
struct FourthDensePt {};
395 template<>
struct FourthDensePt< 0, 0, 0> {
enum { idx = 0 }; };
397 template<>
struct FourthDensePt<-2, 2, 0> {
enum { idx = 1 }; };
398 template<>
struct FourthDensePt<-1, 2, 0> {
enum { idx = 2 }; };
399 template<>
struct FourthDensePt< 0, 2, 0> {
enum { idx = 3 }; };
400 template<>
struct FourthDensePt< 1, 2, 0> {
enum { idx = 4 }; };
401 template<>
struct FourthDensePt< 2, 2, 0> {
enum { idx = 5 }; };
403 template<>
struct FourthDensePt<-2, 1, 0> {
enum { idx = 6 }; };
404 template<>
struct FourthDensePt<-1, 1, 0> {
enum { idx = 7 }; };
405 template<>
struct FourthDensePt< 0, 1, 0> {
enum { idx = 8 }; };
406 template<>
struct FourthDensePt< 1, 1, 0> {
enum { idx = 9 }; };
407 template<>
struct FourthDensePt< 2, 1, 0> {
enum { idx = 10 }; };
409 template<>
struct FourthDensePt<-2, 0, 0> {
enum { idx = 11 }; };
410 template<>
struct FourthDensePt<-1, 0, 0> {
enum { idx = 12 }; };
411 template<>
struct FourthDensePt< 1, 0, 0> {
enum { idx = 13 }; };
412 template<>
struct FourthDensePt< 2, 0, 0> {
enum { idx = 14 }; };
414 template<>
struct FourthDensePt<-2,-1, 0> {
enum { idx = 15 }; };
415 template<>
struct FourthDensePt<-1,-1, 0> {
enum { idx = 16 }; };
416 template<>
struct FourthDensePt< 0,-1, 0> {
enum { idx = 17 }; };
417 template<>
struct FourthDensePt< 1,-1, 0> {
enum { idx = 18 }; };
418 template<>
struct FourthDensePt< 2,-1, 0> {
enum { idx = 19 }; };
420 template<>
struct FourthDensePt<-2,-2, 0> {
enum { idx = 20 }; };
421 template<>
struct FourthDensePt<-1,-2, 0> {
enum { idx = 21 }; };
422 template<>
struct FourthDensePt< 0,-2, 0> {
enum { idx = 22 }; };
423 template<>
struct FourthDensePt< 1,-2, 0> {
enum { idx = 23 }; };
424 template<>
struct FourthDensePt< 2,-2, 0> {
enum { idx = 24 }; };
427 template<>
struct FourthDensePt<-2, 0, 2> {
enum { idx = 25 }; };
428 template<>
struct FourthDensePt<-1, 0, 2> {
enum { idx = 26 }; };
429 template<>
struct FourthDensePt< 0, 0, 2> {
enum { idx = 27 }; };
430 template<>
struct FourthDensePt< 1, 0, 2> {
enum { idx = 28 }; };
431 template<>
struct FourthDensePt< 2, 0, 2> {
enum { idx = 29 }; };
433 template<>
struct FourthDensePt<-2, 0, 1> {
enum { idx = 30 }; };
434 template<>
struct FourthDensePt<-1, 0, 1> {
enum { idx = 31 }; };
435 template<>
struct FourthDensePt< 0, 0, 1> {
enum { idx = 32 }; };
436 template<>
struct FourthDensePt< 1, 0, 1> {
enum { idx = 33 }; };
437 template<>
struct FourthDensePt< 2, 0, 1> {
enum { idx = 34 }; };
439 template<>
struct FourthDensePt<-2, 0,-1> {
enum { idx = 35 }; };
440 template<>
struct FourthDensePt<-1, 0,-1> {
enum { idx = 36 }; };
441 template<>
struct FourthDensePt< 0, 0,-1> {
enum { idx = 37 }; };
442 template<>
struct FourthDensePt< 1, 0,-1> {
enum { idx = 38 }; };
443 template<>
struct FourthDensePt< 2, 0,-1> {
enum { idx = 39 }; };
445 template<>
struct FourthDensePt<-2, 0,-2> {
enum { idx = 40 }; };
446 template<>
struct FourthDensePt<-1, 0,-2> {
enum { idx = 41 }; };
447 template<>
struct FourthDensePt< 0, 0,-2> {
enum { idx = 42 }; };
448 template<>
struct FourthDensePt< 1, 0,-2> {
enum { idx = 43 }; };
449 template<>
struct FourthDensePt< 2, 0,-2> {
enum { idx = 44 }; };
452 template<>
struct FourthDensePt< 0,-2, 2> {
enum { idx = 45 }; };
453 template<>
struct FourthDensePt< 0,-1, 2> {
enum { idx = 46 }; };
454 template<>
struct FourthDensePt< 0, 1, 2> {
enum { idx = 47 }; };
455 template<>
struct FourthDensePt< 0, 2, 2> {
enum { idx = 48 }; };
457 template<>
struct FourthDensePt< 0,-2, 1> {
enum { idx = 49 }; };
458 template<>
struct FourthDensePt< 0,-1, 1> {
enum { idx = 50 }; };
459 template<>
struct FourthDensePt< 0, 1, 1> {
enum { idx = 51 }; };
460 template<>
struct FourthDensePt< 0, 2, 1> {
enum { idx = 52 }; };
462 template<>
struct FourthDensePt< 0,-2,-1> {
enum { idx = 53 }; };
463 template<>
struct FourthDensePt< 0,-1,-1> {
enum { idx = 54 }; };
464 template<>
struct FourthDensePt< 0, 1,-1> {
enum { idx = 55 }; };
465 template<>
struct FourthDensePt< 0, 2,-1> {
enum { idx = 56 }; };
467 template<>
struct FourthDensePt< 0,-2,-2> {
enum { idx = 57 }; };
468 template<>
struct FourthDensePt< 0,-1,-2> {
enum { idx = 58 }; };
469 template<>
struct FourthDensePt< 0, 1,-2> {
enum { idx = 59 }; };
470 template<>
struct FourthDensePt< 0, 2,-2> {
enum { idx = 60 }; };
475 template<
typename Gr
idType>
484 static const int SIZE = 61;
489 template<
int i,
int j,
int k>
490 unsigned int pos()
const {
return FourthDensePt<i,j,k>::idx; }
493 inline void init(
const Coord& ijk)
495 mStencil[FourthDensePt<-2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 2, 0));
496 mStencil[FourthDensePt<-1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 2, 0));
497 mStencil[FourthDensePt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
498 mStencil[FourthDensePt< 1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 2, 0));
499 mStencil[FourthDensePt< 2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 2, 0));
501 mStencil[FourthDensePt<-2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 1, 0));
502 mStencil[FourthDensePt<-1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
503 mStencil[FourthDensePt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
504 mStencil[FourthDensePt< 1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
505 mStencil[FourthDensePt< 2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 1, 0));
507 mStencil[FourthDensePt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
508 mStencil[FourthDensePt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
509 mStencil[FourthDensePt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
510 mStencil[FourthDensePt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
512 mStencil[FourthDensePt<-2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-1, 0));
513 mStencil[FourthDensePt<-1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-1, 0));
514 mStencil[FourthDensePt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 0));
515 mStencil[FourthDensePt< 1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-1, 0));
516 mStencil[FourthDensePt< 2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-1, 0));
518 mStencil[FourthDensePt<-2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-2, 0));
519 mStencil[FourthDensePt<-1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-2, 0));
520 mStencil[FourthDensePt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 0));
521 mStencil[FourthDensePt< 1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-2, 0));
522 mStencil[FourthDensePt< 2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-2, 0));
524 mStencil[FourthDensePt<-2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 2));
525 mStencil[FourthDensePt<-1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 2));
526 mStencil[FourthDensePt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
527 mStencil[FourthDensePt< 1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 2));
528 mStencil[FourthDensePt< 2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 2));
530 mStencil[FourthDensePt<-2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 1));
531 mStencil[FourthDensePt<-1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
532 mStencil[FourthDensePt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
533 mStencil[FourthDensePt< 1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
534 mStencil[FourthDensePt< 2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 1));
536 mStencil[FourthDensePt<-2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-1));
537 mStencil[FourthDensePt<-1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-1));
538 mStencil[FourthDensePt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-1));
539 mStencil[FourthDensePt< 1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-1));
540 mStencil[FourthDensePt< 2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-1));
542 mStencil[FourthDensePt<-2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-2));
543 mStencil[FourthDensePt<-1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-2));
544 mStencil[FourthDensePt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-2));
545 mStencil[FourthDensePt< 1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-2));
546 mStencil[FourthDensePt< 2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-2));
549 mStencil[FourthDensePt< 0,-2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 2));
550 mStencil[FourthDensePt< 0,-1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 2));
551 mStencil[FourthDensePt< 0, 1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 2));
552 mStencil[FourthDensePt< 0, 2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 2));
554 mStencil[FourthDensePt< 0,-2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 1));
555 mStencil[FourthDensePt< 0,-1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 1));
556 mStencil[FourthDensePt< 0, 1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
557 mStencil[FourthDensePt< 0, 2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 1));
559 mStencil[FourthDensePt< 0,-2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-1));
560 mStencil[FourthDensePt< 0,-1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-1));
561 mStencil[FourthDensePt< 0, 1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-1));
562 mStencil[FourthDensePt< 0, 2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-1));
564 mStencil[FourthDensePt< 0,-2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-2));
565 mStencil[FourthDensePt< 0,-1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-2));
566 mStencil[FourthDensePt< 0, 1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-2));
567 mStencil[FourthDensePt< 0, 2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-2));
571 using BaseType::mCache;
572 using BaseType::mStencil;
582 template<
int i,
int j,
int k>
struct NineteenPt {};
583 template<>
struct NineteenPt< 0, 0, 0> {
enum { idx = 0 }; };
585 template<>
struct NineteenPt< 1, 0, 0> {
enum { idx = 1 }; };
586 template<>
struct NineteenPt< 0, 1, 0> {
enum { idx = 2 }; };
587 template<>
struct NineteenPt< 0, 0, 1> {
enum { idx = 3 }; };
589 template<>
struct NineteenPt<-1, 0, 0> {
enum { idx = 4 }; };
590 template<>
struct NineteenPt< 0,-1, 0> {
enum { idx = 5 }; };
591 template<>
struct NineteenPt< 0, 0,-1> {
enum { idx = 6 }; };
593 template<>
struct NineteenPt< 2, 0, 0> {
enum { idx = 7 }; };
594 template<>
struct NineteenPt< 0, 2, 0> {
enum { idx = 8 }; };
595 template<>
struct NineteenPt< 0, 0, 2> {
enum { idx = 9 }; };
597 template<>
struct NineteenPt<-2, 0, 0> {
enum { idx = 10 }; };
598 template<>
struct NineteenPt< 0,-2, 0> {
enum { idx = 11 }; };
599 template<>
struct NineteenPt< 0, 0,-2> {
enum { idx = 12 }; };
601 template<>
struct NineteenPt< 3, 0, 0> {
enum { idx = 13 }; };
602 template<>
struct NineteenPt< 0, 3, 0> {
enum { idx = 14 }; };
603 template<>
struct NineteenPt< 0, 0, 3> {
enum { idx = 15 }; };
605 template<>
struct NineteenPt<-3, 0, 0> {
enum { idx = 16 }; };
606 template<>
struct NineteenPt< 0,-3, 0> {
enum { idx = 17 }; };
607 template<>
struct NineteenPt< 0, 0,-3> {
enum { idx = 18 }; };
612 template<
typename Gr
idType>
621 static const int SIZE = 19;
626 template<
int i,
int j,
int k>
627 unsigned int pos()
const {
return NineteenPt<i,j,k>::idx; }
630 inline void init(
const Coord& ijk)
632 mStencil[NineteenPt< 3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 0));
633 mStencil[NineteenPt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
634 mStencil[NineteenPt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
635 mStencil[NineteenPt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
636 mStencil[NineteenPt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
637 mStencil[NineteenPt<-3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 0));
639 mStencil[NineteenPt< 0, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 0));
640 mStencil[NineteenPt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
641 mStencil[NineteenPt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
642 mStencil[NineteenPt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
643 mStencil[NineteenPt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -2, 0));
644 mStencil[NineteenPt< 0,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -3, 0));
646 mStencil[NineteenPt< 0, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 3));
647 mStencil[NineteenPt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
648 mStencil[NineteenPt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
649 mStencil[NineteenPt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
650 mStencil[NineteenPt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -2));
651 mStencil[NineteenPt< 0, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -3));
655 using BaseType::mCache;
656 using BaseType::mStencil;
666 template<
int i,
int j,
int k>
struct SixthDensePt { };
667 template<>
struct SixthDensePt< 0, 0, 0> {
enum { idx = 0 }; };
669 template<>
struct SixthDensePt<-3, 3, 0> {
enum { idx = 1 }; };
670 template<>
struct SixthDensePt<-2, 3, 0> {
enum { idx = 2 }; };
671 template<>
struct SixthDensePt<-1, 3, 0> {
enum { idx = 3 }; };
672 template<>
struct SixthDensePt< 0, 3, 0> {
enum { idx = 4 }; };
673 template<>
struct SixthDensePt< 1, 3, 0> {
enum { idx = 5 }; };
674 template<>
struct SixthDensePt< 2, 3, 0> {
enum { idx = 6 }; };
675 template<>
struct SixthDensePt< 3, 3, 0> {
enum { idx = 7 }; };
677 template<>
struct SixthDensePt<-3, 2, 0> {
enum { idx = 8 }; };
678 template<>
struct SixthDensePt<-2, 2, 0> {
enum { idx = 9 }; };
679 template<>
struct SixthDensePt<-1, 2, 0> {
enum { idx = 10 }; };
680 template<>
struct SixthDensePt< 0, 2, 0> {
enum { idx = 11 }; };
681 template<>
struct SixthDensePt< 1, 2, 0> {
enum { idx = 12 }; };
682 template<>
struct SixthDensePt< 2, 2, 0> {
enum { idx = 13 }; };
683 template<>
struct SixthDensePt< 3, 2, 0> {
enum { idx = 14 }; };
685 template<>
struct SixthDensePt<-3, 1, 0> {
enum { idx = 15 }; };
686 template<>
struct SixthDensePt<-2, 1, 0> {
enum { idx = 16 }; };
687 template<>
struct SixthDensePt<-1, 1, 0> {
enum { idx = 17 }; };
688 template<>
struct SixthDensePt< 0, 1, 0> {
enum { idx = 18 }; };
689 template<>
struct SixthDensePt< 1, 1, 0> {
enum { idx = 19 }; };
690 template<>
struct SixthDensePt< 2, 1, 0> {
enum { idx = 20 }; };
691 template<>
struct SixthDensePt< 3, 1, 0> {
enum { idx = 21 }; };
693 template<>
struct SixthDensePt<-3, 0, 0> {
enum { idx = 22 }; };
694 template<>
struct SixthDensePt<-2, 0, 0> {
enum { idx = 23 }; };
695 template<>
struct SixthDensePt<-1, 0, 0> {
enum { idx = 24 }; };
696 template<>
struct SixthDensePt< 1, 0, 0> {
enum { idx = 25 }; };
697 template<>
struct SixthDensePt< 2, 0, 0> {
enum { idx = 26 }; };
698 template<>
struct SixthDensePt< 3, 0, 0> {
enum { idx = 27 }; };
701 template<>
struct SixthDensePt<-3,-1, 0> {
enum { idx = 28 }; };
702 template<>
struct SixthDensePt<-2,-1, 0> {
enum { idx = 29 }; };
703 template<>
struct SixthDensePt<-1,-1, 0> {
enum { idx = 30 }; };
704 template<>
struct SixthDensePt< 0,-1, 0> {
enum { idx = 31 }; };
705 template<>
struct SixthDensePt< 1,-1, 0> {
enum { idx = 32 }; };
706 template<>
struct SixthDensePt< 2,-1, 0> {
enum { idx = 33 }; };
707 template<>
struct SixthDensePt< 3,-1, 0> {
enum { idx = 34 }; };
710 template<>
struct SixthDensePt<-3,-2, 0> {
enum { idx = 35 }; };
711 template<>
struct SixthDensePt<-2,-2, 0> {
enum { idx = 36 }; };
712 template<>
struct SixthDensePt<-1,-2, 0> {
enum { idx = 37 }; };
713 template<>
struct SixthDensePt< 0,-2, 0> {
enum { idx = 38 }; };
714 template<>
struct SixthDensePt< 1,-2, 0> {
enum { idx = 39 }; };
715 template<>
struct SixthDensePt< 2,-2, 0> {
enum { idx = 40 }; };
716 template<>
struct SixthDensePt< 3,-2, 0> {
enum { idx = 41 }; };
719 template<>
struct SixthDensePt<-3,-3, 0> {
enum { idx = 42 }; };
720 template<>
struct SixthDensePt<-2,-3, 0> {
enum { idx = 43 }; };
721 template<>
struct SixthDensePt<-1,-3, 0> {
enum { idx = 44 }; };
722 template<>
struct SixthDensePt< 0,-3, 0> {
enum { idx = 45 }; };
723 template<>
struct SixthDensePt< 1,-3, 0> {
enum { idx = 46 }; };
724 template<>
struct SixthDensePt< 2,-3, 0> {
enum { idx = 47 }; };
725 template<>
struct SixthDensePt< 3,-3, 0> {
enum { idx = 48 }; };
728 template<>
struct SixthDensePt<-3, 0, 3> {
enum { idx = 49 }; };
729 template<>
struct SixthDensePt<-2, 0, 3> {
enum { idx = 50 }; };
730 template<>
struct SixthDensePt<-1, 0, 3> {
enum { idx = 51 }; };
731 template<>
struct SixthDensePt< 0, 0, 3> {
enum { idx = 52 }; };
732 template<>
struct SixthDensePt< 1, 0, 3> {
enum { idx = 53 }; };
733 template<>
struct SixthDensePt< 2, 0, 3> {
enum { idx = 54 }; };
734 template<>
struct SixthDensePt< 3, 0, 3> {
enum { idx = 55 }; };
737 template<>
struct SixthDensePt<-3, 0, 2> {
enum { idx = 56 }; };
738 template<>
struct SixthDensePt<-2, 0, 2> {
enum { idx = 57 }; };
739 template<>
struct SixthDensePt<-1, 0, 2> {
enum { idx = 58 }; };
740 template<>
struct SixthDensePt< 0, 0, 2> {
enum { idx = 59 }; };
741 template<>
struct SixthDensePt< 1, 0, 2> {
enum { idx = 60 }; };
742 template<>
struct SixthDensePt< 2, 0, 2> {
enum { idx = 61 }; };
743 template<>
struct SixthDensePt< 3, 0, 2> {
enum { idx = 62 }; };
745 template<>
struct SixthDensePt<-3, 0, 1> {
enum { idx = 63 }; };
746 template<>
struct SixthDensePt<-2, 0, 1> {
enum { idx = 64 }; };
747 template<>
struct SixthDensePt<-1, 0, 1> {
enum { idx = 65 }; };
748 template<>
struct SixthDensePt< 0, 0, 1> {
enum { idx = 66 }; };
749 template<>
struct SixthDensePt< 1, 0, 1> {
enum { idx = 67 }; };
750 template<>
struct SixthDensePt< 2, 0, 1> {
enum { idx = 68 }; };
751 template<>
struct SixthDensePt< 3, 0, 1> {
enum { idx = 69 }; };
754 template<>
struct SixthDensePt<-3, 0,-1> {
enum { idx = 70 }; };
755 template<>
struct SixthDensePt<-2, 0,-1> {
enum { idx = 71 }; };
756 template<>
struct SixthDensePt<-1, 0,-1> {
enum { idx = 72 }; };
757 template<>
struct SixthDensePt< 0, 0,-1> {
enum { idx = 73 }; };
758 template<>
struct SixthDensePt< 1, 0,-1> {
enum { idx = 74 }; };
759 template<>
struct SixthDensePt< 2, 0,-1> {
enum { idx = 75 }; };
760 template<>
struct SixthDensePt< 3, 0,-1> {
enum { idx = 76 }; };
763 template<>
struct SixthDensePt<-3, 0,-2> {
enum { idx = 77 }; };
764 template<>
struct SixthDensePt<-2, 0,-2> {
enum { idx = 78 }; };
765 template<>
struct SixthDensePt<-1, 0,-2> {
enum { idx = 79 }; };
766 template<>
struct SixthDensePt< 0, 0,-2> {
enum { idx = 80 }; };
767 template<>
struct SixthDensePt< 1, 0,-2> {
enum { idx = 81 }; };
768 template<>
struct SixthDensePt< 2, 0,-2> {
enum { idx = 82 }; };
769 template<>
struct SixthDensePt< 3, 0,-2> {
enum { idx = 83 }; };
772 template<>
struct SixthDensePt<-3, 0,-3> {
enum { idx = 84 }; };
773 template<>
struct SixthDensePt<-2, 0,-3> {
enum { idx = 85 }; };
774 template<>
struct SixthDensePt<-1, 0,-3> {
enum { idx = 86 }; };
775 template<>
struct SixthDensePt< 0, 0,-3> {
enum { idx = 87 }; };
776 template<>
struct SixthDensePt< 1, 0,-3> {
enum { idx = 88 }; };
777 template<>
struct SixthDensePt< 2, 0,-3> {
enum { idx = 89 }; };
778 template<>
struct SixthDensePt< 3, 0,-3> {
enum { idx = 90 }; };
781 template<>
struct SixthDensePt< 0,-3, 3> {
enum { idx = 91 }; };
782 template<>
struct SixthDensePt< 0,-2, 3> {
enum { idx = 92 }; };
783 template<>
struct SixthDensePt< 0,-1, 3> {
enum { idx = 93 }; };
784 template<>
struct SixthDensePt< 0, 1, 3> {
enum { idx = 94 }; };
785 template<>
struct SixthDensePt< 0, 2, 3> {
enum { idx = 95 }; };
786 template<>
struct SixthDensePt< 0, 3, 3> {
enum { idx = 96 }; };
788 template<>
struct SixthDensePt< 0,-3, 2> {
enum { idx = 97 }; };
789 template<>
struct SixthDensePt< 0,-2, 2> {
enum { idx = 98 }; };
790 template<>
struct SixthDensePt< 0,-1, 2> {
enum { idx = 99 }; };
791 template<>
struct SixthDensePt< 0, 1, 2> {
enum { idx = 100 }; };
792 template<>
struct SixthDensePt< 0, 2, 2> {
enum { idx = 101 }; };
793 template<>
struct SixthDensePt< 0, 3, 2> {
enum { idx = 102 }; };
795 template<>
struct SixthDensePt< 0,-3, 1> {
enum { idx = 103 }; };
796 template<>
struct SixthDensePt< 0,-2, 1> {
enum { idx = 104 }; };
797 template<>
struct SixthDensePt< 0,-1, 1> {
enum { idx = 105 }; };
798 template<>
struct SixthDensePt< 0, 1, 1> {
enum { idx = 106 }; };
799 template<>
struct SixthDensePt< 0, 2, 1> {
enum { idx = 107 }; };
800 template<>
struct SixthDensePt< 0, 3, 1> {
enum { idx = 108 }; };
802 template<>
struct SixthDensePt< 0,-3,-1> {
enum { idx = 109 }; };
803 template<>
struct SixthDensePt< 0,-2,-1> {
enum { idx = 110 }; };
804 template<>
struct SixthDensePt< 0,-1,-1> {
enum { idx = 111 }; };
805 template<>
struct SixthDensePt< 0, 1,-1> {
enum { idx = 112 }; };
806 template<>
struct SixthDensePt< 0, 2,-1> {
enum { idx = 113 }; };
807 template<>
struct SixthDensePt< 0, 3,-1> {
enum { idx = 114 }; };
809 template<>
struct SixthDensePt< 0,-3,-2> {
enum { idx = 115 }; };
810 template<>
struct SixthDensePt< 0,-2,-2> {
enum { idx = 116 }; };
811 template<>
struct SixthDensePt< 0,-1,-2> {
enum { idx = 117 }; };
812 template<>
struct SixthDensePt< 0, 1,-2> {
enum { idx = 118 }; };
813 template<>
struct SixthDensePt< 0, 2,-2> {
enum { idx = 119 }; };
814 template<>
struct SixthDensePt< 0, 3,-2> {
enum { idx = 120 }; };
816 template<>
struct SixthDensePt< 0,-3,-3> {
enum { idx = 121 }; };
817 template<>
struct SixthDensePt< 0,-2,-3> {
enum { idx = 122 }; };
818 template<>
struct SixthDensePt< 0,-1,-3> {
enum { idx = 123 }; };
819 template<>
struct SixthDensePt< 0, 1,-3> {
enum { idx = 124 }; };
820 template<>
struct SixthDensePt< 0, 2,-3> {
enum { idx = 125 }; };
821 template<>
struct SixthDensePt< 0, 3,-3> {
enum { idx = 126 }; };
826 template<
typename Gr
idType>
835 static const int SIZE = 127;
840 template<
int i,
int j,
int k>
841 unsigned int pos()
const {
return SixthDensePt<i,j,k>::idx; }
844 inline void init(
const Coord& ijk)
846 mStencil[SixthDensePt<-3, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 3, 0));
847 mStencil[SixthDensePt<-2, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 3, 0));
848 mStencil[SixthDensePt<-1, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 3, 0));
849 mStencil[SixthDensePt< 0, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 0));
850 mStencil[SixthDensePt< 1, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 3, 0));
851 mStencil[SixthDensePt< 2, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 3, 0));
852 mStencil[SixthDensePt< 3, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 3, 0));
854 mStencil[SixthDensePt<-3, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 2, 0));
855 mStencil[SixthDensePt<-2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 2, 0));
856 mStencil[SixthDensePt<-1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 2, 0));
857 mStencil[SixthDensePt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
858 mStencil[SixthDensePt< 1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 2, 0));
859 mStencil[SixthDensePt< 2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 2, 0));
860 mStencil[SixthDensePt< 3, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 2, 0));
862 mStencil[SixthDensePt<-3, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 1, 0));
863 mStencil[SixthDensePt<-2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 1, 0));
864 mStencil[SixthDensePt<-1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
865 mStencil[SixthDensePt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
866 mStencil[SixthDensePt< 1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
867 mStencil[SixthDensePt< 2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 1, 0));
868 mStencil[SixthDensePt< 3, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 1, 0));
870 mStencil[SixthDensePt<-3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 0));
871 mStencil[SixthDensePt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
872 mStencil[SixthDensePt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
873 mStencil[SixthDensePt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
874 mStencil[SixthDensePt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
875 mStencil[SixthDensePt< 3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 0));
877 mStencil[SixthDensePt<-3,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3,-1, 0));
878 mStencil[SixthDensePt<-2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-1, 0));
879 mStencil[SixthDensePt<-1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-1, 0));
880 mStencil[SixthDensePt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 0));
881 mStencil[SixthDensePt< 1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-1, 0));
882 mStencil[SixthDensePt< 2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-1, 0));
883 mStencil[SixthDensePt< 3,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3,-1, 0));
885 mStencil[SixthDensePt<-3,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3,-2, 0));
886 mStencil[SixthDensePt<-2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-2, 0));
887 mStencil[SixthDensePt<-1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-2, 0));
888 mStencil[SixthDensePt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 0));
889 mStencil[SixthDensePt< 1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-2, 0));
890 mStencil[SixthDensePt< 2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-2, 0));
891 mStencil[SixthDensePt< 3,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3,-2, 0));
893 mStencil[SixthDensePt<-3,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3,-3, 0));
894 mStencil[SixthDensePt<-2,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-3, 0));
895 mStencil[SixthDensePt<-1,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-3, 0));
896 mStencil[SixthDensePt< 0,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 0));
897 mStencil[SixthDensePt< 1,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-3, 0));
898 mStencil[SixthDensePt< 2,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-3, 0));
899 mStencil[SixthDensePt< 3,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3,-3, 0));
901 mStencil[SixthDensePt<-3, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 3));
902 mStencil[SixthDensePt<-2, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 3));
903 mStencil[SixthDensePt<-1, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 3));
904 mStencil[SixthDensePt< 0, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 3));
905 mStencil[SixthDensePt< 1, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 3));
906 mStencil[SixthDensePt< 2, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 3));
907 mStencil[SixthDensePt< 3, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 3));
909 mStencil[SixthDensePt<-3, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 2));
910 mStencil[SixthDensePt<-2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 2));
911 mStencil[SixthDensePt<-1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 2));
912 mStencil[SixthDensePt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
913 mStencil[SixthDensePt< 1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 2));
914 mStencil[SixthDensePt< 2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 2));
915 mStencil[SixthDensePt< 3, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 2));
917 mStencil[SixthDensePt<-3, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 1));
918 mStencil[SixthDensePt<-2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 1));
919 mStencil[SixthDensePt<-1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
920 mStencil[SixthDensePt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
921 mStencil[SixthDensePt< 1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
922 mStencil[SixthDensePt< 2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 1));
923 mStencil[SixthDensePt< 3, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 1));
925 mStencil[SixthDensePt<-3, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0,-1));
926 mStencil[SixthDensePt<-2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-1));
927 mStencil[SixthDensePt<-1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-1));
928 mStencil[SixthDensePt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-1));
929 mStencil[SixthDensePt< 1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-1));
930 mStencil[SixthDensePt< 2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-1));
931 mStencil[SixthDensePt< 3, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0,-1));
933 mStencil[SixthDensePt<-3, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0,-2));
934 mStencil[SixthDensePt<-2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-2));
935 mStencil[SixthDensePt<-1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-2));
936 mStencil[SixthDensePt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-2));
937 mStencil[SixthDensePt< 1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-2));
938 mStencil[SixthDensePt< 2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-2));
939 mStencil[SixthDensePt< 3, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0,-2));
941 mStencil[SixthDensePt<-3, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0,-3));
942 mStencil[SixthDensePt<-2, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-3));
943 mStencil[SixthDensePt<-1, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-3));
944 mStencil[SixthDensePt< 0, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-3));
945 mStencil[SixthDensePt< 1, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-3));
946 mStencil[SixthDensePt< 2, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-3));
947 mStencil[SixthDensePt< 3, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0,-3));
949 mStencil[SixthDensePt< 0,-3, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 3));
950 mStencil[SixthDensePt< 0,-2, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 3));
951 mStencil[SixthDensePt< 0,-1, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 3));
952 mStencil[SixthDensePt< 0, 1, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 3));
953 mStencil[SixthDensePt< 0, 2, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 3));
954 mStencil[SixthDensePt< 0, 3, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 3));
956 mStencil[SixthDensePt< 0,-3, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 2));
957 mStencil[SixthDensePt< 0,-2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 2));
958 mStencil[SixthDensePt< 0,-1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 2));
959 mStencil[SixthDensePt< 0, 1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 2));
960 mStencil[SixthDensePt< 0, 2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 2));
961 mStencil[SixthDensePt< 0, 3, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 2));
963 mStencil[SixthDensePt< 0,-3, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 1));
964 mStencil[SixthDensePt< 0,-2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 1));
965 mStencil[SixthDensePt< 0,-1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 1));
966 mStencil[SixthDensePt< 0, 1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
967 mStencil[SixthDensePt< 0, 2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 1));
968 mStencil[SixthDensePt< 0, 3, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 1));
970 mStencil[SixthDensePt< 0,-3,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3,-1));
971 mStencil[SixthDensePt< 0,-2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-1));
972 mStencil[SixthDensePt< 0,-1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-1));
973 mStencil[SixthDensePt< 0, 1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-1));
974 mStencil[SixthDensePt< 0, 2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-1));
975 mStencil[SixthDensePt< 0, 3,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3,-1));
977 mStencil[SixthDensePt< 0,-3,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3,-2));
978 mStencil[SixthDensePt< 0,-2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-2));
979 mStencil[SixthDensePt< 0,-1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-2));
980 mStencil[SixthDensePt< 0, 1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-2));
981 mStencil[SixthDensePt< 0, 2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-2));
982 mStencil[SixthDensePt< 0, 3,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3,-2));
984 mStencil[SixthDensePt< 0,-3,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3,-3));
985 mStencil[SixthDensePt< 0,-2,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-3));
986 mStencil[SixthDensePt< 0,-1,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-3));
987 mStencil[SixthDensePt< 0, 1,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-3));
988 mStencil[SixthDensePt< 0, 2,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-3));
989 mStencil[SixthDensePt< 0, 3,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3,-3));
993 using BaseType::mCache;
994 using BaseType::mStencil;
1007 template<
typename Gr
idType>
1016 static const int SIZE = 7;
1020 mInv2Dx(
ValueType(0.5 / grid.voxelSize()[0])),
1021 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1028 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1040 mStencil[0] - mStencil[1],
1041 mStencil[2] - mStencil[0],
1042 mStencil[0] - mStencil[3],
1043 mStencil[4] - mStencil[0],
1044 mStencil[0] - mStencil[5],
1045 mStencil[6] - mStencil[0]);
1055 return Vec3Type(mStencil[2] - mStencil[1],
1056 mStencil[4] - mStencil[3],
1057 mStencil[6] - mStencil[5])*mInv2Dx;
1065 return Vec3Type(V[0]>0 ? mStencil[0] - mStencil[1] : mStencil[2] - mStencil[0],
1066 V[1]>0 ? mStencil[0] - mStencil[3] : mStencil[4] - mStencil[0],
1067 V[2]>0 ? mStencil[0] - mStencil[5] : mStencil[6] - mStencil[0])*2*mInv2Dx;
1074 return mInvDx2 * (mStencil[1] + mStencil[2] +
1075 mStencil[3] + mStencil[4] +
1076 mStencil[5] + mStencil[6] - 6*mStencil[0]);
1084 return (v[0]>0 ? (v[1]<0 || v[2]<0 || v[3]<0 || v[4]<0 || v[5]<0 || v[6]<0)
1085 : (v[1]>0 || v[2]>0 || v[3]>0 || v[4]>0 || v[5]>0 || v[6]>0));
1097 const Coord& ijk = BaseType::getCenterCoord();
1099 return Vec3Type(ijk[0] - d*(mStencil[2] - mStencil[1]),
1100 ijk[1] - d*(mStencil[4] - mStencil[3]),
1101 ijk[2] - d*(mStencil[6] - mStencil[5]));
1106 inline void init(
const Coord& ijk)
1108 mStencil[1] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
1109 mStencil[2] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
1111 mStencil[3] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
1112 mStencil[4] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
1114 mStencil[5] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
1115 mStencil[6] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
1119 using BaseType::mCache;
1120 using BaseType::mStencil;
1133 template<
typename Gr
idType>
1142 static const int SIZE = 19;
1147 mInv2Dx(
ValueType(0.5 / grid.voxelSize()[0])),
1171 v1(v[2]-v[1], v[ 8]-v[ 7], v[14]-v[13], 0),
1172 v2(v[3]-v[2], v[ 9]-v[ 8], v[15]-v[14], 0),
1173 v3(v[0]-v[3], v[ 0]-v[ 9], v[ 0]-v[15], 0),
1174 v4(v[4]-v[0], v[10]-v[ 0], v[16]-v[ 0], 0),
1175 v5(v[5]-v[4], v[11]-v[10], v[17]-v[16], 0),
1176 v6(v[6]-v[5], v[12]-v[11], v[18]-v[17], 0),
1183 dP_xm =
math::WENO5(v[ 2]-v[ 1],v[ 3]-v[ 2],v[ 0]-v[ 3],v[ 4]-v[ 0],v[ 5]-v[ 4],mDx2),
1184 dP_xp =
math::WENO5(v[ 6]-v[ 5],v[ 5]-v[ 4],v[ 4]-v[ 0],v[ 0]-v[ 3],v[ 3]-v[ 2],mDx2),
1185 dP_ym =
math::WENO5(v[ 8]-v[ 7],v[ 9]-v[ 8],v[ 0]-v[ 9],v[10]-v[ 0],v[11]-v[10],mDx2),
1186 dP_yp =
math::WENO5(v[12]-v[11],v[11]-v[10],v[10]-v[ 0],v[ 0]-v[ 9],v[ 9]-v[ 8],mDx2),
1187 dP_zm =
math::WENO5(v[14]-v[13],v[15]-v[14],v[ 0]-v[15],v[16]-v[ 0],v[17]-v[16],mDx2),
1188 dP_zp =
math::WENO5(v[18]-v[17],v[17]-v[16],v[16]-v[ 0],v[ 0]-v[15],v[15]-v[14],mDx2);
1202 V[0]>0 ?
math::WENO5(v[ 2]-v[ 1],v[ 3]-v[ 2],v[ 0]-v[ 3], v[ 4]-v[ 0],v[ 5]-v[ 4],mDx2)
1203 :
math::WENO5(v[ 6]-v[ 5],v[ 5]-v[ 4],v[ 4]-v[ 0], v[ 0]-v[ 3],v[ 3]-v[ 2],mDx2),
1204 V[1]>0 ?
math::WENO5(v[ 8]-v[ 7],v[ 9]-v[ 8],v[ 0]-v[ 9], v[10]-v[ 0],v[11]-v[10],mDx2)
1205 :
math::WENO5(v[12]-v[11],v[11]-v[10],v[10]-v[ 0], v[ 0]-v[ 9],v[ 9]-v[ 8],mDx2),
1206 V[2]>0 ?
math::WENO5(v[14]-v[13],v[15]-v[14],v[ 0]-v[15], v[16]-v[ 0],v[17]-v[16],mDx2)
1207 :
math::WENO5(v[18]-v[17],v[17]-v[16],v[16]-v[ 0], v[ 0]-v[15],v[15]-v[14],mDx2));
1217 mStencil[ 4] - mStencil[ 3],
1218 mStencil[10] - mStencil[ 9],
1219 mStencil[16] - mStencil[15]);
1230 mStencil[ 3] + mStencil[ 4] +
1231 mStencil[ 9] + mStencil[10] +
1232 mStencil[15] + mStencil[16] - 6*mStencil[0]);
1240 return (v[ 0]>0 ? (v[ 3]<0 || v[ 4]<0 || v[ 9]<0 || v[10]<0 || v[15]<0 || v[16]<0)
1241 : (v[ 3]>0 || v[ 4]>0 || v[ 9]>0 || v[10]>0 || v[15]>0 || v[16]>0));
1245 inline void init(
const Coord& ijk)
1247 mStencil[ 1] = mCache.getValue(ijk.
offsetBy(-3, 0, 0));
1248 mStencil[ 2] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
1249 mStencil[ 3] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
1250 mStencil[ 4] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
1251 mStencil[ 5] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
1252 mStencil[ 6] = mCache.getValue(ijk.
offsetBy( 3, 0, 0));
1254 mStencil[ 7] = mCache.getValue(ijk.
offsetBy( 0, -3, 0));
1255 mStencil[ 8] = mCache.getValue(ijk.
offsetBy( 0, -2, 0));
1256 mStencil[ 9] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
1257 mStencil[10] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
1258 mStencil[11] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
1259 mStencil[12] = mCache.getValue(ijk.
offsetBy( 0, 3, 0));
1261 mStencil[13] = mCache.getValue(ijk.
offsetBy( 0, 0, -3));
1262 mStencil[14] = mCache.getValue(ijk.
offsetBy( 0, 0, -2));
1263 mStencil[15] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
1264 mStencil[16] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
1265 mStencil[17] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
1266 mStencil[18] = mCache.getValue(ijk.
offsetBy( 0, 0, 3));
1270 using BaseType::mCache;
1271 using BaseType::mStencil;
1279 template<
typename Gr
idType>
1286 static const int SIZE = 19;
1290 mInv2Dx(
ValueType(0.5 / grid.voxelSize()[0])),
1291 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1298 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1334 mStencil[1] + mStencil[2] +
1335 mStencil[3] + mStencil[4] +
1336 mStencil[5] + mStencil[6] - 6*mStencil[0]);
1347 mStencil[2] - mStencil[1],
1348 mStencil[4] - mStencil[3],
1349 mStencil[6] - mStencil[5])*mInv2Dx;
1353 inline void init(
const Coord &ijk)
1355 mStencil[ 1] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
1356 mStencil[ 2] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
1358 mStencil[ 3] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
1359 mStencil[ 4] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
1361 mStencil[ 5] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
1362 mStencil[ 6] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
1364 mStencil[ 7] = mCache.getValue(ijk.
offsetBy(-1, -1, 0));
1365 mStencil[ 8] = mCache.getValue(ijk.
offsetBy( 1, -1, 0));
1366 mStencil[ 9] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
1367 mStencil[10] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
1369 mStencil[11] = mCache.getValue(ijk.
offsetBy(-1, 0, -1));
1370 mStencil[12] = mCache.getValue(ijk.
offsetBy( 1, 0, -1));
1371 mStencil[13] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
1372 mStencil[14] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
1374 mStencil[15] = mCache.getValue(ijk.
offsetBy( 0, -1, -1));
1375 mStencil[16] = mCache.getValue(ijk.
offsetBy( 0, 1, -1));
1376 mStencil[17] = mCache.getValue(ijk.
offsetBy( 0, -1, 1));
1377 mStencil[18] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
1384 Half(0.5), Quarter(0.25),
1385 Dx = Half * (mStencil[2] - mStencil[1]), Dx2 = Dx * Dx,
1386 Dy = Half * (mStencil[4] - mStencil[3]), Dy2 = Dy * Dy,
1387 Dz = Half * (mStencil[6] - mStencil[5]), Dz2 = Dz * Dz,
1388 Dxx = mStencil[2] - 2 * mStencil[0] + mStencil[1],
1389 Dyy = mStencil[4] - 2 * mStencil[0] + mStencil[3],
1390 Dzz = mStencil[6] - 2 * mStencil[0] + mStencil[5],
1391 Dxy = Quarter * (mStencil[10] - mStencil[ 8] + mStencil[7] - mStencil[ 9]),
1392 Dxz = Quarter * (mStencil[14] - mStencil[12] + mStencil[11] - mStencil[13]),
1393 Dyz = Quarter * (mStencil[18] - mStencil[16] + mStencil[15] - mStencil[17]);
1394 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
1395 beta = std::sqrt(Dx2 + Dy2 + Dz2);
1399 using BaseType::mCache;
1400 using BaseType::mStencil;
1409 template<
typename Gr
idType>
1418 mHalfWidth(halfWidth)
1420 assert(halfWidth>0);
1429 BaseType::mCenter = ijk;
1434 template<
typename IterType>
1437 BaseType::mCenter = iter.getCoord();
1438 this->init(BaseType::mCenter);
1444 inline void init(
const Coord& ijk)
1448 for (p[1] = ijk[1]-mHalfWidth; p[1] <= q[1]; ++p[1]) {
1449 for (p[2] = ijk[2]-mHalfWidth; p[2] <= q[2]; ++p[2]) {
1450 mStencil[n++] = mCache.getValue(p);
1457 using BaseType::mCache;
1458 using BaseType::mStencil;
1459 const int mHalfWidth;
1467 #endif // OPENVDB_MATH_STENCILS_HAS_BEEN_INCLUDED