33 #ifndef OPENVDB_MATH_FINITEDIFFERENCE_HAS_BEEN_INCLUDED
34 #define OPENVDB_MATH_FINITEDIFFERENCE_HAS_BEEN_INCLUDED
36 #include <openvdb/Types.h>
41 #include <boost/algorithm/string/case_conv.hpp>
42 #include <boost/algorithm/string/trim.hpp>
45 #include <simd/Simd.h>
86 case CD_2NDT: ret =
"cd_2ndt";
break;
87 case CD_2ND: ret =
"cd_2nd";
break;
88 case CD_4TH: ret =
"cd_4th";
break;
89 case CD_6TH: ret =
"cd_6th";
break;
90 case FD_1ST: ret =
"fd_1st";
break;
91 case FD_2ND: ret =
"fd_2nd";
break;
92 case FD_3RD: ret =
"fd_3rd";
break;
93 case BD_1ST: ret =
"bd_1st";
break;
94 case BD_2ND: ret =
"bd_2nd";
break;
95 case BD_3RD: ret =
"bd_3rd";
break;
96 case FD_WENO5: ret =
"fd_weno5";
break;
97 case BD_WENO5: ret =
"bd_weno5";
break;
111 boost::to_lower(str);
151 case UNKNOWN_DS: ret =
"Unknown DS scheme";
break;
152 case CD_2NDT: ret =
"Twice 2nd-order center difference";
break;
153 case CD_2ND: ret =
"2nd-order center difference";
break;
154 case CD_4TH: ret =
"4th-order center difference";
break;
155 case CD_6TH: ret =
"6th-order center difference";
break;
156 case FD_1ST: ret =
"1st-order forward difference";
break;
157 case FD_2ND: ret =
"2nd-order forward difference";
break;
158 case FD_3RD: ret =
"3rd-order forward difference";
break;
159 case BD_1ST: ret =
"1st-order backward difference";
break;
160 case BD_2ND: ret =
"2nd-order backward difference";
break;
161 case BD_3RD: ret =
"3rd-order backward difference";
break;
162 case FD_WENO5: ret =
"5th-order WENO forward difference";
break;
163 case BD_WENO5: ret =
"5th-order WENO backward difference";
break;
164 case FD_HJWENO5: ret =
"5th-order HJ-WENO forward difference";
break;
165 case BD_HJWENO5: ret =
"5th-order HJ-WENO backward difference";
break;
225 boost::to_lower(str);
246 case UNKNOWN_BIAS: ret =
"Unknown biased gradient";
break;
247 case FIRST_BIAS: ret =
"1st-order biased gradient";
break;
248 case SECOND_BIAS: ret =
"2nd-order biased gradient";
break;
249 case THIRD_BIAS: ret =
"3rd-order biased gradient";
break;
250 case WENO5_BIAS: ret =
"5th-order WENO biased gradient";
break;
251 case HJWENO5_BIAS: ret =
"5th-order HJ-WENO biased gradient";
break;
276 case TVD_RK1: ret =
"tvd_rk1";
break;
277 case TVD_RK2: ret =
"tvd_rk2";
break;
278 case TVD_RK3: ret =
"tvd_rk3";
break;
290 boost::to_lower(str);
308 case UNKNOWN_TIS: ret =
"Unknown temporal integration";
break;
309 case TVD_RK1: ret =
"Forward Euler";
break;
310 case TVD_RK2: ret =
"2nd-order Runge-Kutta";
break;
311 case TVD_RK3: ret =
"3rd-order Runge-Kutta";
break;
329 template<
typename ValueType>
331 WENO5(
const ValueType& v1,
const ValueType& v2,
const ValueType& v3,
332 const ValueType& v4,
const ValueType& v5,
float scale2 = 0.01)
334 static const double C=13.0/12.0;
339 const double eps=1e-6*scale2;
345 return ValueType(A1*(2.0*v1 - 7.0*v2 + 11.0*v3) +
346 A2*(5.0*v3 - v2 + 2.0*v4) +
347 A3*(2.0*v3 + 5.0*v4 - v5))/(6.0*(A1+A2+A3));
351 template <
typename Real>
376 template<
typename Real>
380 return GudonovsNormSqrd<Real>(isOutside,
381 gradient_m[0], gradient_p[0],
382 gradient_m[1], gradient_p[1],
383 gradient_m[2], gradient_p[2]);
388 inline simd::Float4 simdMin(
const simd::Float4& a,
const simd::Float4& b) {
389 return simd::Float4(_mm_min_ps(a.base(), b.base()));
391 inline simd::Float4 simdMax(
const simd::Float4& a,
const simd::Float4& b) {
392 return simd::Float4(_mm_max_ps(a.base(), b.base()));
395 inline float simdSum(
const simd::Float4& v);
397 inline simd::Float4
Pow2(
const simd::Float4& v) {
return v * v; }
401 WENO5<simd::Float4>(
const simd::Float4& v1,
const simd::Float4& v2,
const simd::Float4& v3,
402 const simd::Float4& v4,
const simd::Float4& v5,
float scale2)
405 typedef simd::Float4 F4;
409 two(2.0), three(3.0), four(4.0), five(5.0), fourth(0.25),
410 A1 = F4(0.1) /
Pow2(C*
Pow2(v1-two*v2+v3) + fourth*
Pow2(v1-four*v2+three*v3) + eps),
411 A2 = F4(0.6) /
Pow2(C*
Pow2(v2-two*v3+v4) + fourth*
Pow2(v2-v4) + eps),
412 A3 = F4(0.3) /
Pow2(C*
Pow2(v3-two*v4+v5) + fourth*
Pow2(three*v3-four*v4+v5) + eps);
413 return (A1 * (two * v1 - F4(7.0) * v2 + F4(11.0) * v3) +
414 A2 * (five * v3 - v2 + two * v4) +
415 A3 * (two * v3 + five * v4 - v5)) / (F4(6.0) * (A1 + A2 + A3));
420 simdSum(
const simd::Float4& v)
423 __m128 temp = _mm_add_ps(v.base(), _mm_movehl_ps(v.base(), v.base()));
425 temp = _mm_add_ss(temp, _mm_shuffle_ps(temp, temp, 1));
426 return _mm_cvtss_f32(temp);
430 GudonovsNormSqrd(
bool isOutside,
const simd::Float4& dP_m,
const simd::Float4& dP_p)
432 const simd::Float4 zero(0.0);
433 simd::Float4 v = isOutside
435 : simdMax(math::
Pow2(simdMin(dP_m, zero)), math::
Pow2(simdMax(dP_p, zero)));
440 template<DScheme DiffScheme>
444 template<
typename Accessor>
445 static typename Accessor::ValueType inX(
const Accessor& grid,
const Coord& ijk);
447 template<
typename Accessor>
448 static typename Accessor::ValueType inY(
const Accessor& grid,
const Coord& ijk);
450 template<
typename Accessor>
451 static typename Accessor::ValueType inZ(
const Accessor& grid,
const Coord& ijk);
454 template<
typename Stencil>
455 static typename Stencil::ValueType inX(
const Stencil& S);
457 template<
typename Stencil>
458 static typename Stencil::ValueType inY(
const Stencil& S);
460 template<
typename Stencil>
461 static typename Stencil::ValueType inZ(
const Stencil& S);
468 template <
typename ValueType>
469 static ValueType
difference(
const ValueType& xp1,
const ValueType& xm1) {
474 template<
typename Accessor>
475 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
478 grid.getValue(ijk.
offsetBy(1, 0, 0)),
479 grid.getValue(ijk.
offsetBy(-1, 0, 0)));
482 template<
typename Accessor>
483 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
486 grid.getValue(ijk.
offsetBy(0, 1, 0)),
487 grid.getValue(ijk.
offsetBy( 0, -1, 0)));
490 template<
typename Accessor>
491 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
494 grid.getValue(ijk.
offsetBy(0, 0, 1)),
495 grid.getValue(ijk.
offsetBy( 0, 0, -1)));
499 template<
typename Stencil>
500 static typename Stencil::ValueType
inX(
const Stencil& S)
502 return difference( S.template getValue< 1, 0, 0>(), S.template getValue<-1, 0, 0>());
505 template<
typename Stencil>
506 static typename Stencil::ValueType
inY(
const Stencil& S)
508 return difference( S.template getValue< 0, 1, 0>(), S.template getValue< 0,-1, 0>());
511 template<
typename Stencil>
512 static typename Stencil::ValueType
inZ(
const Stencil& S)
514 return difference( S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0,-1>());
523 template <
typename ValueType>
524 static ValueType
difference(
const ValueType& xp1,
const ValueType& xm1) {
525 return (xp1 - xm1)*ValueType(0.5);
530 template<
typename Accessor>
531 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
534 grid.getValue(ijk.
offsetBy(1, 0, 0)),
535 grid.getValue(ijk.
offsetBy(-1, 0, 0)));
538 template<
typename Accessor>
539 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
542 grid.getValue(ijk.
offsetBy(0, 1, 0)),
543 grid.getValue(ijk.
offsetBy( 0, -1, 0)));
546 template<
typename Accessor>
547 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
550 grid.getValue(ijk.
offsetBy(0, 0, 1)),
551 grid.getValue(ijk.
offsetBy( 0, 0, -1)));
556 template<
typename Stencil>
557 static typename Stencil::ValueType
inX(
const Stencil& S)
559 return difference(S.template getValue< 1, 0, 0>(), S.template getValue<-1, 0, 0>());
561 template<
typename Stencil>
562 static typename Stencil::ValueType
inY(
const Stencil& S)
564 return difference(S.template getValue< 0, 1, 0>(), S.template getValue< 0,-1, 0>());
567 template<
typename Stencil>
568 static typename Stencil::ValueType
inZ(
const Stencil& S)
570 return difference(S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0,-1>());
580 template <
typename ValueType>
581 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
582 const ValueType& xm1,
const ValueType& xm2 ) {
583 return ValueType(2./3.)*(xp1 - xm1) + ValueType(1./12.)*(xm2 - xp2) ;
588 template<
typename Accessor>
589 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
596 template<
typename Accessor>
597 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
601 grid.getValue(ijk.
offsetBy( 0, 2, 0)), grid.getValue(ijk.
offsetBy( 0, 1, 0)),
602 grid.getValue(ijk.
offsetBy( 0,-1, 0)), grid.getValue(ijk.
offsetBy( 0,-2, 0)) );
605 template<
typename Accessor>
606 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
610 grid.getValue(ijk.
offsetBy( 0, 0, 2)), grid.getValue(ijk.
offsetBy( 0, 0, 1)),
611 grid.getValue(ijk.
offsetBy( 0, 0,-1)), grid.getValue(ijk.
offsetBy( 0, 0,-2)) );
616 template<
typename Stencil>
617 static typename Stencil::ValueType
inX(
const Stencil& S)
619 return difference( S.template getValue< 2, 0, 0>(),
620 S.template getValue< 1, 0, 0>(),
621 S.template getValue<-1, 0, 0>(),
622 S.template getValue<-2, 0, 0>() );
625 template<
typename Stencil>
626 static typename Stencil::ValueType
inY(
const Stencil& S)
628 return difference( S.template getValue< 0, 2, 0>(),
629 S.template getValue< 0, 1, 0>(),
630 S.template getValue< 0,-1, 0>(),
631 S.template getValue< 0,-2, 0>() );
634 template<
typename Stencil>
635 static typename Stencil::ValueType
inZ(
const Stencil& S)
637 return difference( S.template getValue< 0, 0, 2>(),
638 S.template getValue< 0, 0, 1>(),
639 S.template getValue< 0, 0,-1>(),
640 S.template getValue< 0, 0,-2>() );
649 template <
typename ValueType>
650 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
const ValueType& xp1,
651 const ValueType& xm1,
const ValueType& xm2,
const ValueType& xm3 )
653 return ValueType(3./4.)*(xp1 - xm1) - ValueType(0.15)*(xp2 - xm2)
654 + ValueType(1./60.)*(xp3-xm3);
659 template<
typename Accessor>
660 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
668 template<
typename Accessor>
669 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
672 grid.getValue(ijk.
offsetBy( 0, 3, 0)), grid.getValue(ijk.
offsetBy( 0, 2, 0)),
673 grid.getValue(ijk.
offsetBy( 0, 1, 0)), grid.getValue(ijk.
offsetBy( 0,-1, 0)),
674 grid.getValue(ijk.
offsetBy( 0,-2, 0)), grid.getValue(ijk.
offsetBy( 0,-3, 0)));
677 template<
typename Accessor>
678 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
681 grid.getValue(ijk.
offsetBy( 0, 0, 3)), grid.getValue(ijk.
offsetBy( 0, 0, 2)),
682 grid.getValue(ijk.
offsetBy( 0, 0, 1)), grid.getValue(ijk.
offsetBy( 0, 0,-1)),
683 grid.getValue(ijk.
offsetBy( 0, 0,-2)), grid.getValue(ijk.
offsetBy( 0, 0,-3)));
687 template<
typename Stencil>
688 static typename Stencil::ValueType
inX(
const Stencil& S)
690 return difference(S.template getValue< 3, 0, 0>(),
691 S.template getValue< 2, 0, 0>(),
692 S.template getValue< 1, 0, 0>(),
693 S.template getValue<-1, 0, 0>(),
694 S.template getValue<-2, 0, 0>(),
695 S.template getValue<-3, 0, 0>());
698 template<
typename Stencil>
699 static typename Stencil::ValueType
inY(
const Stencil& S)
702 return difference( S.template getValue< 0, 3, 0>(),
703 S.template getValue< 0, 2, 0>(),
704 S.template getValue< 0, 1, 0>(),
705 S.template getValue< 0,-1, 0>(),
706 S.template getValue< 0,-2, 0>(),
707 S.template getValue< 0,-3, 0>());
710 template<
typename Stencil>
711 static typename Stencil::ValueType
inZ(
const Stencil& S)
714 return difference( S.template getValue< 0, 0, 3>(),
715 S.template getValue< 0, 0, 2>(),
716 S.template getValue< 0, 0, 1>(),
717 S.template getValue< 0, 0,-1>(),
718 S.template getValue< 0, 0,-2>(),
719 S.template getValue< 0, 0,-3>());
729 template <
typename ValueType>
730 static ValueType
difference(
const ValueType& xp1,
const ValueType& xp0) {
736 template<
typename Accessor>
737 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
739 return difference(grid.getValue(ijk.
offsetBy(1, 0, 0)), grid.getValue(ijk));
742 template<
typename Accessor>
743 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
745 return difference(grid.getValue(ijk.
offsetBy(0, 1, 0)), grid.getValue(ijk));
748 template<
typename Accessor>
749 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
751 return difference(grid.getValue(ijk.
offsetBy(0, 0, 1)), grid.getValue(ijk));
755 template<
typename Stencil>
756 static typename Stencil::ValueType
inX(
const Stencil& S)
758 return difference(S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>());
761 template<
typename Stencil>
762 static typename Stencil::ValueType
inY(
const Stencil& S)
764 return difference(S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>());
767 template<
typename Stencil>
768 static typename Stencil::ValueType
inZ(
const Stencil& S)
770 return difference(S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>());
779 template <
typename ValueType>
780 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
const ValueType& xp0)
782 return ValueType(2)*xp1 -(ValueType(0.5)*xp2 + ValueType(3./2.)*xp0);
787 template<
typename Accessor>
788 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
796 template<
typename Accessor>
797 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
805 template<
typename Accessor>
806 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
816 template<
typename Stencil>
817 static typename Stencil::ValueType
inX(
const Stencil& S)
819 return difference( S.template getValue< 2, 0, 0>(),
820 S.template getValue< 1, 0, 0>(),
821 S.template getValue< 0, 0, 0>() );
824 template<
typename Stencil>
825 static typename Stencil::ValueType
inY(
const Stencil& S)
827 return difference( S.template getValue< 0, 2, 0>(),
828 S.template getValue< 0, 1, 0>(),
829 S.template getValue< 0, 0, 0>() );
832 template<
typename Stencil>
833 static typename Stencil::ValueType
inZ(
const Stencil& S)
835 return difference( S.template getValue< 0, 0, 2>(),
836 S.template getValue< 0, 0, 1>(),
837 S.template getValue< 0, 0, 0>() );
848 template <
typename ValueType>
849 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
850 const ValueType& xp1,
const ValueType& xp0)
852 return ValueType(1./3.)*xp3 - ValueType(1.5)*xp2
853 + ValueType(3.)*xp1 - ValueType(11./6.)*xp0;
858 template<
typename Accessor>
859 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
861 return difference( grid.getValue(ijk.
offsetBy(3,0,0)),
864 grid.getValue(ijk) );
867 template<
typename Accessor>
868 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
870 return difference( grid.getValue(ijk.
offsetBy(0,3,0)),
873 grid.getValue(ijk) );
876 template<
typename Accessor>
877 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
879 return difference( grid.getValue(ijk.
offsetBy(0,0,3)),
882 grid.getValue(ijk) );
887 template<
typename Stencil>
888 static typename Stencil::ValueType
inX(
const Stencil& S)
890 return difference(S.template getValue< 3, 0, 0>(),
891 S.template getValue< 2, 0, 0>(),
892 S.template getValue< 1, 0, 0>(),
893 S.template getValue< 0, 0, 0>() );
896 template<
typename Stencil>
897 static typename Stencil::ValueType
inY(
const Stencil& S)
899 return difference(S.template getValue< 0, 3, 0>(),
900 S.template getValue< 0, 2, 0>(),
901 S.template getValue< 0, 1, 0>(),
902 S.template getValue< 0, 0, 0>() );
905 template<
typename Stencil>
906 static typename Stencil::ValueType
inZ(
const Stencil& S)
908 return difference( S.template getValue< 0, 0, 3>(),
909 S.template getValue< 0, 0, 2>(),
910 S.template getValue< 0, 0, 1>(),
911 S.template getValue< 0, 0, 0>() );
921 template <
typename ValueType>
922 static ValueType
difference(
const ValueType& xm1,
const ValueType& xm0) {
928 template<
typename Accessor>
929 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
931 return difference(grid.getValue(ijk.
offsetBy(-1,0,0)), grid.getValue(ijk));
934 template<
typename Accessor>
935 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
937 return difference(grid.getValue(ijk.
offsetBy(0,-1,0)), grid.getValue(ijk));
940 template<
typename Accessor>
941 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
943 return difference(grid.getValue(ijk.
offsetBy(0, 0,-1)), grid.getValue(ijk));
948 template<
typename Stencil>
949 static typename Stencil::ValueType
inX(
const Stencil& S)
951 return difference(S.template getValue<-1, 0, 0>(), S.template getValue< 0, 0, 0>());
954 template<
typename Stencil>
955 static typename Stencil::ValueType
inY(
const Stencil& S)
957 return difference(S.template getValue< 0,-1, 0>(), S.template getValue< 0, 0, 0>());
960 template<
typename Stencil>
961 static typename Stencil::ValueType
inZ(
const Stencil& S)
963 return difference(S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0, 0>());
973 template <
typename ValueType>
974 static ValueType
difference(
const ValueType& xm2,
const ValueType& xm1,
const ValueType& xm0)
981 template<
typename Accessor>
982 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
984 return difference( grid.getValue(ijk.
offsetBy(-2,0,0)),
985 grid.getValue(ijk.
offsetBy(-1,0,0)),
986 grid.getValue(ijk) );
989 template<
typename Accessor>
990 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
992 return difference( grid.getValue(ijk.
offsetBy(0,-2,0)),
993 grid.getValue(ijk.
offsetBy(0,-1,0)),
994 grid.getValue(ijk) );
997 template<
typename Accessor>
998 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1000 return difference( grid.getValue(ijk.
offsetBy(0,0,-2)),
1001 grid.getValue(ijk.
offsetBy(0,0,-1)),
1002 grid.getValue(ijk) );
1006 template<
typename Stencil>
1007 static typename Stencil::ValueType
inX(
const Stencil& S)
1009 return difference( S.template getValue<-2, 0, 0>(),
1010 S.template getValue<-1, 0, 0>(),
1011 S.template getValue< 0, 0, 0>() );
1014 template<
typename Stencil>
1015 static typename Stencil::ValueType
inY(
const Stencil& S)
1017 return difference( S.template getValue< 0,-2, 0>(),
1018 S.template getValue< 0,-1, 0>(),
1019 S.template getValue< 0, 0, 0>() );
1022 template<
typename Stencil>
1023 static typename Stencil::ValueType
inZ(
const Stencil& S)
1025 return difference( S.template getValue< 0, 0,-2>(),
1026 S.template getValue< 0, 0,-1>(),
1027 S.template getValue< 0, 0, 0>() );
1037 template <
typename ValueType>
1038 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
1039 const ValueType& xm1,
const ValueType& xm0)
1045 template<
typename Accessor>
1046 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1048 return difference( grid.getValue(ijk.
offsetBy(-3,0,0)),
1049 grid.getValue(ijk.
offsetBy(-2,0,0)),
1050 grid.getValue(ijk.
offsetBy(-1,0,0)),
1051 grid.getValue(ijk) );
1054 template<
typename Accessor>
1055 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1057 return difference( grid.getValue(ijk.
offsetBy( 0,-3,0)),
1058 grid.getValue(ijk.
offsetBy( 0,-2,0)),
1059 grid.getValue(ijk.
offsetBy( 0,-1,0)),
1060 grid.getValue(ijk) );
1063 template<
typename Accessor>
1064 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1066 return difference( grid.getValue(ijk.
offsetBy( 0, 0,-3)),
1067 grid.getValue(ijk.
offsetBy( 0, 0,-2)),
1068 grid.getValue(ijk.
offsetBy( 0, 0,-1)),
1069 grid.getValue(ijk) );
1073 template<
typename Stencil>
1074 static typename Stencil::ValueType
inX(
const Stencil& S)
1076 return difference( S.template getValue<-3, 0, 0>(),
1077 S.template getValue<-2, 0, 0>(),
1078 S.template getValue<-1, 0, 0>(),
1079 S.template getValue< 0, 0, 0>() );
1082 template<
typename Stencil>
1083 static typename Stencil::ValueType
inY(
const Stencil& S)
1085 return difference( S.template getValue< 0,-3, 0>(),
1086 S.template getValue< 0,-2, 0>(),
1087 S.template getValue< 0,-1, 0>(),
1088 S.template getValue< 0, 0, 0>() );
1091 template<
typename Stencil>
1092 static typename Stencil::ValueType
inZ(
const Stencil& S)
1094 return difference( S.template getValue< 0, 0,-3>(),
1095 S.template getValue< 0, 0,-2>(),
1096 S.template getValue< 0, 0,-1>(),
1097 S.template getValue< 0, 0, 0>() );
1106 template <
typename ValueType>
1107 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
1108 const ValueType& xp1,
const ValueType& xp0,
1109 const ValueType& xm1,
const ValueType& xm2) {
1110 return WENO5<ValueType>(xp3, xp2, xp1, xp0, xm1)
1111 - WENO5<ValueType>(xp2, xp1, xp0, xm1, xm2);
1116 template<
typename Accessor>
1117 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1119 typedef typename Accessor::ValueType ValueType;
1121 V[0] = grid.getValue(ijk.
offsetBy(3,0,0));
1122 V[1] = grid.getValue(ijk.
offsetBy(2,0,0));
1123 V[2] = grid.getValue(ijk.
offsetBy(1,0,0));
1124 V[3] = grid.getValue(ijk);
1125 V[4] = grid.getValue(ijk.
offsetBy(-1,0,0));
1126 V[5] = grid.getValue(ijk.
offsetBy(-2,0,0));
1128 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1131 template<
typename Accessor>
1132 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1134 typedef typename Accessor::ValueType ValueType;
1136 V[0] = grid.getValue(ijk.
offsetBy(0,3,0));
1137 V[1] = grid.getValue(ijk.
offsetBy(0,2,0));
1138 V[2] = grid.getValue(ijk.
offsetBy(0,1,0));
1139 V[3] = grid.getValue(ijk);
1140 V[4] = grid.getValue(ijk.
offsetBy(0,-1,0));
1141 V[5] = grid.getValue(ijk.
offsetBy(0,-2,0));
1143 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1146 template<
typename Accessor>
1147 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1149 typedef typename Accessor::ValueType ValueType;
1151 V[0] = grid.getValue(ijk.
offsetBy(0,0,3));
1152 V[1] = grid.getValue(ijk.
offsetBy(0,0,2));
1153 V[2] = grid.getValue(ijk.
offsetBy(0,0,1));
1154 V[3] = grid.getValue(ijk);
1155 V[4] = grid.getValue(ijk.
offsetBy(0,0,-1));
1156 V[5] = grid.getValue(ijk.
offsetBy(0,0,-2));
1158 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1162 template<
typename Stencil>
1163 static typename Stencil::ValueType
inX(
const Stencil& S)
1166 return difference( S.template getValue< 3, 0, 0>(),
1167 S.template getValue< 2, 0, 0>(),
1168 S.template getValue< 1, 0, 0>(),
1169 S.template getValue< 0, 0, 0>(),
1170 S.template getValue<-1, 0, 0>(),
1171 S.template getValue<-2, 0, 0>() );
1175 template<
typename Stencil>
1176 static typename Stencil::ValueType
inY(
const Stencil& S)
1178 return difference( S.template getValue< 0, 3, 0>(),
1179 S.template getValue< 0, 2, 0>(),
1180 S.template getValue< 0, 1, 0>(),
1181 S.template getValue< 0, 0, 0>(),
1182 S.template getValue< 0,-1, 0>(),
1183 S.template getValue< 0,-2, 0>() );
1186 template<
typename Stencil>
1187 static typename Stencil::ValueType
inZ(
const Stencil& S)
1190 return difference( S.template getValue< 0, 0, 3>(),
1191 S.template getValue< 0, 0, 2>(),
1192 S.template getValue< 0, 0, 1>(),
1193 S.template getValue< 0, 0, 0>(),
1194 S.template getValue< 0, 0,-1>(),
1195 S.template getValue< 0, 0,-2>() );
1204 template <
typename ValueType>
1205 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
1206 const ValueType& xp1,
const ValueType& xp0,
1207 const ValueType& xm1,
const ValueType& xm2) {
1208 return WENO5<ValueType>(xp3 - xp2, xp2 - xp1, xp1 - xp0, xp0-xm1, xm1-xm2);
1212 template<
typename Accessor>
1213 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1215 typedef typename Accessor::ValueType ValueType;
1217 V[0] = grid.getValue(ijk.
offsetBy(3,0,0));
1218 V[1] = grid.getValue(ijk.
offsetBy(2,0,0));
1219 V[2] = grid.getValue(ijk.
offsetBy(1,0,0));
1220 V[3] = grid.getValue(ijk);
1221 V[4] = grid.getValue(ijk.
offsetBy(-1,0,0));
1222 V[5] = grid.getValue(ijk.
offsetBy(-2,0,0));
1224 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1228 template<
typename Accessor>
1229 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1231 typedef typename Accessor::ValueType ValueType;
1233 V[0] = grid.getValue(ijk.
offsetBy(0,3,0));
1234 V[1] = grid.getValue(ijk.
offsetBy(0,2,0));
1235 V[2] = grid.getValue(ijk.
offsetBy(0,1,0));
1236 V[3] = grid.getValue(ijk);
1237 V[4] = grid.getValue(ijk.
offsetBy(0,-1,0));
1238 V[5] = grid.getValue(ijk.
offsetBy(0,-2,0));
1240 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1243 template<
typename Accessor>
1244 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1246 typedef typename Accessor::ValueType ValueType;
1248 V[0] = grid.getValue(ijk.
offsetBy(0,0,3));
1249 V[1] = grid.getValue(ijk.
offsetBy(0,0,2));
1250 V[2] = grid.getValue(ijk.
offsetBy(0,0,1));
1251 V[3] = grid.getValue(ijk);
1252 V[4] = grid.getValue(ijk.
offsetBy(0,0,-1));
1253 V[5] = grid.getValue(ijk.
offsetBy(0,0,-2));
1255 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1259 template<
typename Stencil>
1260 static typename Stencil::ValueType
inX(
const Stencil& S)
1263 return difference( S.template getValue< 3, 0, 0>(),
1264 S.template getValue< 2, 0, 0>(),
1265 S.template getValue< 1, 0, 0>(),
1266 S.template getValue< 0, 0, 0>(),
1267 S.template getValue<-1, 0, 0>(),
1268 S.template getValue<-2, 0, 0>() );
1272 template<
typename Stencil>
1273 static typename Stencil::ValueType
inY(
const Stencil& S)
1275 return difference( S.template getValue< 0, 3, 0>(),
1276 S.template getValue< 0, 2, 0>(),
1277 S.template getValue< 0, 1, 0>(),
1278 S.template getValue< 0, 0, 0>(),
1279 S.template getValue< 0,-1, 0>(),
1280 S.template getValue< 0,-2, 0>() );
1283 template<
typename Stencil>
1284 static typename Stencil::ValueType
inZ(
const Stencil& S)
1287 return difference( S.template getValue< 0, 0, 3>(),
1288 S.template getValue< 0, 0, 2>(),
1289 S.template getValue< 0, 0, 1>(),
1290 S.template getValue< 0, 0, 0>(),
1291 S.template getValue< 0, 0,-1>(),
1292 S.template getValue< 0, 0,-2>() );
1301 template<
typename ValueType>
1302 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
const ValueType& xm1,
1303 const ValueType& xm0,
const ValueType& xp1,
const ValueType& xp2)
1310 template<
typename Accessor>
1311 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1313 typedef typename Accessor::ValueType ValueType;
1315 V[0] = grid.getValue(ijk.
offsetBy(-3,0,0));
1316 V[1] = grid.getValue(ijk.
offsetBy(-2,0,0));
1317 V[2] = grid.getValue(ijk.
offsetBy(-1,0,0));
1318 V[3] = grid.getValue(ijk);
1319 V[4] = grid.getValue(ijk.
offsetBy(1,0,0));
1320 V[5] = grid.getValue(ijk.
offsetBy(2,0,0));
1322 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1325 template<
typename Accessor>
1326 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1328 typedef typename Accessor::ValueType ValueType;
1330 V[0] = grid.getValue(ijk.
offsetBy(0,-3,0));
1331 V[1] = grid.getValue(ijk.
offsetBy(0,-2,0));
1332 V[2] = grid.getValue(ijk.
offsetBy(0,-1,0));
1333 V[3] = grid.getValue(ijk);
1334 V[4] = grid.getValue(ijk.
offsetBy(0,1,0));
1335 V[5] = grid.getValue(ijk.
offsetBy(0,2,0));
1337 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1340 template<
typename Accessor>
1341 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1343 typedef typename Accessor::ValueType ValueType;
1345 V[0] = grid.getValue(ijk.
offsetBy(0,0,-3));
1346 V[1] = grid.getValue(ijk.
offsetBy(0,0,-2));
1347 V[2] = grid.getValue(ijk.
offsetBy(0,0,-1));
1348 V[3] = grid.getValue(ijk);
1349 V[4] = grid.getValue(ijk.
offsetBy(0,0,1));
1350 V[5] = grid.getValue(ijk.
offsetBy(0,0,2));
1352 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1356 template<
typename Stencil>
1357 static typename Stencil::ValueType
inX(
const Stencil& S)
1359 typedef typename Stencil::ValueType ValueType;
1361 V[0] = S.template getValue<-3, 0, 0>();
1362 V[1] = S.template getValue<-2, 0, 0>();
1363 V[2] = S.template getValue<-1, 0, 0>();
1364 V[3] = S.template getValue< 0, 0, 0>();
1365 V[4] = S.template getValue< 1, 0, 0>();
1366 V[5] = S.template getValue< 2, 0, 0>();
1368 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1371 template<
typename Stencil>
1372 static typename Stencil::ValueType
inY(
const Stencil& S)
1374 typedef typename Stencil::ValueType ValueType;
1376 V[0] = S.template getValue< 0,-3, 0>();
1377 V[1] = S.template getValue< 0,-2, 0>();
1378 V[2] = S.template getValue< 0,-1, 0>();
1379 V[3] = S.template getValue< 0, 0, 0>();
1380 V[4] = S.template getValue< 0, 1, 0>();
1381 V[5] = S.template getValue< 0, 2, 0>();
1383 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1386 template<
typename Stencil>
1387 static typename Stencil::ValueType
inZ(
const Stencil& S)
1389 typedef typename Stencil::ValueType ValueType;
1391 V[0] = S.template getValue< 0, 0,-3>();
1392 V[1] = S.template getValue< 0, 0,-2>();
1393 V[2] = S.template getValue< 0, 0,-1>();
1394 V[3] = S.template getValue< 0, 0, 0>();
1395 V[4] = S.template getValue< 0, 0, 1>();
1396 V[5] = S.template getValue< 0, 0, 2>();
1398 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1406 template<
typename ValueType>
1407 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
const ValueType& xm1,
1408 const ValueType& xm0,
const ValueType& xp1,
const ValueType& xp2)
1414 template<
typename Accessor>
1415 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1417 typedef typename Accessor::ValueType ValueType;
1419 V[0] = grid.getValue(ijk.
offsetBy(-3,0,0));
1420 V[1] = grid.getValue(ijk.
offsetBy(-2,0,0));
1421 V[2] = grid.getValue(ijk.
offsetBy(-1,0,0));
1422 V[3] = grid.getValue(ijk);
1423 V[4] = grid.getValue(ijk.
offsetBy(1,0,0));
1424 V[5] = grid.getValue(ijk.
offsetBy(2,0,0));
1426 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1429 template<
typename Accessor>
1430 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1432 typedef typename Accessor::ValueType ValueType;
1434 V[0] = grid.getValue(ijk.
offsetBy(0,-3,0));
1435 V[1] = grid.getValue(ijk.
offsetBy(0,-2,0));
1436 V[2] = grid.getValue(ijk.
offsetBy(0,-1,0));
1437 V[3] = grid.getValue(ijk);
1438 V[4] = grid.getValue(ijk.
offsetBy(0,1,0));
1439 V[5] = grid.getValue(ijk.
offsetBy(0,2,0));
1441 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1444 template<
typename Accessor>
1445 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1447 typedef typename Accessor::ValueType ValueType;
1449 V[0] = grid.getValue(ijk.
offsetBy(0,0,-3));
1450 V[1] = grid.getValue(ijk.
offsetBy(0,0,-2));
1451 V[2] = grid.getValue(ijk.
offsetBy(0,0,-1));
1452 V[3] = grid.getValue(ijk);
1453 V[4] = grid.getValue(ijk.
offsetBy(0,0,1));
1454 V[5] = grid.getValue(ijk.
offsetBy(0,0,2));
1456 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1460 template<
typename Stencil>
1461 static typename Stencil::ValueType
inX(
const Stencil& S)
1463 typedef typename Stencil::ValueType ValueType;
1465 V[0] = S.template getValue<-3, 0, 0>();
1466 V[1] = S.template getValue<-2, 0, 0>();
1467 V[2] = S.template getValue<-1, 0, 0>();
1468 V[3] = S.template getValue< 0, 0, 0>();
1469 V[4] = S.template getValue< 1, 0, 0>();
1470 V[5] = S.template getValue< 2, 0, 0>();
1472 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1475 template<
typename Stencil>
1476 static typename Stencil::ValueType
inY(
const Stencil& S)
1478 typedef typename Stencil::ValueType ValueType;
1480 V[0] = S.template getValue< 0,-3, 0>();
1481 V[1] = S.template getValue< 0,-2, 0>();
1482 V[2] = S.template getValue< 0,-1, 0>();
1483 V[3] = S.template getValue< 0, 0, 0>();
1484 V[4] = S.template getValue< 0, 1, 0>();
1485 V[5] = S.template getValue< 0, 2, 0>();
1487 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1490 template<
typename Stencil>
1491 static typename Stencil::ValueType
inZ(
const Stencil& S)
1493 typedef typename Stencil::ValueType ValueType;
1495 V[0] = S.template getValue< 0, 0,-3>();
1496 V[1] = S.template getValue< 0, 0,-2>();
1497 V[2] = S.template getValue< 0, 0,-1>();
1498 V[3] = S.template getValue< 0, 0, 0>();
1499 V[4] = S.template getValue< 0, 0, 1>();
1500 V[5] = S.template getValue< 0, 0, 2>();
1502 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1507 template<DScheme DiffScheme>
1511 template<
typename Accessor>
1512 static typename Accessor::ValueType::value_type
1518 template<
typename Accessor>
1519 static typename Accessor::ValueType::value_type
1524 template<
typename Accessor>
1525 static typename Accessor::ValueType::value_type
1533 template<
typename Stencil>
1534 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1539 template<
typename Stencil>
1540 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1545 template<
typename Stencil>
1546 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1558 template<
typename Accessor>
1559 static typename Accessor::ValueType::value_type
1563 grid.getValue(ijk.
offsetBy(-1, 0, 0))[n] );
1566 template<
typename Accessor>
1567 static typename Accessor::ValueType::value_type
1571 grid.getValue(ijk.
offsetBy(0,-1, 0))[n] );
1574 template<
typename Accessor>
1575 static typename Accessor::ValueType::value_type
1579 grid.getValue(ijk.
offsetBy(0, 0,-1))[n] );
1583 template<
typename Stencil>
1584 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1587 S.template getValue<-1, 0, 0>()[n] );
1590 template<
typename Stencil>
1591 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1594 S.template getValue< 0,-1, 0>()[n] );
1597 template<
typename Stencil>
1598 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1601 S.template getValue< 0, 0,-1>()[n] );
1610 template<
typename Accessor>
1611 static typename Accessor::ValueType::value_type
1615 grid.getValue(ijk.
offsetBy(-1, 0, 0))[n] );
1618 template<
typename Accessor>
1619 static typename Accessor::ValueType::value_type
1623 grid.getValue(ijk.
offsetBy(0,-1, 0))[n] );
1626 template<
typename Accessor>
1627 static typename Accessor::ValueType::value_type
1631 grid.getValue(ijk.
offsetBy(0, 0,-1))[n] );
1636 template<
typename Stencil>
1637 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1640 S.template getValue<-1, 0, 0>()[n] );
1643 template<
typename Stencil>
1644 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1647 S.template getValue< 0,-1, 0>()[n] );
1650 template<
typename Stencil>
1651 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1654 S.template getValue< 0, 0,-1>()[n] );
1665 template<
typename Accessor>
1666 static typename Accessor::ValueType::value_type
1670 grid.getValue(ijk.
offsetBy(2, 0, 0))[n], grid.getValue(ijk.
offsetBy( 1, 0, 0))[n],
1671 grid.getValue(ijk.
offsetBy(-1,0, 0))[n], grid.getValue(ijk.
offsetBy(-2, 0, 0))[n]);
1674 template<
typename Accessor>
1675 static typename Accessor::ValueType::value_type
1679 grid.getValue(ijk.
offsetBy( 0, 2, 0))[n], grid.getValue(ijk.
offsetBy( 0, 1, 0))[n],
1680 grid.getValue(ijk.
offsetBy( 0,-1, 0))[n], grid.getValue(ijk.
offsetBy( 0,-2, 0))[n]);
1683 template<
typename Accessor>
1684 static typename Accessor::ValueType::value_type
1688 grid.getValue(ijk.
offsetBy(0,0, 2))[n], grid.getValue(ijk.
offsetBy( 0, 0, 1))[n],
1689 grid.getValue(ijk.
offsetBy(0,0,-1))[n], grid.getValue(ijk.
offsetBy( 0, 0,-2))[n]);
1693 template<
typename Stencil>
1694 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1697 S.template getValue< 2, 0, 0>()[n], S.template getValue< 1, 0, 0>()[n],
1698 S.template getValue<-1, 0, 0>()[n], S.template getValue<-2, 0, 0>()[n] );
1701 template<
typename Stencil>
1702 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1705 S.template getValue< 0, 2, 0>()[n], S.template getValue< 0, 1, 0>()[n],
1706 S.template getValue< 0,-1, 0>()[n], S.template getValue< 0,-2, 0>()[n]);
1709 template<
typename Stencil>
1710 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1713 S.template getValue< 0, 0, 2>()[n], S.template getValue< 0, 0, 1>()[n],
1714 S.template getValue< 0, 0,-1>()[n], S.template getValue< 0, 0,-2>()[n]);
1725 template<
typename Accessor>
1726 static typename Accessor::ValueType::value_type
1730 grid.getValue(ijk.
offsetBy( 3, 0, 0))[n], grid.getValue(ijk.
offsetBy( 2, 0, 0))[n],
1731 grid.getValue(ijk.
offsetBy( 1, 0, 0))[n], grid.getValue(ijk.
offsetBy(-1, 0, 0))[n],
1732 grid.getValue(ijk.
offsetBy(-2, 0, 0))[n], grid.getValue(ijk.
offsetBy(-3, 0, 0))[n] );
1735 template<
typename Accessor>
1736 static typename Accessor::ValueType::value_type
1740 grid.getValue(ijk.
offsetBy( 0, 3, 0))[n], grid.getValue(ijk.
offsetBy( 0, 2, 0))[n],
1741 grid.getValue(ijk.
offsetBy( 0, 1, 0))[n], grid.getValue(ijk.
offsetBy( 0,-1, 0))[n],
1742 grid.getValue(ijk.
offsetBy( 0,-2, 0))[n], grid.getValue(ijk.
offsetBy( 0,-3, 0))[n] );
1745 template<
typename Accessor>
1746 static typename Accessor::ValueType::value_type
1750 grid.getValue(ijk.
offsetBy( 0, 0, 3))[n], grid.getValue(ijk.
offsetBy( 0, 0, 2))[n],
1751 grid.getValue(ijk.
offsetBy( 0, 0, 1))[n], grid.getValue(ijk.
offsetBy( 0, 0,-1))[n],
1752 grid.getValue(ijk.
offsetBy( 0, 0,-2))[n], grid.getValue(ijk.
offsetBy( 0, 0,-3))[n] );
1757 template<
typename Stencil>
1758 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1761 S.template getValue< 3, 0, 0>()[n], S.template getValue< 2, 0, 0>()[n],
1762 S.template getValue< 1, 0, 0>()[n], S.template getValue<-1, 0, 0>()[n],
1763 S.template getValue<-2, 0, 0>()[n], S.template getValue<-3, 0, 0>()[n] );
1766 template<
typename Stencil>
1767 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1770 S.template getValue< 0, 3, 0>()[n], S.template getValue< 0, 2, 0>()[n],
1771 S.template getValue< 0, 1, 0>()[n], S.template getValue< 0,-1, 0>()[n],
1772 S.template getValue< 0,-2, 0>()[n], S.template getValue< 0,-3, 0>()[n] );
1775 template<
typename Stencil>
1776 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1779 S.template getValue< 0, 0, 3>()[n], S.template getValue< 0, 0, 2>()[n],
1780 S.template getValue< 0, 0, 1>()[n], S.template getValue< 0, 0,-1>()[n],
1781 S.template getValue< 0, 0,-2>()[n], S.template getValue< 0, 0,-3>()[n] );
1785 template<DDScheme DiffScheme>
1789 template<
typename Accessor>
1790 static typename Accessor::ValueType inX(
const Accessor& grid,
const Coord& ijk);
1791 template<
typename Accessor>
1792 static typename Accessor::ValueType inY(
const Accessor& grid,
const Coord& ijk);
1793 template<
typename Accessor>
1794 static typename Accessor::ValueType inZ(
const Accessor& grid,
const Coord& ijk);
1797 template<
typename Accessor>
1798 static typename Accessor::ValueType inXandY(
const Accessor& grid,
const Coord& ijk);
1800 template<
typename Accessor>
1801 static typename Accessor::ValueType inXandZ(
const Accessor& grid,
const Coord& ijk);
1803 template<
typename Accessor>
1804 static typename Accessor::ValueType inYandZ(
const Accessor& grid,
const Coord& ijk);
1808 template<
typename Stencil>
1809 static typename Stencil::ValueType inX(
const Stencil& S);
1810 template<
typename Stencil>
1811 static typename Stencil::ValueType inY(
const Stencil& S);
1812 template<
typename Stencil>
1813 static typename Stencil::ValueType inZ(
const Stencil& S);
1816 template<
typename Stencil>
1817 static typename Stencil::ValueType inXandY(
const Stencil& S);
1819 template<
typename Stencil>
1820 static typename Stencil::ValueType inXandZ(
const Stencil& S);
1822 template<
typename Stencil>
1823 static typename Stencil::ValueType inYandZ(
const Stencil& S);
1831 template <
typename ValueType>
1832 static ValueType
difference(
const ValueType& xp1,
const ValueType& xp0,
const ValueType& xm1)
1834 return xp1 + xm1 - ValueType(2)*xp0;
1837 template <
typename ValueType>
1839 const ValueType& xmyp,
const ValueType& xmym)
1841 return ValueType(0.25)*(xpyp + xmym - xpym - xmyp);
1845 template<
typename Accessor>
1846 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1848 return difference( grid.getValue(ijk.
offsetBy( 1,0,0)), grid.getValue(ijk),
1849 grid.getValue(ijk.
offsetBy(-1,0,0)) );
1852 template<
typename Accessor>
1853 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1856 return difference( grid.getValue(ijk.
offsetBy(0, 1,0)), grid.getValue(ijk),
1857 grid.getValue(ijk.
offsetBy(0,-1,0)) );
1860 template<
typename Accessor>
1861 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1863 return difference( grid.getValue(ijk.
offsetBy( 0,0, 1)), grid.getValue(ijk),
1864 grid.getValue(ijk.
offsetBy( 0,0,-1)) );
1868 template<
typename Accessor>
1869 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
1871 return crossdifference(
1873 grid.getValue(ijk.
offsetBy(-1,1,0)), grid.getValue(ijk.
offsetBy(-1,-1,0)));
1877 template<
typename Accessor>
1878 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
1880 return crossdifference(
1882 grid.getValue(ijk.
offsetBy(-1,0,1)), grid.getValue(ijk.
offsetBy(-1,0,-1)) );
1885 template<
typename Accessor>
1886 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
1888 return crossdifference(
1890 grid.getValue(ijk.
offsetBy(0,-1,1)), grid.getValue(ijk.
offsetBy(0,-1,-1)) );
1895 template<
typename Stencil>
1896 static typename Stencil::ValueType
inX(
const Stencil& S)
1898 return difference( S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>(),
1899 S.template getValue<-1, 0, 0>() );
1902 template<
typename Stencil>
1903 static typename Stencil::ValueType
inY(
const Stencil& S)
1905 return difference( S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>(),
1906 S.template getValue< 0,-1, 0>() );
1909 template<
typename Stencil>
1910 static typename Stencil::ValueType
inZ(
const Stencil& S)
1912 return difference( S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>(),
1913 S.template getValue< 0, 0,-1>() );
1917 template<
typename Stencil>
1918 static typename Stencil::ValueType
inXandY(
const Stencil& S)
1920 return crossdifference(S.template getValue< 1, 1, 0>(), S.template getValue< 1,-1, 0>(),
1921 S.template getValue<-1, 1, 0>(), S.template getValue<-1,-1, 0>() );
1924 template<
typename Stencil>
1925 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
1927 return crossdifference(S.template getValue< 1, 0, 1>(), S.template getValue< 1, 0,-1>(),
1928 S.template getValue<-1, 0, 1>(), S.template getValue<-1, 0,-1>() );
1931 template<
typename Stencil>
1932 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
1934 return crossdifference(S.template getValue< 0, 1, 1>(), S.template getValue< 0, 1,-1>(),
1935 S.template getValue< 0,-1, 1>(), S.template getValue< 0,-1,-1>() );
1945 template <
typename ValueType>
1946 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
const ValueType& xp0,
1947 const ValueType& xm1,
const ValueType& xm2) {
1948 return ValueType(-1./12.)*(xp2 + xm2) + ValueType(4./3.)*(xp1 + xm1) -ValueType(2.5)*xp0;
1951 template <
typename ValueType>
1953 const ValueType& xp2ym1,
const ValueType& xp2ym2,
1954 const ValueType& xp1yp2,
const ValueType& xp1yp1,
1955 const ValueType& xp1ym1,
const ValueType& xp1ym2,
1956 const ValueType& xm2yp2,
const ValueType& xm2yp1,
1957 const ValueType& xm2ym1,
const ValueType& xm2ym2,
1958 const ValueType& xm1yp2,
const ValueType& xm1yp1,
1959 const ValueType& xm1ym1,
const ValueType& xm1ym2 ) {
1961 ValueType(2./3.0)*(xp1yp1 - xm1yp1 - xp1ym1 + xm1ym1)-
1962 ValueType(1./12.)*(xp2yp1 - xm2yp1 - xp2ym1 + xm2ym1);
1964 ValueType(2./3.0)*(xp1yp2 - xm1yp2 - xp1ym2 + xm1ym2)-
1965 ValueType(1./12.)*(xp2yp2 - xm2yp2 - xp2ym2 + xm2ym2);
1967 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
1973 template<
typename Accessor>
1974 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1979 grid.getValue(ijk.
offsetBy(-1,0,0)), grid.getValue(ijk.
offsetBy(-2, 0, 0)));
1982 template<
typename Accessor>
1983 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1988 grid.getValue(ijk.
offsetBy(0,-1,0)), grid.getValue(ijk.
offsetBy(0,-2, 0)));
1991 template<
typename Accessor>
1992 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
2001 template<
typename Accessor>
2002 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
2004 typedef typename Accessor::ValueType ValueType;
2005 typename Accessor::ValueType tmp1 =
2008 typename Accessor::ValueType tmp2 =
2011 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
2014 template<
typename Accessor>
2015 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
2017 typedef typename Accessor::ValueType ValueType;
2018 typename Accessor::ValueType tmp1 =
2021 typename Accessor::ValueType tmp2 =
2024 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
2027 template<
typename Accessor>
2028 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
2030 typedef typename Accessor::ValueType ValueType;
2031 typename Accessor::ValueType tmp1 =
2034 typename Accessor::ValueType tmp2 =
2037 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
2042 template<
typename Stencil>
2043 static typename Stencil::ValueType
inX(
const Stencil& S)
2045 return difference(S.template getValue< 2, 0, 0>(), S.template getValue< 1, 0, 0>(),
2046 S.template getValue< 0, 0, 0>(),
2047 S.template getValue<-1, 0, 0>(), S.template getValue<-2, 0, 0>() );
2050 template<
typename Stencil>
2051 static typename Stencil::ValueType
inY(
const Stencil& S)
2053 return difference(S.template getValue< 0, 2, 0>(), S.template getValue< 0, 1, 0>(),
2054 S.template getValue< 0, 0, 0>(),
2055 S.template getValue< 0,-1, 0>(), S.template getValue< 0,-2, 0>() );
2058 template<
typename Stencil>
2059 static typename Stencil::ValueType
inZ(
const Stencil& S)
2061 return difference(S.template getValue< 0, 0, 2>(), S.template getValue< 0, 0, 1>(),
2062 S.template getValue< 0, 0, 0>(),
2063 S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0,-2>() );
2067 template<
typename Stencil>
2068 static typename Stencil::ValueType
inXandY(
const Stencil& S)
2070 return crossdifference(
2071 S.template getValue< 2, 2, 0>(), S.template getValue< 2, 1, 0>(),
2072 S.template getValue< 2,-1, 0>(), S.template getValue< 2,-2, 0>(),
2073 S.template getValue< 1, 2, 0>(), S.template getValue< 1, 1, 0>(),
2074 S.template getValue< 1,-1, 0>(), S.template getValue< 1,-2, 0>(),
2075 S.template getValue<-2, 2, 0>(), S.template getValue<-2, 1, 0>(),
2076 S.template getValue<-2,-1, 0>(), S.template getValue<-2,-2, 0>(),
2077 S.template getValue<-1, 2, 0>(), S.template getValue<-1, 1, 0>(),
2078 S.template getValue<-1,-1, 0>(), S.template getValue<-1,-2, 0>() );
2081 template<
typename Stencil>
2082 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
2084 return crossdifference(
2085 S.template getValue< 2, 0, 2>(), S.template getValue< 2, 0, 1>(),
2086 S.template getValue< 2, 0,-1>(), S.template getValue< 2, 0,-2>(),
2087 S.template getValue< 1, 0, 2>(), S.template getValue< 1, 0, 1>(),
2088 S.template getValue< 1, 0,-1>(), S.template getValue< 1, 0,-2>(),
2089 S.template getValue<-2, 0, 2>(), S.template getValue<-2, 0, 1>(),
2090 S.template getValue<-2, 0,-1>(), S.template getValue<-2, 0,-2>(),
2091 S.template getValue<-1, 0, 2>(), S.template getValue<-1, 0, 1>(),
2092 S.template getValue<-1, 0,-1>(), S.template getValue<-1, 0,-2>() );
2095 template<
typename Stencil>
2096 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
2098 return crossdifference(
2099 S.template getValue< 0, 2, 2>(), S.template getValue< 0, 2, 1>(),
2100 S.template getValue< 0, 2,-1>(), S.template getValue< 0, 2,-2>(),
2101 S.template getValue< 0, 1, 2>(), S.template getValue< 0, 1, 1>(),
2102 S.template getValue< 0, 1,-1>(), S.template getValue< 0, 1,-2>(),
2103 S.template getValue< 0,-2, 2>(), S.template getValue< 0,-2, 1>(),
2104 S.template getValue< 0,-2,-1>(), S.template getValue< 0,-2,-2>(),
2105 S.template getValue< 0,-1, 2>(), S.template getValue< 0,-1, 1>(),
2106 S.template getValue< 0,-1,-1>(), S.template getValue< 0,-1,-2>() );
2115 template <
typename ValueType>
2116 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
const ValueType& xp1,
2117 const ValueType& xp0,
2118 const ValueType& xm1,
const ValueType& xm2,
const ValueType& xm3)
2120 return ValueType(1./90.)*(xp3 + xm3) - ValueType(3./20.)*(xp2 + xm2)
2121 + ValueType(1.5)*(xp1 + xm1) - ValueType(49./18.)*xp0;
2124 template <
typename ValueType>
2126 const ValueType& xp1ym1,
const ValueType& xm1ym1,
2127 const ValueType& xp2yp1,
const ValueType& xm2yp1,
2128 const ValueType& xp2ym1,
const ValueType& xm2ym1,
2129 const ValueType& xp3yp1,
const ValueType& xm3yp1,
2130 const ValueType& xp3ym1,
const ValueType& xm3ym1,
2131 const ValueType& xp1yp2,
const ValueType& xm1yp2,
2132 const ValueType& xp1ym2,
const ValueType& xm1ym2,
2133 const ValueType& xp2yp2,
const ValueType& xm2yp2,
2134 const ValueType& xp2ym2,
const ValueType& xm2ym2,
2135 const ValueType& xp3yp2,
const ValueType& xm3yp2,
2136 const ValueType& xp3ym2,
const ValueType& xm3ym2,
2137 const ValueType& xp1yp3,
const ValueType& xm1yp3,
2138 const ValueType& xp1ym3,
const ValueType& xm1ym3,
2139 const ValueType& xp2yp3,
const ValueType& xm2yp3,
2140 const ValueType& xp2ym3,
const ValueType& xm2ym3,
2141 const ValueType& xp3yp3,
const ValueType& xm3yp3,
2142 const ValueType& xp3ym3,
const ValueType& xm3ym3 )
2145 ValueType(0.7500)*(xp1yp1 - xm1yp1 - xp1ym1 + xm1ym1) -
2146 ValueType(0.1500)*(xp2yp1 - xm2yp1 - xp2ym1 + xm2ym1) +
2147 ValueType(1./60.)*(xp3yp1 - xm3yp1 - xp3ym1 + xm3ym1);
2150 ValueType(0.7500)*(xp1yp2 - xm1yp2 - xp1ym2 + xm1ym2) -
2151 ValueType(0.1500)*(xp2yp2 - xm2yp2 - xp2ym2 + xm2ym2) +
2152 ValueType(1./60.)*(xp3yp2 - xm3yp2 - xp3ym2 + xm3ym2);
2155 ValueType(0.7500)*(xp1yp3 - xm1yp3 - xp1ym3 + xm1ym3) -
2156 ValueType(0.1500)*(xp2yp3 - xm2yp3 - xp2ym3 + xm2ym3) +
2157 ValueType(1./60.)*(xp3yp3 - xm3yp3 - xp3ym3 + xm3ym3);
2159 return ValueType(0.75)*tmp1 - ValueType(0.15)*tmp2 + ValueType(1./60)*tmp3;
2164 template<
typename Accessor>
2165 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
2168 grid.getValue(ijk.
offsetBy( 3, 0, 0)), grid.getValue(ijk.
offsetBy( 2, 0, 0)),
2169 grid.getValue(ijk.
offsetBy( 1, 0, 0)), grid.getValue(ijk),
2170 grid.getValue(ijk.
offsetBy(-1, 0, 0)), grid.getValue(ijk.
offsetBy(-2, 0, 0)),
2171 grid.getValue(ijk.
offsetBy(-3, 0, 0)) );
2174 template<
typename Accessor>
2175 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
2178 grid.getValue(ijk.
offsetBy( 0, 3, 0)), grid.getValue(ijk.
offsetBy( 0, 2, 0)),
2179 grid.getValue(ijk.
offsetBy( 0, 1, 0)), grid.getValue(ijk),
2180 grid.getValue(ijk.
offsetBy( 0,-1, 0)), grid.getValue(ijk.
offsetBy( 0,-2, 0)),
2181 grid.getValue(ijk.
offsetBy( 0,-3, 0)) );
2184 template<
typename Accessor>
2185 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
2189 grid.getValue(ijk.
offsetBy( 0, 0, 3)), grid.getValue(ijk.
offsetBy( 0, 0, 2)),
2190 grid.getValue(ijk.
offsetBy( 0, 0, 1)), grid.getValue(ijk),
2191 grid.getValue(ijk.
offsetBy( 0, 0,-1)), grid.getValue(ijk.
offsetBy( 0, 0,-2)),
2192 grid.getValue(ijk.
offsetBy( 0, 0,-3)) );
2195 template<
typename Accessor>
2196 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
2198 typename Accessor::ValueType tmp1 =
2201 typename Accessor::ValueType tmp2 =
2204 typename Accessor::ValueType tmp3 =
2207 return 0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3;
2210 template<
typename Accessor>
2211 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
2213 typename Accessor::ValueType tmp1 =
2216 typename Accessor::ValueType tmp2 =
2219 typename Accessor::ValueType tmp3 =
2222 return 0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3;
2225 template<
typename Accessor>
2226 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
2228 typename Accessor::ValueType tmp1 =
2231 typename Accessor::ValueType tmp2 =
2234 typename Accessor::ValueType tmp3 =
2237 return 0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3;
2242 template<
typename Stencil>
2243 static typename Stencil::ValueType
inX(
const Stencil& S)
2245 return difference( S.template getValue< 3, 0, 0>(), S.template getValue< 2, 0, 0>(),
2246 S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>(),
2247 S.template getValue<-1, 0, 0>(), S.template getValue<-2, 0, 0>(),
2248 S.template getValue<-3, 0, 0>() );
2251 template<
typename Stencil>
2252 static typename Stencil::ValueType
inY(
const Stencil& S)
2254 return difference( S.template getValue< 0, 3, 0>(), S.template getValue< 0, 2, 0>(),
2255 S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>(),
2256 S.template getValue< 0,-1, 0>(), S.template getValue< 0,-2, 0>(),
2257 S.template getValue< 0,-3, 0>() );
2261 template<
typename Stencil>
2262 static typename Stencil::ValueType
inZ(
const Stencil& S)
2264 return difference( S.template getValue< 0, 0, 3>(), S.template getValue< 0, 0, 2>(),
2265 S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>(),
2266 S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0,-2>(),
2267 S.template getValue< 0, 0,-3>() );
2270 template<
typename Stencil>
2271 static typename Stencil::ValueType
inXandY(
const Stencil& S)
2273 return crossdifference( S.template getValue< 1, 1, 0>(), S.template getValue<-1, 1, 0>(),
2274 S.template getValue< 1,-1, 0>(), S.template getValue<-1,-1, 0>(),
2275 S.template getValue< 2, 1, 0>(), S.template getValue<-2, 1, 0>(),
2276 S.template getValue< 2,-1, 0>(), S.template getValue<-2,-1, 0>(),
2277 S.template getValue< 3, 1, 0>(), S.template getValue<-3, 1, 0>(),
2278 S.template getValue< 3,-1, 0>(), S.template getValue<-3,-1, 0>(),
2279 S.template getValue< 1, 2, 0>(), S.template getValue<-1, 2, 0>(),
2280 S.template getValue< 1,-2, 0>(), S.template getValue<-1,-2, 0>(),
2281 S.template getValue< 2, 2, 0>(), S.template getValue<-2, 2, 0>(),
2282 S.template getValue< 2,-2, 0>(), S.template getValue<-2,-2, 0>(),
2283 S.template getValue< 3, 2, 0>(), S.template getValue<-3, 2, 0>(),
2284 S.template getValue< 3,-2, 0>(), S.template getValue<-3,-2, 0>(),
2285 S.template getValue< 1, 3, 0>(), S.template getValue<-1, 3, 0>(),
2286 S.template getValue< 1,-3, 0>(), S.template getValue<-1,-3, 0>(),
2287 S.template getValue< 2, 3, 0>(), S.template getValue<-2, 3, 0>(),
2288 S.template getValue< 2,-3, 0>(), S.template getValue<-2,-3, 0>(),
2289 S.template getValue< 3, 3, 0>(), S.template getValue<-3, 3, 0>(),
2290 S.template getValue< 3,-3, 0>(), S.template getValue<-3,-3, 0>() );
2293 template<
typename Stencil>
2294 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
2296 return crossdifference( S.template getValue< 1, 0, 1>(), S.template getValue<-1, 0, 1>(),
2297 S.template getValue< 1, 0,-1>(), S.template getValue<-1, 0,-1>(),
2298 S.template getValue< 2, 0, 1>(), S.template getValue<-2, 0, 1>(),
2299 S.template getValue< 2, 0,-1>(), S.template getValue<-2, 0,-1>(),
2300 S.template getValue< 3, 0, 1>(), S.template getValue<-3, 0, 1>(),
2301 S.template getValue< 3, 0,-1>(), S.template getValue<-3, 0,-1>(),
2302 S.template getValue< 1, 0, 2>(), S.template getValue<-1, 0, 2>(),
2303 S.template getValue< 1, 0,-2>(), S.template getValue<-1, 0,-2>(),
2304 S.template getValue< 2, 0, 2>(), S.template getValue<-2, 0, 2>(),
2305 S.template getValue< 2, 0,-2>(), S.template getValue<-2, 0,-2>(),
2306 S.template getValue< 3, 0, 2>(), S.template getValue<-3, 0, 2>(),
2307 S.template getValue< 3, 0,-2>(), S.template getValue<-3, 0,-2>(),
2308 S.template getValue< 1, 0, 3>(), S.template getValue<-1, 0, 3>(),
2309 S.template getValue< 1, 0,-3>(), S.template getValue<-1, 0,-3>(),
2310 S.template getValue< 2, 0, 3>(), S.template getValue<-2, 0, 3>(),
2311 S.template getValue< 2, 0,-3>(), S.template getValue<-2, 0,-3>(),
2312 S.template getValue< 3, 0, 3>(), S.template getValue<-3, 0, 3>(),
2313 S.template getValue< 3, 0,-3>(), S.template getValue<-3, 0,-3>() );
2316 template<
typename Stencil>
2317 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
2319 return crossdifference( S.template getValue< 0, 1, 1>(), S.template getValue< 0,-1, 1>(),
2320 S.template getValue< 0, 1,-1>(), S.template getValue< 0,-1,-1>(),
2321 S.template getValue< 0, 2, 1>(), S.template getValue< 0,-2, 1>(),
2322 S.template getValue< 0, 2,-1>(), S.template getValue< 0,-2,-1>(),
2323 S.template getValue< 0, 3, 1>(), S.template getValue< 0,-3, 1>(),
2324 S.template getValue< 0, 3,-1>(), S.template getValue< 0,-3,-1>(),
2325 S.template getValue< 0, 1, 2>(), S.template getValue< 0,-1, 2>(),
2326 S.template getValue< 0, 1,-2>(), S.template getValue< 0,-1,-2>(),
2327 S.template getValue< 0, 2, 2>(), S.template getValue< 0,-2, 2>(),
2328 S.template getValue< 0, 2,-2>(), S.template getValue< 0,-2,-2>(),
2329 S.template getValue< 0, 3, 2>(), S.template getValue< 0,-3, 2>(),
2330 S.template getValue< 0, 3,-2>(), S.template getValue< 0,-3,-2>(),
2331 S.template getValue< 0, 1, 3>(), S.template getValue< 0,-1, 3>(),
2332 S.template getValue< 0, 1,-3>(), S.template getValue< 0,-1,-3>(),
2333 S.template getValue< 0, 2, 3>(), S.template getValue< 0,-2, 3>(),
2334 S.template getValue< 0, 2,-3>(), S.template getValue< 0,-2,-3>(),
2335 S.template getValue< 0, 3, 3>(), S.template getValue< 0,-3, 3>(),
2336 S.template getValue< 0, 3,-3>(), S.template getValue< 0,-3,-3>() );
2345 #endif // OPENVDB_MATH_FINITEDIFFERENCE_HAS_BEEN_INCLUDED
static ValueType difference(const ValueType &xm2, const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:974
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:2096
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:888
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:877
Definition: FiniteDifference.h:268
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:859
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:500
std::string dsSchemeToString(DScheme dss)
Definition: FiniteDifference.h:81
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:635
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1229
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:678
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:2271
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1846
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:806
std::string biasedGradientSchemeToMenuName(BiasedGradientScheme bgs)
Definition: FiniteDifference.h:242
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:788
static ValueType difference(const ValueType &xp1, const ValueType &xp0, const ValueType &xm1)
Definition: FiniteDifference.h:1832
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:941
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1747
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1147
Definition: FiniteDifference.h:201
Definition: FiniteDifference.h:1786
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:547
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1727
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1520
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1767
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1974
Definition: FiniteDifference.h:64
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1387
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1311
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2211
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:762
Definition: FiniteDifference.h:70
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:825
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1064
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:491
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1598
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:1932
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:711
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1445
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:743
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:2043
std::string temporalIntegrationSchemeToString(TemporalIntegrationScheme tis)
Definition: FiniteDifference.h:271
DScheme stringToDScheme(const std::string &s)
Definition: FiniteDifference.h:105
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:998
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:688
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1685
static ValueType crossdifference(const ValueType &xpyp, const ValueType &xpym, const ValueType &xmyp, const ValueType &xmym)
Definition: FiniteDifference.h:1838
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1415
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:483
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:2294
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1372
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:1918
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0, const ValueType &xp1, const ValueType &xp2)
Definition: FiniteDifference.h:1302
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:868
static ValueType difference(const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:922
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1326
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:557
static ValueType crossdifference(const ValueType &xp1yp1, const ValueType &xm1yp1, const ValueType &xp1ym1, const ValueType &xm1ym1, const ValueType &xp2yp1, const ValueType &xm2yp1, const ValueType &xp2ym1, const ValueType &xm2ym1, const ValueType &xp3yp1, const ValueType &xm3yp1, const ValueType &xp3ym1, const ValueType &xm3ym1, const ValueType &xp1yp2, const ValueType &xm1yp2, const ValueType &xp1ym2, const ValueType &xm1ym2, const ValueType &xp2yp2, const ValueType &xm2yp2, const ValueType &xp2ym2, const ValueType &xm2ym2, const ValueType &xp3yp2, const ValueType &xm3yp2, const ValueType &xp3ym2, const ValueType &xm3ym2, const ValueType &xp1yp3, const ValueType &xm1yp3, const ValueType &xp1ym3, const ValueType &xm1ym3, const ValueType &xp2yp3, const ValueType &xm2yp3, const ValueType &xp2ym3, const ValueType &xm2ym3, const ValueType &xp3yp3, const ValueType &xm3yp3, const ValueType &xp3ym3, const ValueType &xm3ym3)
Definition: FiniteDifference.h:2125
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:935
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1007
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:660
Definition: FiniteDifference.h:264
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1107
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:617
Definition: FiniteDifference.h:69
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1083
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:961
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1491
Type Pow2(Type x)
Return .
Definition: Math.h:458
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:512
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1983
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:626
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:568
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1861
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1055
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:581
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1540
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1046
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:531
Definition: FiniteDifference.h:196
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:817
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:949
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:589
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1461
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:562
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:982
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1903
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1023
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2015
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:699
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2002
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1092
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1132
Real GudonovsNormSqrd(bool isOutside, const Vec3< Real > &gradient_m, const Vec3< Real > &gradient_p)
Definition: FiniteDifference.h:378
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1896
std::string biasedGradientSchemeToString(BiasedGradientScheme bgs)
Definition: FiniteDifference.h:204
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:955
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1273
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1015
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1946
const Type & Max(const Type &a, const Type &b)
Return the maximum of two values.
Definition: Math.h:505
TemporalIntegrationScheme
Temporal integration schemes.
Definition: FiniteDifference.h:261
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1992
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:756
Definition: FiniteDifference.h:265
#define OPENVDB_VERSION_NAME
Definition: version.h:45
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:47
Definition: FiniteDifference.h:1508
static ValueType difference(const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:730
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1341
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1651
BiasedGradientScheme
Biased Gradients are limited to non-centered differences.
Definition: FiniteDifference.h:192
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:780
Definition: FiniteDifference.h:193
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:797
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2226
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:737
Definition: FiniteDifference.h:67
Definition: FiniteDifference.h:61
Definition: FiniteDifference.h:198
Definition: FiniteDifference.h:77
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2, const ValueType &xm3)
Definition: FiniteDifference.h:2116
Definition: FiniteDifference.h:60
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1357
Definition: FiniteDifference.h:68
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2028
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:768
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:475
static ValueType crossdifference(const ValueType &xp2yp2, const ValueType &xp2yp1, const ValueType &xp2ym1, const ValueType &xp2ym2, const ValueType &xp1yp2, const ValueType &xp1yp1, const ValueType &xp1ym1, const ValueType &xp1ym2, const ValueType &xm2yp2, const ValueType &xm2yp1, const ValueType &xm2ym1, const ValueType &xm2ym2, const ValueType &xm1yp2, const ValueType &xm1yp1, const ValueType &xm1ym1, const ValueType &xm1ym2)
Definition: FiniteDifference.h:1952
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1176
std::string temporalIntegrationSchemeToMenuName(TemporalIntegrationScheme tis)
Definition: FiniteDifference.h:304
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1560
Definition: FiniteDifference.h:262
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:990
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:2068
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1758
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:597
Definition: FiniteDifference.h:72
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:539
static ValueType difference(const ValueType &xp1, const ValueType &xm1)
Definition: FiniteDifference.h:469
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:2317
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1737
Definition: FiniteDifference.h:66
Definition: FiniteDifference.h:195
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1628
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:2262
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:833
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1612
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2165
Definition: FiniteDifference.h:63
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:102
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:906
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1910
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1244
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1526
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1694
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:669
Definition: FiniteDifference.h:178
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1205
Definition: FiniteDifference.h:180
Definition: FiniteDifference.h:71
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:2051
std::string dsSchemeToMenuName(DScheme dss)
Definition: FiniteDifference.h:147
Definition: FiniteDifference.h:74
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1213
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1676
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1576
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:506
TemporalIntegrationScheme stringToTemporalIntegrationScheme(const std::string &s)
Definition: FiniteDifference.h:284
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:2082
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1534
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1584
double Real
Definition: Types.h:63
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:2243
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1546
Definition: FiniteDifference.h:263
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1869
BiasedGradientScheme stringToBiasedGradientScheme(const std::string &s)
Definition: FiniteDifference.h:219
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:929
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:2059
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1284
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1430
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1644
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1637
Definition: FiniteDifference.h:441
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2175
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:2252
Definition: FiniteDifference.h:179
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1591
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1776
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2196
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1886
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1513
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2185
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1620
Definition: FiniteDifference.h:184
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1568
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1187
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1878
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1117
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:1925
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:849
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1074
Definition: FiniteDifference.h:62
Definition: FiniteDifference.h:181
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1260
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1853
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:606
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xm1, const ValueType &xm2, const ValueType &xm3)
Definition: FiniteDifference.h:650
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0, const ValueType &xp1, const ValueType &xp2)
Definition: FiniteDifference.h:1407
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:897
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:749
DDScheme
Different discrete schemes used in the second derivatives.
Definition: FiniteDifference.h:177
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:1038
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1163
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1710
Definition: FiniteDifference.h:65
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1667
Definition: FiniteDifference.h:197
Definition: FiniteDifference.h:73
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1702
Definition: FiniteDifference.h:194
static ValueType difference(const ValueType &xp1, const ValueType &xm1)
Definition: FiniteDifference.h:524
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1476
ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, float scale2=0.01)
Implementation of nominally fifth-order finite-difference WENO.
Definition: FiniteDifference.h:331
const Type & Min(const Type &a, const Type &b)
Return the minimum of two values.
Definition: Math.h:566