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;
65 inline void moveTo(
const Coord& ijk)
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);
88 inline ValueType getValue(
unsigned int pos = 0)
const
90 assert(pos < mStencil.size());
95 template<
int i,
int j,
int k>
98 return mStencil[
static_cast<const StencilType&
>(*this).template pos<i,j,k>()];
102 template<
int i,
int j,
int k>
105 mStencil[
static_cast<const StencilType&
>(*this).template pos<i,j,k>()] = value;
109 inline int size() {
return mStencil.size(); }
114 std::vector<ValueType> tmp(mStencil);
115 assert(!tmp.empty());
116 size_t midpoint = (tmp.size() - 1) >> 1;
118 std::nth_element(tmp.begin(), tmp.begin() + midpoint, tmp.end());
119 return tmp[midpoint];
126 for (
int n=0, s=mStencil.size(); n<s; ++n) sum += mStencil[n];
133 IterType iter = std::min_element(mStencil.begin(), mStencil.end());
140 IterType iter = std::max_element(mStencil.begin(), mStencil.end());
150 return this->getValue<0,0,0>();
155 inline bool intersects(
const ValueType &isoValue = zeroVal<ValueType>())
const
157 const bool less = this->getValue< 0, 0, 0>() < isoValue;
158 return (less ^ (this->getValue<-1, 0, 0>() < isoValue)) ||
159 (less ^ (this->getValue< 1, 0, 0>() < isoValue)) ||
160 (less ^ (this->getValue< 0,-1, 0>() < isoValue)) ||
161 (less ^ (this->getValue< 0, 1, 0>() < isoValue)) ||
162 (less ^ (this->getValue< 0, 0,-1>() < isoValue)) ||
163 (less ^ (this->getValue< 0, 0, 1>() < isoValue)) ;
169 mCache(grid.getConstAccessor()),
187 template<
int i,
int j,
int k>
struct SevenPt {};
188 template<>
struct SevenPt< 0, 0, 0> {
enum { idx = 0 }; };
189 template<>
struct SevenPt< 1, 0, 0> {
enum { idx = 1 }; };
190 template<>
struct SevenPt< 0, 1, 0> {
enum { idx = 2 }; };
191 template<>
struct SevenPt< 0, 0, 1> {
enum { idx = 3 }; };
192 template<>
struct SevenPt<-1, 0, 0> {
enum { idx = 4 }; };
193 template<>
struct SevenPt< 0,-1, 0> {
enum { idx = 5 }; };
194 template<>
struct SevenPt< 0, 0,-1> {
enum { idx = 6 }; };
199 template<
typename Gr
idType>
207 static const int SIZE = 7;
212 template<
int i,
int j,
int k>
213 unsigned int pos()
const {
return SevenPt<i,j,k>::idx; }
216 inline void init(
const Coord& ijk)
218 BaseType::template setValue< 0, 0, 0>(mCache.getValue(ijk));
220 BaseType::template setValue<-1, 0, 0>(mCache.getValue(ijk.
offsetBy(-1, 0, 0)));
221 BaseType::template setValue< 1, 0, 0>(mCache.getValue(ijk.
offsetBy( 1, 0, 0)));
223 BaseType::template setValue< 0,-1, 0>(mCache.getValue(ijk.
offsetBy( 0,-1, 0)));
224 BaseType::template setValue< 0, 1, 0>(mCache.getValue(ijk.
offsetBy( 0, 1, 0)));
226 BaseType::template setValue< 0, 0,-1>(mCache.getValue(ijk.
offsetBy( 0, 0,-1)));
227 BaseType::template setValue< 0, 0, 1>(mCache.getValue(ijk.
offsetBy( 0, 0, 1)));
231 using BaseType::mCache;
232 using BaseType::mStencil;
242 template<
int i,
int j,
int k>
struct DensePt {};
243 template<>
struct DensePt< 0, 0, 0> {
enum { idx = 0 }; };
245 template<>
struct DensePt< 1, 0, 0> {
enum { idx = 1 }; };
246 template<>
struct DensePt< 0, 1, 0> {
enum { idx = 2 }; };
247 template<>
struct DensePt< 0, 0, 1> {
enum { idx = 3 }; };
249 template<>
struct DensePt<-1, 0, 0> {
enum { idx = 4 }; };
250 template<>
struct DensePt< 0,-1, 0> {
enum { idx = 5 }; };
251 template<>
struct DensePt< 0, 0,-1> {
enum { idx = 6 }; };
253 template<>
struct DensePt<-1,-1, 0> {
enum { idx = 7 }; };
254 template<>
struct DensePt< 0,-1,-1> {
enum { idx = 8 }; };
255 template<>
struct DensePt<-1, 0,-1> {
enum { idx = 9 }; };
257 template<>
struct DensePt< 1,-1, 0> {
enum { idx = 10 }; };
258 template<>
struct DensePt< 0, 1,-1> {
enum { idx = 11 }; };
259 template<>
struct DensePt<-1, 0, 1> {
enum { idx = 12 }; };
261 template<>
struct DensePt<-1, 1, 0> {
enum { idx = 13 }; };
262 template<>
struct DensePt< 0,-1, 1> {
enum { idx = 14 }; };
263 template<>
struct DensePt< 1, 0,-1> {
enum { idx = 15 }; };
265 template<>
struct DensePt< 1, 1, 0> {
enum { idx = 16 }; };
266 template<>
struct DensePt< 0, 1, 1> {
enum { idx = 17 }; };
267 template<>
struct DensePt< 1, 0, 1> {
enum { idx = 18 }; };
272 template<
typename Gr
idType>
281 static const int SIZE = 19;
286 template<
int i,
int j,
int k>
287 unsigned int pos()
const {
return DensePt<i,j,k>::idx; }
290 inline void init(
const Coord& ijk)
292 mStencil[DensePt< 0, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 0));
294 mStencil[DensePt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
295 mStencil[DensePt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
296 mStencil[DensePt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
298 mStencil[DensePt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
299 mStencil[DensePt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
300 mStencil[DensePt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
302 mStencil[DensePt<-1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, -1, 0));
303 mStencil[DensePt< 1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, -1, 0));
304 mStencil[DensePt<-1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
305 mStencil[DensePt< 1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
307 mStencil[DensePt<-1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, -1));
308 mStencil[DensePt< 1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, -1));
309 mStencil[DensePt<-1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
310 mStencil[DensePt< 1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
312 mStencil[DensePt< 0,-1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, -1));
313 mStencil[DensePt< 0, 1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, -1));
314 mStencil[DensePt< 0,-1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 1));
315 mStencil[DensePt< 0, 1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
319 using BaseType::mCache;
320 using BaseType::mStencil;
330 template<
int i,
int j,
int k>
struct ThirteenPt {};
331 template<>
struct ThirteenPt< 0, 0, 0> {
enum { idx = 0 }; };
333 template<>
struct ThirteenPt< 1, 0, 0> {
enum { idx = 1 }; };
334 template<>
struct ThirteenPt< 0, 1, 0> {
enum { idx = 2 }; };
335 template<>
struct ThirteenPt< 0, 0, 1> {
enum { idx = 3 }; };
337 template<>
struct ThirteenPt<-1, 0, 0> {
enum { idx = 4 }; };
338 template<>
struct ThirteenPt< 0,-1, 0> {
enum { idx = 5 }; };
339 template<>
struct ThirteenPt< 0, 0,-1> {
enum { idx = 6 }; };
341 template<>
struct ThirteenPt< 2, 0, 0> {
enum { idx = 7 }; };
342 template<>
struct ThirteenPt< 0, 2, 0> {
enum { idx = 8 }; };
343 template<>
struct ThirteenPt< 0, 0, 2> {
enum { idx = 9 }; };
345 template<>
struct ThirteenPt<-2, 0, 0> {
enum { idx = 10 }; };
346 template<>
struct ThirteenPt< 0,-2, 0> {
enum { idx = 11 }; };
347 template<>
struct ThirteenPt< 0, 0,-2> {
enum { idx = 12 }; };
352 template<
typename Gr
idType>
361 static const int SIZE = 13;
366 template<
int i,
int j,
int k>
367 unsigned int pos()
const {
return ThirteenPt<i,j,k>::idx; }
370 inline void init(
const Coord& ijk)
372 mStencil[ThirteenPt< 0, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 0));
374 mStencil[ThirteenPt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
375 mStencil[ThirteenPt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
376 mStencil[ThirteenPt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
377 mStencil[ThirteenPt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
379 mStencil[ThirteenPt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
380 mStencil[ThirteenPt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
381 mStencil[ThirteenPt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
382 mStencil[ThirteenPt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -2, 0));
384 mStencil[ThirteenPt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
385 mStencil[ThirteenPt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
386 mStencil[ThirteenPt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
387 mStencil[ThirteenPt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -2));
391 using BaseType::mCache;
392 using BaseType::mStencil;
402 template<
int i,
int j,
int k>
struct FourthDensePt {};
403 template<>
struct FourthDensePt< 0, 0, 0> {
enum { idx = 0 }; };
405 template<>
struct FourthDensePt<-2, 2, 0> {
enum { idx = 1 }; };
406 template<>
struct FourthDensePt<-1, 2, 0> {
enum { idx = 2 }; };
407 template<>
struct FourthDensePt< 0, 2, 0> {
enum { idx = 3 }; };
408 template<>
struct FourthDensePt< 1, 2, 0> {
enum { idx = 4 }; };
409 template<>
struct FourthDensePt< 2, 2, 0> {
enum { idx = 5 }; };
411 template<>
struct FourthDensePt<-2, 1, 0> {
enum { idx = 6 }; };
412 template<>
struct FourthDensePt<-1, 1, 0> {
enum { idx = 7 }; };
413 template<>
struct FourthDensePt< 0, 1, 0> {
enum { idx = 8 }; };
414 template<>
struct FourthDensePt< 1, 1, 0> {
enum { idx = 9 }; };
415 template<>
struct FourthDensePt< 2, 1, 0> {
enum { idx = 10 }; };
417 template<>
struct FourthDensePt<-2, 0, 0> {
enum { idx = 11 }; };
418 template<>
struct FourthDensePt<-1, 0, 0> {
enum { idx = 12 }; };
419 template<>
struct FourthDensePt< 1, 0, 0> {
enum { idx = 13 }; };
420 template<>
struct FourthDensePt< 2, 0, 0> {
enum { idx = 14 }; };
422 template<>
struct FourthDensePt<-2,-1, 0> {
enum { idx = 15 }; };
423 template<>
struct FourthDensePt<-1,-1, 0> {
enum { idx = 16 }; };
424 template<>
struct FourthDensePt< 0,-1, 0> {
enum { idx = 17 }; };
425 template<>
struct FourthDensePt< 1,-1, 0> {
enum { idx = 18 }; };
426 template<>
struct FourthDensePt< 2,-1, 0> {
enum { idx = 19 }; };
428 template<>
struct FourthDensePt<-2,-2, 0> {
enum { idx = 20 }; };
429 template<>
struct FourthDensePt<-1,-2, 0> {
enum { idx = 21 }; };
430 template<>
struct FourthDensePt< 0,-2, 0> {
enum { idx = 22 }; };
431 template<>
struct FourthDensePt< 1,-2, 0> {
enum { idx = 23 }; };
432 template<>
struct FourthDensePt< 2,-2, 0> {
enum { idx = 24 }; };
435 template<>
struct FourthDensePt<-2, 0, 2> {
enum { idx = 25 }; };
436 template<>
struct FourthDensePt<-1, 0, 2> {
enum { idx = 26 }; };
437 template<>
struct FourthDensePt< 0, 0, 2> {
enum { idx = 27 }; };
438 template<>
struct FourthDensePt< 1, 0, 2> {
enum { idx = 28 }; };
439 template<>
struct FourthDensePt< 2, 0, 2> {
enum { idx = 29 }; };
441 template<>
struct FourthDensePt<-2, 0, 1> {
enum { idx = 30 }; };
442 template<>
struct FourthDensePt<-1, 0, 1> {
enum { idx = 31 }; };
443 template<>
struct FourthDensePt< 0, 0, 1> {
enum { idx = 32 }; };
444 template<>
struct FourthDensePt< 1, 0, 1> {
enum { idx = 33 }; };
445 template<>
struct FourthDensePt< 2, 0, 1> {
enum { idx = 34 }; };
447 template<>
struct FourthDensePt<-2, 0,-1> {
enum { idx = 35 }; };
448 template<>
struct FourthDensePt<-1, 0,-1> {
enum { idx = 36 }; };
449 template<>
struct FourthDensePt< 0, 0,-1> {
enum { idx = 37 }; };
450 template<>
struct FourthDensePt< 1, 0,-1> {
enum { idx = 38 }; };
451 template<>
struct FourthDensePt< 2, 0,-1> {
enum { idx = 39 }; };
453 template<>
struct FourthDensePt<-2, 0,-2> {
enum { idx = 40 }; };
454 template<>
struct FourthDensePt<-1, 0,-2> {
enum { idx = 41 }; };
455 template<>
struct FourthDensePt< 0, 0,-2> {
enum { idx = 42 }; };
456 template<>
struct FourthDensePt< 1, 0,-2> {
enum { idx = 43 }; };
457 template<>
struct FourthDensePt< 2, 0,-2> {
enum { idx = 44 }; };
460 template<>
struct FourthDensePt< 0,-2, 2> {
enum { idx = 45 }; };
461 template<>
struct FourthDensePt< 0,-1, 2> {
enum { idx = 46 }; };
462 template<>
struct FourthDensePt< 0, 1, 2> {
enum { idx = 47 }; };
463 template<>
struct FourthDensePt< 0, 2, 2> {
enum { idx = 48 }; };
465 template<>
struct FourthDensePt< 0,-2, 1> {
enum { idx = 49 }; };
466 template<>
struct FourthDensePt< 0,-1, 1> {
enum { idx = 50 }; };
467 template<>
struct FourthDensePt< 0, 1, 1> {
enum { idx = 51 }; };
468 template<>
struct FourthDensePt< 0, 2, 1> {
enum { idx = 52 }; };
470 template<>
struct FourthDensePt< 0,-2,-1> {
enum { idx = 53 }; };
471 template<>
struct FourthDensePt< 0,-1,-1> {
enum { idx = 54 }; };
472 template<>
struct FourthDensePt< 0, 1,-1> {
enum { idx = 55 }; };
473 template<>
struct FourthDensePt< 0, 2,-1> {
enum { idx = 56 }; };
475 template<>
struct FourthDensePt< 0,-2,-2> {
enum { idx = 57 }; };
476 template<>
struct FourthDensePt< 0,-1,-2> {
enum { idx = 58 }; };
477 template<>
struct FourthDensePt< 0, 1,-2> {
enum { idx = 59 }; };
478 template<>
struct FourthDensePt< 0, 2,-2> {
enum { idx = 60 }; };
483 template<
typename Gr
idType>
492 static const int SIZE = 61;
497 template<
int i,
int j,
int k>
498 unsigned int pos()
const {
return FourthDensePt<i,j,k>::idx; }
501 inline void init(
const Coord& ijk)
503 mStencil[FourthDensePt< 0, 0, 0>::idx] = mCache.getValue(ijk);
505 mStencil[FourthDensePt<-2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 2, 0));
506 mStencil[FourthDensePt<-1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 2, 0));
507 mStencil[FourthDensePt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
508 mStencil[FourthDensePt< 1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 2, 0));
509 mStencil[FourthDensePt< 2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 2, 0));
511 mStencil[FourthDensePt<-2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 1, 0));
512 mStencil[FourthDensePt<-1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
513 mStencil[FourthDensePt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
514 mStencil[FourthDensePt< 1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
515 mStencil[FourthDensePt< 2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 1, 0));
517 mStencil[FourthDensePt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
518 mStencil[FourthDensePt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
519 mStencil[FourthDensePt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
520 mStencil[FourthDensePt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
522 mStencil[FourthDensePt<-2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-1, 0));
523 mStencil[FourthDensePt<-1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-1, 0));
524 mStencil[FourthDensePt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 0));
525 mStencil[FourthDensePt< 1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-1, 0));
526 mStencil[FourthDensePt< 2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-1, 0));
528 mStencil[FourthDensePt<-2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-2, 0));
529 mStencil[FourthDensePt<-1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-2, 0));
530 mStencil[FourthDensePt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 0));
531 mStencil[FourthDensePt< 1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-2, 0));
532 mStencil[FourthDensePt< 2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-2, 0));
534 mStencil[FourthDensePt<-2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 2));
535 mStencil[FourthDensePt<-1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 2));
536 mStencil[FourthDensePt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
537 mStencil[FourthDensePt< 1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 2));
538 mStencil[FourthDensePt< 2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 2));
540 mStencil[FourthDensePt<-2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 1));
541 mStencil[FourthDensePt<-1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
542 mStencil[FourthDensePt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
543 mStencil[FourthDensePt< 1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
544 mStencil[FourthDensePt< 2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 1));
546 mStencil[FourthDensePt<-2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-1));
547 mStencil[FourthDensePt<-1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-1));
548 mStencil[FourthDensePt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-1));
549 mStencil[FourthDensePt< 1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-1));
550 mStencil[FourthDensePt< 2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-1));
552 mStencil[FourthDensePt<-2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-2));
553 mStencil[FourthDensePt<-1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-2));
554 mStencil[FourthDensePt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-2));
555 mStencil[FourthDensePt< 1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-2));
556 mStencil[FourthDensePt< 2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-2));
559 mStencil[FourthDensePt< 0,-2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 2));
560 mStencil[FourthDensePt< 0,-1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 2));
561 mStencil[FourthDensePt< 0, 1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 2));
562 mStencil[FourthDensePt< 0, 2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 2));
564 mStencil[FourthDensePt< 0,-2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 1));
565 mStencil[FourthDensePt< 0,-1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 1));
566 mStencil[FourthDensePt< 0, 1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
567 mStencil[FourthDensePt< 0, 2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 1));
569 mStencil[FourthDensePt< 0,-2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-1));
570 mStencil[FourthDensePt< 0,-1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-1));
571 mStencil[FourthDensePt< 0, 1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-1));
572 mStencil[FourthDensePt< 0, 2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-1));
574 mStencil[FourthDensePt< 0,-2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-2));
575 mStencil[FourthDensePt< 0,-1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-2));
576 mStencil[FourthDensePt< 0, 1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-2));
577 mStencil[FourthDensePt< 0, 2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-2));
581 using BaseType::mCache;
582 using BaseType::mStencil;
592 template<
int i,
int j,
int k>
struct NineteenPt {};
593 template<>
struct NineteenPt< 0, 0, 0> {
enum { idx = 0 }; };
595 template<>
struct NineteenPt< 1, 0, 0> {
enum { idx = 1 }; };
596 template<>
struct NineteenPt< 0, 1, 0> {
enum { idx = 2 }; };
597 template<>
struct NineteenPt< 0, 0, 1> {
enum { idx = 3 }; };
599 template<>
struct NineteenPt<-1, 0, 0> {
enum { idx = 4 }; };
600 template<>
struct NineteenPt< 0,-1, 0> {
enum { idx = 5 }; };
601 template<>
struct NineteenPt< 0, 0,-1> {
enum { idx = 6 }; };
603 template<>
struct NineteenPt< 2, 0, 0> {
enum { idx = 7 }; };
604 template<>
struct NineteenPt< 0, 2, 0> {
enum { idx = 8 }; };
605 template<>
struct NineteenPt< 0, 0, 2> {
enum { idx = 9 }; };
607 template<>
struct NineteenPt<-2, 0, 0> {
enum { idx = 10 }; };
608 template<>
struct NineteenPt< 0,-2, 0> {
enum { idx = 11 }; };
609 template<>
struct NineteenPt< 0, 0,-2> {
enum { idx = 12 }; };
611 template<>
struct NineteenPt< 3, 0, 0> {
enum { idx = 13 }; };
612 template<>
struct NineteenPt< 0, 3, 0> {
enum { idx = 14 }; };
613 template<>
struct NineteenPt< 0, 0, 3> {
enum { idx = 15 }; };
615 template<>
struct NineteenPt<-3, 0, 0> {
enum { idx = 16 }; };
616 template<>
struct NineteenPt< 0,-3, 0> {
enum { idx = 17 }; };
617 template<>
struct NineteenPt< 0, 0,-3> {
enum { idx = 18 }; };
622 template<
typename Gr
idType>
631 static const int SIZE = 19;
636 template<
int i,
int j,
int k>
637 unsigned int pos()
const {
return NineteenPt<i,j,k>::idx; }
640 inline void init(
const Coord& ijk)
642 mStencil[NineteenPt< 3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 0));
643 mStencil[NineteenPt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
644 mStencil[NineteenPt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
645 mStencil[NineteenPt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
646 mStencil[NineteenPt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
647 mStencil[NineteenPt<-3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 0));
649 mStencil[NineteenPt< 0, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 0));
650 mStencil[NineteenPt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
651 mStencil[NineteenPt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
652 mStencil[NineteenPt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
653 mStencil[NineteenPt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -2, 0));
654 mStencil[NineteenPt< 0,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, -3, 0));
657 mStencil[NineteenPt< 0, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 3));
658 mStencil[NineteenPt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
659 mStencil[NineteenPt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
660 mStencil[NineteenPt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
661 mStencil[NineteenPt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -2));
662 mStencil[NineteenPt< 0, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, -3));
666 using BaseType::mCache;
667 using BaseType::mStencil;
677 template<
int i,
int j,
int k>
struct SixthDensePt { };
678 template<>
struct SixthDensePt< 0, 0, 0> {
enum { idx = 0 }; };
680 template<>
struct SixthDensePt<-3, 3, 0> {
enum { idx = 1 }; };
681 template<>
struct SixthDensePt<-2, 3, 0> {
enum { idx = 2 }; };
682 template<>
struct SixthDensePt<-1, 3, 0> {
enum { idx = 3 }; };
683 template<>
struct SixthDensePt< 0, 3, 0> {
enum { idx = 4 }; };
684 template<>
struct SixthDensePt< 1, 3, 0> {
enum { idx = 5 }; };
685 template<>
struct SixthDensePt< 2, 3, 0> {
enum { idx = 6 }; };
686 template<>
struct SixthDensePt< 3, 3, 0> {
enum { idx = 7 }; };
688 template<>
struct SixthDensePt<-3, 2, 0> {
enum { idx = 8 }; };
689 template<>
struct SixthDensePt<-2, 2, 0> {
enum { idx = 9 }; };
690 template<>
struct SixthDensePt<-1, 2, 0> {
enum { idx = 10 }; };
691 template<>
struct SixthDensePt< 0, 2, 0> {
enum { idx = 11 }; };
692 template<>
struct SixthDensePt< 1, 2, 0> {
enum { idx = 12 }; };
693 template<>
struct SixthDensePt< 2, 2, 0> {
enum { idx = 13 }; };
694 template<>
struct SixthDensePt< 3, 2, 0> {
enum { idx = 14 }; };
696 template<>
struct SixthDensePt<-3, 1, 0> {
enum { idx = 15 }; };
697 template<>
struct SixthDensePt<-2, 1, 0> {
enum { idx = 16 }; };
698 template<>
struct SixthDensePt<-1, 1, 0> {
enum { idx = 17 }; };
699 template<>
struct SixthDensePt< 0, 1, 0> {
enum { idx = 18 }; };
700 template<>
struct SixthDensePt< 1, 1, 0> {
enum { idx = 19 }; };
701 template<>
struct SixthDensePt< 2, 1, 0> {
enum { idx = 20 }; };
702 template<>
struct SixthDensePt< 3, 1, 0> {
enum { idx = 21 }; };
704 template<>
struct SixthDensePt<-3, 0, 0> {
enum { idx = 22 }; };
705 template<>
struct SixthDensePt<-2, 0, 0> {
enum { idx = 23 }; };
706 template<>
struct SixthDensePt<-1, 0, 0> {
enum { idx = 24 }; };
707 template<>
struct SixthDensePt< 1, 0, 0> {
enum { idx = 25 }; };
708 template<>
struct SixthDensePt< 2, 0, 0> {
enum { idx = 26 }; };
709 template<>
struct SixthDensePt< 3, 0, 0> {
enum { idx = 27 }; };
712 template<>
struct SixthDensePt<-3,-1, 0> {
enum { idx = 28 }; };
713 template<>
struct SixthDensePt<-2,-1, 0> {
enum { idx = 29 }; };
714 template<>
struct SixthDensePt<-1,-1, 0> {
enum { idx = 30 }; };
715 template<>
struct SixthDensePt< 0,-1, 0> {
enum { idx = 31 }; };
716 template<>
struct SixthDensePt< 1,-1, 0> {
enum { idx = 32 }; };
717 template<>
struct SixthDensePt< 2,-1, 0> {
enum { idx = 33 }; };
718 template<>
struct SixthDensePt< 3,-1, 0> {
enum { idx = 34 }; };
721 template<>
struct SixthDensePt<-3,-2, 0> {
enum { idx = 35 }; };
722 template<>
struct SixthDensePt<-2,-2, 0> {
enum { idx = 36 }; };
723 template<>
struct SixthDensePt<-1,-2, 0> {
enum { idx = 37 }; };
724 template<>
struct SixthDensePt< 0,-2, 0> {
enum { idx = 38 }; };
725 template<>
struct SixthDensePt< 1,-2, 0> {
enum { idx = 39 }; };
726 template<>
struct SixthDensePt< 2,-2, 0> {
enum { idx = 40 }; };
727 template<>
struct SixthDensePt< 3,-2, 0> {
enum { idx = 41 }; };
730 template<>
struct SixthDensePt<-3,-3, 0> {
enum { idx = 42 }; };
731 template<>
struct SixthDensePt<-2,-3, 0> {
enum { idx = 43 }; };
732 template<>
struct SixthDensePt<-1,-3, 0> {
enum { idx = 44 }; };
733 template<>
struct SixthDensePt< 0,-3, 0> {
enum { idx = 45 }; };
734 template<>
struct SixthDensePt< 1,-3, 0> {
enum { idx = 46 }; };
735 template<>
struct SixthDensePt< 2,-3, 0> {
enum { idx = 47 }; };
736 template<>
struct SixthDensePt< 3,-3, 0> {
enum { idx = 48 }; };
739 template<>
struct SixthDensePt<-3, 0, 3> {
enum { idx = 49 }; };
740 template<>
struct SixthDensePt<-2, 0, 3> {
enum { idx = 50 }; };
741 template<>
struct SixthDensePt<-1, 0, 3> {
enum { idx = 51 }; };
742 template<>
struct SixthDensePt< 0, 0, 3> {
enum { idx = 52 }; };
743 template<>
struct SixthDensePt< 1, 0, 3> {
enum { idx = 53 }; };
744 template<>
struct SixthDensePt< 2, 0, 3> {
enum { idx = 54 }; };
745 template<>
struct SixthDensePt< 3, 0, 3> {
enum { idx = 55 }; };
748 template<>
struct SixthDensePt<-3, 0, 2> {
enum { idx = 56 }; };
749 template<>
struct SixthDensePt<-2, 0, 2> {
enum { idx = 57 }; };
750 template<>
struct SixthDensePt<-1, 0, 2> {
enum { idx = 58 }; };
751 template<>
struct SixthDensePt< 0, 0, 2> {
enum { idx = 59 }; };
752 template<>
struct SixthDensePt< 1, 0, 2> {
enum { idx = 60 }; };
753 template<>
struct SixthDensePt< 2, 0, 2> {
enum { idx = 61 }; };
754 template<>
struct SixthDensePt< 3, 0, 2> {
enum { idx = 62 }; };
756 template<>
struct SixthDensePt<-3, 0, 1> {
enum { idx = 63 }; };
757 template<>
struct SixthDensePt<-2, 0, 1> {
enum { idx = 64 }; };
758 template<>
struct SixthDensePt<-1, 0, 1> {
enum { idx = 65 }; };
759 template<>
struct SixthDensePt< 0, 0, 1> {
enum { idx = 66 }; };
760 template<>
struct SixthDensePt< 1, 0, 1> {
enum { idx = 67 }; };
761 template<>
struct SixthDensePt< 2, 0, 1> {
enum { idx = 68 }; };
762 template<>
struct SixthDensePt< 3, 0, 1> {
enum { idx = 69 }; };
765 template<>
struct SixthDensePt<-3, 0,-1> {
enum { idx = 70 }; };
766 template<>
struct SixthDensePt<-2, 0,-1> {
enum { idx = 71 }; };
767 template<>
struct SixthDensePt<-1, 0,-1> {
enum { idx = 72 }; };
768 template<>
struct SixthDensePt< 0, 0,-1> {
enum { idx = 73 }; };
769 template<>
struct SixthDensePt< 1, 0,-1> {
enum { idx = 74 }; };
770 template<>
struct SixthDensePt< 2, 0,-1> {
enum { idx = 75 }; };
771 template<>
struct SixthDensePt< 3, 0,-1> {
enum { idx = 76 }; };
774 template<>
struct SixthDensePt<-3, 0,-2> {
enum { idx = 77 }; };
775 template<>
struct SixthDensePt<-2, 0,-2> {
enum { idx = 78 }; };
776 template<>
struct SixthDensePt<-1, 0,-2> {
enum { idx = 79 }; };
777 template<>
struct SixthDensePt< 0, 0,-2> {
enum { idx = 80 }; };
778 template<>
struct SixthDensePt< 1, 0,-2> {
enum { idx = 81 }; };
779 template<>
struct SixthDensePt< 2, 0,-2> {
enum { idx = 82 }; };
780 template<>
struct SixthDensePt< 3, 0,-2> {
enum { idx = 83 }; };
783 template<>
struct SixthDensePt<-3, 0,-3> {
enum { idx = 84 }; };
784 template<>
struct SixthDensePt<-2, 0,-3> {
enum { idx = 85 }; };
785 template<>
struct SixthDensePt<-1, 0,-3> {
enum { idx = 86 }; };
786 template<>
struct SixthDensePt< 0, 0,-3> {
enum { idx = 87 }; };
787 template<>
struct SixthDensePt< 1, 0,-3> {
enum { idx = 88 }; };
788 template<>
struct SixthDensePt< 2, 0,-3> {
enum { idx = 89 }; };
789 template<>
struct SixthDensePt< 3, 0,-3> {
enum { idx = 90 }; };
792 template<>
struct SixthDensePt< 0,-3, 3> {
enum { idx = 91 }; };
793 template<>
struct SixthDensePt< 0,-2, 3> {
enum { idx = 92 }; };
794 template<>
struct SixthDensePt< 0,-1, 3> {
enum { idx = 93 }; };
795 template<>
struct SixthDensePt< 0, 1, 3> {
enum { idx = 94 }; };
796 template<>
struct SixthDensePt< 0, 2, 3> {
enum { idx = 95 }; };
797 template<>
struct SixthDensePt< 0, 3, 3> {
enum { idx = 96 }; };
799 template<>
struct SixthDensePt< 0,-3, 2> {
enum { idx = 97 }; };
800 template<>
struct SixthDensePt< 0,-2, 2> {
enum { idx = 98 }; };
801 template<>
struct SixthDensePt< 0,-1, 2> {
enum { idx = 99 }; };
802 template<>
struct SixthDensePt< 0, 1, 2> {
enum { idx = 100 }; };
803 template<>
struct SixthDensePt< 0, 2, 2> {
enum { idx = 101 }; };
804 template<>
struct SixthDensePt< 0, 3, 2> {
enum { idx = 102 }; };
806 template<>
struct SixthDensePt< 0,-3, 1> {
enum { idx = 103 }; };
807 template<>
struct SixthDensePt< 0,-2, 1> {
enum { idx = 104 }; };
808 template<>
struct SixthDensePt< 0,-1, 1> {
enum { idx = 105 }; };
809 template<>
struct SixthDensePt< 0, 1, 1> {
enum { idx = 106 }; };
810 template<>
struct SixthDensePt< 0, 2, 1> {
enum { idx = 107 }; };
811 template<>
struct SixthDensePt< 0, 3, 1> {
enum { idx = 108 }; };
813 template<>
struct SixthDensePt< 0,-3,-1> {
enum { idx = 109 }; };
814 template<>
struct SixthDensePt< 0,-2,-1> {
enum { idx = 110 }; };
815 template<>
struct SixthDensePt< 0,-1,-1> {
enum { idx = 111 }; };
816 template<>
struct SixthDensePt< 0, 1,-1> {
enum { idx = 112 }; };
817 template<>
struct SixthDensePt< 0, 2,-1> {
enum { idx = 113 }; };
818 template<>
struct SixthDensePt< 0, 3,-1> {
enum { idx = 114 }; };
820 template<>
struct SixthDensePt< 0,-3,-2> {
enum { idx = 115 }; };
821 template<>
struct SixthDensePt< 0,-2,-2> {
enum { idx = 116 }; };
822 template<>
struct SixthDensePt< 0,-1,-2> {
enum { idx = 117 }; };
823 template<>
struct SixthDensePt< 0, 1,-2> {
enum { idx = 118 }; };
824 template<>
struct SixthDensePt< 0, 2,-2> {
enum { idx = 119 }; };
825 template<>
struct SixthDensePt< 0, 3,-2> {
enum { idx = 120 }; };
827 template<>
struct SixthDensePt< 0,-3,-3> {
enum { idx = 121 }; };
828 template<>
struct SixthDensePt< 0,-2,-3> {
enum { idx = 122 }; };
829 template<>
struct SixthDensePt< 0,-1,-3> {
enum { idx = 123 }; };
830 template<>
struct SixthDensePt< 0, 1,-3> {
enum { idx = 124 }; };
831 template<>
struct SixthDensePt< 0, 2,-3> {
enum { idx = 125 }; };
832 template<>
struct SixthDensePt< 0, 3,-3> {
enum { idx = 126 }; };
837 template<
typename Gr
idType>
846 static const int SIZE = 127;
851 template<
int i,
int j,
int k>
852 unsigned int pos()
const {
return SixthDensePt<i,j,k>::idx; }
855 inline void init(
const Coord& ijk)
857 mStencil[SixthDensePt< 0, 0, 0>::idx] = mCache.getValue(ijk);
859 mStencil[SixthDensePt<-3, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 3, 0));
860 mStencil[SixthDensePt<-2, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 3, 0));
861 mStencil[SixthDensePt<-1, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 3, 0));
862 mStencil[SixthDensePt< 0, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 0));
863 mStencil[SixthDensePt< 1, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 3, 0));
864 mStencil[SixthDensePt< 2, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 3, 0));
865 mStencil[SixthDensePt< 3, 3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 3, 0));
867 mStencil[SixthDensePt<-3, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 2, 0));
868 mStencil[SixthDensePt<-2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 2, 0));
869 mStencil[SixthDensePt<-1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 2, 0));
870 mStencil[SixthDensePt< 0, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
871 mStencil[SixthDensePt< 1, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 2, 0));
872 mStencil[SixthDensePt< 2, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 2, 0));
873 mStencil[SixthDensePt< 3, 2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 2, 0));
875 mStencil[SixthDensePt<-3, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 1, 0));
876 mStencil[SixthDensePt<-2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 1, 0));
877 mStencil[SixthDensePt<-1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
878 mStencil[SixthDensePt< 0, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
879 mStencil[SixthDensePt< 1, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
880 mStencil[SixthDensePt< 2, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 1, 0));
881 mStencil[SixthDensePt< 3, 1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 1, 0));
883 mStencil[SixthDensePt<-3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 0));
884 mStencil[SixthDensePt<-2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
885 mStencil[SixthDensePt<-1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
886 mStencil[SixthDensePt< 1, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
887 mStencil[SixthDensePt< 2, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
888 mStencil[SixthDensePt< 3, 0, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 0));
890 mStencil[SixthDensePt<-3,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3,-1, 0));
891 mStencil[SixthDensePt<-2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-1, 0));
892 mStencil[SixthDensePt<-1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-1, 0));
893 mStencil[SixthDensePt< 0,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 0));
894 mStencil[SixthDensePt< 1,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-1, 0));
895 mStencil[SixthDensePt< 2,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-1, 0));
896 mStencil[SixthDensePt< 3,-1, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3,-1, 0));
898 mStencil[SixthDensePt<-3,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3,-2, 0));
899 mStencil[SixthDensePt<-2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-2, 0));
900 mStencil[SixthDensePt<-1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-2, 0));
901 mStencil[SixthDensePt< 0,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 0));
902 mStencil[SixthDensePt< 1,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-2, 0));
903 mStencil[SixthDensePt< 2,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-2, 0));
904 mStencil[SixthDensePt< 3,-2, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3,-2, 0));
906 mStencil[SixthDensePt<-3,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-3,-3, 0));
907 mStencil[SixthDensePt<-2,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-2,-3, 0));
908 mStencil[SixthDensePt<-1,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy(-1,-3, 0));
909 mStencil[SixthDensePt< 0,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 0));
910 mStencil[SixthDensePt< 1,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 1,-3, 0));
911 mStencil[SixthDensePt< 2,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 2,-3, 0));
912 mStencil[SixthDensePt< 3,-3, 0>::idx] = mCache.getValue(ijk.
offsetBy( 3,-3, 0));
914 mStencil[SixthDensePt<-3, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 3));
915 mStencil[SixthDensePt<-2, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 3));
916 mStencil[SixthDensePt<-1, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 3));
917 mStencil[SixthDensePt< 0, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 3));
918 mStencil[SixthDensePt< 1, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 3));
919 mStencil[SixthDensePt< 2, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 3));
920 mStencil[SixthDensePt< 3, 0, 3>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 3));
922 mStencil[SixthDensePt<-3, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 2));
923 mStencil[SixthDensePt<-2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 2));
924 mStencil[SixthDensePt<-1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 2));
925 mStencil[SixthDensePt< 0, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
926 mStencil[SixthDensePt< 1, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 2));
927 mStencil[SixthDensePt< 2, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 2));
928 mStencil[SixthDensePt< 3, 0, 2>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 2));
930 mStencil[SixthDensePt<-3, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0, 1));
931 mStencil[SixthDensePt<-2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0, 1));
932 mStencil[SixthDensePt<-1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
933 mStencil[SixthDensePt< 0, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
934 mStencil[SixthDensePt< 1, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
935 mStencil[SixthDensePt< 2, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0, 1));
936 mStencil[SixthDensePt< 3, 0, 1>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0, 1));
938 mStencil[SixthDensePt<-3, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0,-1));
939 mStencil[SixthDensePt<-2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-1));
940 mStencil[SixthDensePt<-1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-1));
941 mStencil[SixthDensePt< 0, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-1));
942 mStencil[SixthDensePt< 1, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-1));
943 mStencil[SixthDensePt< 2, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-1));
944 mStencil[SixthDensePt< 3, 0,-1>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0,-1));
946 mStencil[SixthDensePt<-3, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0,-2));
947 mStencil[SixthDensePt<-2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-2));
948 mStencil[SixthDensePt<-1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-2));
949 mStencil[SixthDensePt< 0, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-2));
950 mStencil[SixthDensePt< 1, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-2));
951 mStencil[SixthDensePt< 2, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-2));
952 mStencil[SixthDensePt< 3, 0,-2>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0,-2));
954 mStencil[SixthDensePt<-3, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy(-3, 0,-3));
955 mStencil[SixthDensePt<-2, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy(-2, 0,-3));
956 mStencil[SixthDensePt<-1, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy(-1, 0,-3));
957 mStencil[SixthDensePt< 0, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 0,-3));
958 mStencil[SixthDensePt< 1, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 1, 0,-3));
959 mStencil[SixthDensePt< 2, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 2, 0,-3));
960 mStencil[SixthDensePt< 3, 0,-3>::idx] = mCache.getValue(ijk.
offsetBy( 3, 0,-3));
962 mStencil[SixthDensePt< 0,-3, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 3));
963 mStencil[SixthDensePt< 0,-2, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 3));
964 mStencil[SixthDensePt< 0,-1, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 3));
965 mStencil[SixthDensePt< 0, 1, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 3));
966 mStencil[SixthDensePt< 0, 2, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 3));
967 mStencil[SixthDensePt< 0, 3, 3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 3));
969 mStencil[SixthDensePt< 0,-3, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 2));
970 mStencil[SixthDensePt< 0,-2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 2));
971 mStencil[SixthDensePt< 0,-1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 2));
972 mStencil[SixthDensePt< 0, 1, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 2));
973 mStencil[SixthDensePt< 0, 2, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 2));
974 mStencil[SixthDensePt< 0, 3, 2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 2));
976 mStencil[SixthDensePt< 0,-3, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3, 1));
977 mStencil[SixthDensePt< 0,-2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2, 1));
978 mStencil[SixthDensePt< 0,-1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1, 1));
979 mStencil[SixthDensePt< 0, 1, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
980 mStencil[SixthDensePt< 0, 2, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2, 1));
981 mStencil[SixthDensePt< 0, 3, 1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3, 1));
983 mStencil[SixthDensePt< 0,-3,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3,-1));
984 mStencil[SixthDensePt< 0,-2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-1));
985 mStencil[SixthDensePt< 0,-1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-1));
986 mStencil[SixthDensePt< 0, 1,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-1));
987 mStencil[SixthDensePt< 0, 2,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-1));
988 mStencil[SixthDensePt< 0, 3,-1>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3,-1));
990 mStencil[SixthDensePt< 0,-3,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3,-2));
991 mStencil[SixthDensePt< 0,-2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-2));
992 mStencil[SixthDensePt< 0,-1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-2));
993 mStencil[SixthDensePt< 0, 1,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-2));
994 mStencil[SixthDensePt< 0, 2,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-2));
995 mStencil[SixthDensePt< 0, 3,-2>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3,-2));
997 mStencil[SixthDensePt< 0,-3,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-3,-3));
998 mStencil[SixthDensePt< 0,-2,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-2,-3));
999 mStencil[SixthDensePt< 0,-1,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0,-1,-3));
1000 mStencil[SixthDensePt< 0, 1,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 1,-3));
1001 mStencil[SixthDensePt< 0, 2,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 2,-3));
1002 mStencil[SixthDensePt< 0, 3,-3>::idx] = mCache.getValue(ijk.
offsetBy( 0, 3,-3));
1006 using BaseType::mCache;
1007 using BaseType::mStencil;
1020 template<
typename Gr
idType>
1029 static const int SIZE = 7;
1033 mInv2Dx(
ValueType(0.5 / grid.voxelSize()[0])),
1034 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1041 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1053 mStencil[0] - mStencil[1],
1054 mStencil[2] - mStencil[0],
1055 mStencil[0] - mStencil[3],
1056 mStencil[4] - mStencil[0],
1057 mStencil[0] - mStencil[5],
1058 mStencil[6] - mStencil[0]);
1068 return Vec3Type(mStencil[2] - mStencil[1],
1069 mStencil[4] - mStencil[3],
1070 mStencil[6] - mStencil[5])*mInv2Dx;
1078 return Vec3Type(V[0]>0 ? mStencil[0] - mStencil[1] : mStencil[2] - mStencil[0],
1079 V[1]>0 ? mStencil[0] - mStencil[3] : mStencil[4] - mStencil[0],
1080 V[2]>0 ? mStencil[0] - mStencil[5] : mStencil[6] - mStencil[0])*2*mInv2Dx;
1087 return mInvDx2 * (mStencil[1] + mStencil[2] +
1088 mStencil[3] + mStencil[4] +
1089 mStencil[5] + mStencil[6] - 6*mStencil[0]);
1094 inline bool zeroCrossing()
const
1097 return (v[0]>0 ? (v[1]<0 || v[2]<0 || v[3]<0 || v[4]<0 || v[5]<0 || v[6]<0)
1098 : (v[1]>0 || v[2]>0 || v[3]>0 || v[4]>0 || v[5]>0 || v[6]>0));
1110 const Coord& ijk = BaseType::getCenterCoord();
1112 return Vec3Type(ijk[0] - d*(mStencil[2] - mStencil[1]),
1113 ijk[1] - d*(mStencil[4] - mStencil[3]),
1114 ijk[2] - d*(mStencil[6] - mStencil[5]));
1118 inline void init(
const Coord& ijk)
1120 mStencil[1] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
1121 mStencil[2] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
1123 mStencil[3] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
1124 mStencil[4] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
1126 mStencil[5] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
1127 mStencil[6] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
1131 using BaseType::mCache;
1132 using BaseType::mStencil;
1145 template<
typename Gr
idType>
1154 static const int SIZE = 19;
1159 mInv2Dx(
ValueType(0.5 / grid.voxelSize()[0])),
1183 v1(v[2]-v[1], v[ 8]-v[ 7], v[14]-v[13], 0),
1184 v2(v[3]-v[2], v[ 9]-v[ 8], v[15]-v[14], 0),
1185 v3(v[0]-v[3], v[ 0]-v[ 9], v[ 0]-v[15], 0),
1186 v4(v[4]-v[0], v[10]-v[ 0], v[16]-v[ 0], 0),
1187 v5(v[5]-v[4], v[11]-v[10], v[17]-v[16], 0),
1188 v6(v[6]-v[5], v[12]-v[11], v[18]-v[17], 0),
1195 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),
1196 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),
1197 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),
1198 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),
1199 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),
1200 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);
1214 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)
1215 :
math::WENO5(v[ 6]-v[ 5],v[ 5]-v[ 4],v[ 4]-v[ 0], v[ 0]-v[ 3],v[ 3]-v[ 2],mDx2),
1216 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)
1217 :
math::WENO5(v[12]-v[11],v[11]-v[10],v[10]-v[ 0], v[ 0]-v[ 9],v[ 9]-v[ 8],mDx2),
1218 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)
1219 :
math::WENO5(v[18]-v[17],v[17]-v[16],v[16]-v[ 0], v[ 0]-v[15],v[15]-v[14],mDx2));
1229 mStencil[ 4] - mStencil[ 3],
1230 mStencil[10] - mStencil[ 9],
1231 mStencil[16] - mStencil[15]);
1242 mStencil[ 3] + mStencil[ 4] +
1243 mStencil[ 9] + mStencil[10] +
1244 mStencil[15] + mStencil[16] - 6*mStencil[0]);
1249 inline bool zeroCrossing()
const
1252 return (v[ 0]>0 ? (v[ 3]<0 || v[ 4]<0 || v[ 9]<0 || v[10]<0 || v[15]<0 || v[16]<0)
1253 : (v[ 3]>0 || v[ 4]>0 || v[ 9]>0 || v[10]>0 || v[15]>0 || v[16]>0));
1257 inline void init(
const Coord& ijk)
1259 mStencil[ 1] = mCache.getValue(ijk.
offsetBy(-3, 0, 0));
1260 mStencil[ 2] = mCache.getValue(ijk.
offsetBy(-2, 0, 0));
1261 mStencil[ 3] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
1262 mStencil[ 4] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
1263 mStencil[ 5] = mCache.getValue(ijk.
offsetBy( 2, 0, 0));
1264 mStencil[ 6] = mCache.getValue(ijk.
offsetBy( 3, 0, 0));
1266 mStencil[ 7] = mCache.getValue(ijk.
offsetBy( 0, -3, 0));
1267 mStencil[ 8] = mCache.getValue(ijk.
offsetBy( 0, -2, 0));
1268 mStencil[ 9] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
1269 mStencil[10] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
1270 mStencil[11] = mCache.getValue(ijk.
offsetBy( 0, 2, 0));
1271 mStencil[12] = mCache.getValue(ijk.
offsetBy( 0, 3, 0));
1273 mStencil[13] = mCache.getValue(ijk.
offsetBy( 0, 0, -3));
1274 mStencil[14] = mCache.getValue(ijk.
offsetBy( 0, 0, -2));
1275 mStencil[15] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
1276 mStencil[16] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
1277 mStencil[17] = mCache.getValue(ijk.
offsetBy( 0, 0, 2));
1278 mStencil[18] = mCache.getValue(ijk.
offsetBy( 0, 0, 3));
1282 using BaseType::mCache;
1283 using BaseType::mStencil;
1291 template<
typename Gr
idType>
1298 static const int SIZE = 19;
1302 mInv2Dx(
ValueType(0.5 / grid.voxelSize()[0])),
1303 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1310 mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
1346 mStencil[1] + mStencil[2] +
1347 mStencil[3] + mStencil[4] +
1348 mStencil[5] + mStencil[6] - 6*mStencil[0]);
1359 mStencil[2] - mStencil[1],
1360 mStencil[4] - mStencil[3],
1361 mStencil[6] - mStencil[5])*mInv2Dx;
1365 inline void init(
const Coord &ijk)
1367 mStencil[ 1] = mCache.getValue(ijk.
offsetBy(-1, 0, 0));
1368 mStencil[ 2] = mCache.getValue(ijk.
offsetBy( 1, 0, 0));
1370 mStencil[ 3] = mCache.getValue(ijk.
offsetBy( 0, -1, 0));
1371 mStencil[ 4] = mCache.getValue(ijk.
offsetBy( 0, 1, 0));
1373 mStencil[ 5] = mCache.getValue(ijk.
offsetBy( 0, 0, -1));
1374 mStencil[ 6] = mCache.getValue(ijk.
offsetBy( 0, 0, 1));
1376 mStencil[ 7] = mCache.getValue(ijk.
offsetBy(-1, -1, 0));
1377 mStencil[ 8] = mCache.getValue(ijk.
offsetBy( 1, -1, 0));
1378 mStencil[ 9] = mCache.getValue(ijk.
offsetBy(-1, 1, 0));
1379 mStencil[10] = mCache.getValue(ijk.
offsetBy( 1, 1, 0));
1381 mStencil[11] = mCache.getValue(ijk.
offsetBy(-1, 0, -1));
1382 mStencil[12] = mCache.getValue(ijk.
offsetBy( 1, 0, -1));
1383 mStencil[13] = mCache.getValue(ijk.
offsetBy(-1, 0, 1));
1384 mStencil[14] = mCache.getValue(ijk.
offsetBy( 1, 0, 1));
1386 mStencil[15] = mCache.getValue(ijk.
offsetBy( 0, -1, -1));
1387 mStencil[16] = mCache.getValue(ijk.
offsetBy( 0, 1, -1));
1388 mStencil[17] = mCache.getValue(ijk.
offsetBy( 0, -1, 1));
1389 mStencil[18] = mCache.getValue(ijk.
offsetBy( 0, 1, 1));
1396 Half(0.5), Quarter(0.25),
1397 Dx = Half * (mStencil[2] - mStencil[1]), Dx2 = Dx * Dx,
1398 Dy = Half * (mStencil[4] - mStencil[3]), Dy2 = Dy * Dy,
1399 Dz = Half * (mStencil[6] - mStencil[5]), Dz2 = Dz * Dz,
1400 Dxx = mStencil[2] - 2 * mStencil[0] + mStencil[1],
1401 Dyy = mStencil[4] - 2 * mStencil[0] + mStencil[3],
1402 Dzz = mStencil[6] - 2 * mStencil[0] + mStencil[5],
1403 Dxy = Quarter * (mStencil[10] - mStencil[ 8] + mStencil[7] - mStencil[ 9]),
1404 Dxz = Quarter * (mStencil[14] - mStencil[12] + mStencil[11] - mStencil[13]),
1405 Dyz = Quarter * (mStencil[18] - mStencil[16] + mStencil[15] - mStencil[17]);
1406 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
1407 beta = std::sqrt(Dx2 + Dy2 + Dz2);
1411 using BaseType::mCache;
1412 using BaseType::mStencil;
1421 template<
typename Gr
idType>
1430 mHalfWidth(halfWidth)
1437 inline void init(
const Coord& ijk)
1439 for (
int n=0, i=ijk[0]-mHalfWidth, ie = ijk[0]+mHalfWidth; i <= ie; ++i) {
1440 Coord sample_ijk(i,0,0);
1441 for (
int j = ijk[1]-mHalfWidth, je = ijk[1]+mHalfWidth; j <= je; ++j) {
1443 for (
int k = ijk[2]-mHalfWidth, ke = ijk[2] + mHalfWidth; k <= ke; ++k) {
1445 mStencil[n++] = mCache.getValue(sample_ijk);
1452 using BaseType::mCache;
1453 using BaseType::mStencil;
1454 const int mHalfWidth;
1462 #endif // OPENVDB_MATH_STENCILS_HAS_BEEN_INCLUDED