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,
const ValueType& v4,
const ValueType& v5,
float scale2 = 0.01)
333 static const double C=13.0/12.0;
338 const double eps=1e-6*scale2;
344 return ValueType(A1*(2.0*v1 - 7.0*v2 + 11.0*v3) +
345 A2*(5.0*v3 - v2 + 2.0*v4) +
346 A3*(2.0*v3 + 5.0*v4 - v5))/(6.0*(A1+A2+A3));
350 template <
typename Real>
375 template <
typename Real>
378 return GudonovsNormSqrd<Real>(isOutside,
379 gradient_m[0], gradient_p[0],
380 gradient_m[1], gradient_p[1],
381 gradient_m[2], gradient_p[2]);
386 inline simd::Float4 simdMin(
const simd::Float4& a,
const simd::Float4& b) {
387 return simd::Float4(_mm_min_ps(a.base(), b.base()));
389 inline simd::Float4 simdMax(
const simd::Float4& a,
const simd::Float4& b) {
390 return simd::Float4(_mm_max_ps(a.base(), b.base()));
393 inline float simdSum(
const simd::Float4& v);
395 inline simd::Float4
Pow2(
const simd::Float4& v) {
return v * v; }
399 WENO5<simd::Float4>(
const simd::Float4& v1,
const simd::Float4& v2,
const simd::Float4& v3,
400 const simd::Float4& v4,
const simd::Float4& v5,
float scale2)
403 typedef simd::Float4 F4;
407 two(2.0), three(3.0), four(4.0), five(5.0), fourth(0.25),
408 A1 = F4(0.1) /
Pow2(C*
Pow2(v1-two*v2+v3) + fourth*
Pow2(v1-four*v2+three*v3) + eps),
409 A2 = F4(0.6) /
Pow2(C*
Pow2(v2-two*v3+v4) + fourth*
Pow2(v2-v4) + eps),
410 A3 = F4(0.3) /
Pow2(C*
Pow2(v3-two*v4+v5) + fourth*
Pow2(three*v3-four*v4+v5) + eps);
411 return (A1 * (two * v1 - F4(7.0) * v2 + F4(11.0) * v3) +
412 A2 * (five * v3 - v2 + two * v4) +
413 A3 * (two * v3 + five * v4 - v5)) / (F4(6.0) * (A1 + A2 + A3));
418 simdSum(
const simd::Float4& v)
421 __m128 temp = _mm_add_ps(v.base(), _mm_movehl_ps(v.base(), v.base()));
423 temp = _mm_add_ss(temp, _mm_shuffle_ps(temp, temp, 1));
424 return _mm_cvtss_f32(temp);
428 GudonovsNormSqrd(
bool isOutside,
const simd::Float4& dP_m,
const simd::Float4& dP_p)
430 const simd::Float4 zero(0.0);
431 simd::Float4 v = isOutside
433 : simdMax(math::
Pow2(simdMin(dP_m, zero)), math::
Pow2(simdMax(dP_p, zero)));
438 template<DScheme DiffScheme>
442 template<
typename Accessor>
443 static typename Accessor::ValueType inX(
const Accessor& grid,
const Coord& ijk);
445 template<
typename Accessor>
446 static typename Accessor::ValueType inY(
const Accessor& grid,
const Coord& ijk);
448 template<
typename Accessor>
449 static typename Accessor::ValueType inZ(
const Accessor& grid,
const Coord& ijk);
452 template<
typename Stencil>
453 static typename Stencil::ValueType inX(
const Stencil& S);
455 template<
typename Stencil>
456 static typename Stencil::ValueType inY(
const Stencil& S);
458 template<
typename Stencil>
459 static typename Stencil::ValueType inZ(
const Stencil& S);
466 template <
typename ValueType>
467 static ValueType
difference(
const ValueType& xp1,
const ValueType& xm1) {
472 template<
typename Accessor>
473 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
475 return difference(grid.getValue(ijk.
offsetBy(1, 0, 0)), grid.getValue(ijk.
offsetBy(-1, 0, 0)));
478 template<
typename Accessor>
479 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
481 return difference(grid.getValue(ijk.
offsetBy(0, 1, 0)), grid.getValue(ijk.
offsetBy( 0, -1, 0)));
484 template<
typename Accessor>
485 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
487 return difference(grid.getValue(ijk.
offsetBy(0, 0, 1)), grid.getValue(ijk.
offsetBy( 0, 0, -1)));
491 template<
typename Stencil>
492 static typename Stencil::ValueType
inX(
const Stencil& S)
494 return difference( S.template getValue< 1, 0, 0>(), S.template getValue<-1, 0, 0>());
497 template<
typename Stencil>
498 static typename Stencil::ValueType
inY(
const Stencil& S)
500 return difference( S.template getValue< 0, 1, 0>(), S.template getValue< 0,-1, 0>());
503 template<
typename Stencil>
504 static typename Stencil::ValueType
inZ(
const Stencil& S)
506 return difference( S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0,-1>());
515 template <
typename ValueType>
516 static ValueType
difference(
const ValueType& xp1,
const ValueType& xm1) {
517 return (xp1 - xm1)*ValueType(0.5);
522 template<
typename Accessor>
523 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
525 return difference(grid.getValue(ijk.
offsetBy(1, 0, 0)), grid.getValue(ijk.
offsetBy(-1, 0, 0)));
528 template<
typename Accessor>
529 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
531 return difference(grid.getValue(ijk.
offsetBy(0, 1, 0)), grid.getValue(ijk.
offsetBy( 0, -1, 0)));
534 template<
typename Accessor>
535 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
537 return difference(grid.getValue(ijk.
offsetBy(0, 0, 1)), grid.getValue(ijk.
offsetBy( 0, 0, -1)));
542 template<
typename Stencil>
543 static typename Stencil::ValueType
inX(
const Stencil& S)
545 typedef typename Stencil::ValueType ValueType;
546 return difference(S.template getValue< 1, 0, 0>(), S.template getValue<-1, 0, 0>());
548 template<
typename Stencil>
549 static typename Stencil::ValueType
inY(
const Stencil& S)
551 typedef typename Stencil::ValueType ValueType;
552 return difference(S.template getValue< 0, 1, 0>(), S.template getValue< 0,-1, 0>());
555 template<
typename Stencil>
556 static typename Stencil::ValueType
inZ(
const Stencil& S)
558 typedef typename Stencil::ValueType ValueType;
559 return difference(S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0,-1>());
569 template <
typename ValueType>
570 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
571 const ValueType& xm1,
const ValueType& xm2 ) {
572 return ValueType(2./3.)*(xp1 - xm1) + ValueType(1./12.)*(xm2 - xp2) ;
577 template<
typename Accessor>
578 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
580 return difference( grid.getValue(ijk.
offsetBy( 2,0,0)), grid.getValue(ijk.
offsetBy( 1,0,0)),
585 template<
typename Accessor>
586 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
589 return difference( grid.getValue(ijk.
offsetBy( 0, 2, 0)), grid.getValue(ijk.
offsetBy( 0, 1, 0)),
590 grid.getValue(ijk.
offsetBy( 0,-1, 0)), grid.getValue(ijk.
offsetBy( 0,-2, 0)) );
594 template<
typename Accessor>
595 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
598 return difference( grid.getValue(ijk.
offsetBy( 0, 0, 2)), grid.getValue(ijk.
offsetBy( 0, 0, 1)),
599 grid.getValue(ijk.
offsetBy( 0, 0,-1)), grid.getValue(ijk.
offsetBy( 0, 0,-2)) );
604 template<
typename Stencil>
605 static typename Stencil::ValueType
inX(
const Stencil& S)
607 return difference( S.template getValue< 2, 0, 0>(),
608 S.template getValue< 1, 0, 0>(),
609 S.template getValue<-1, 0, 0>(),
610 S.template getValue<-2, 0, 0>() );
613 template<
typename Stencil>
614 static typename Stencil::ValueType
inY(
const Stencil& S)
616 return difference( S.template getValue< 0, 2, 0>(),
617 S.template getValue< 0, 1, 0>(),
618 S.template getValue< 0,-1, 0>(),
619 S.template getValue< 0,-2, 0>() );
622 template<
typename Stencil>
623 static typename Stencil::ValueType
inZ(
const Stencil& S)
625 return difference( S.template getValue< 0, 0, 2>(),
626 S.template getValue< 0, 0, 1>(),
627 S.template getValue< 0, 0,-1>(),
628 S.template getValue< 0, 0,-2>() );
637 template <
typename ValueType>
638 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
const ValueType& xp1,
639 const ValueType& xm1,
const ValueType& xm2,
const ValueType& xm3 ) {
640 return ValueType(3./4.)*(xp1 - xm1) - ValueType(0.15)*(xp2 - xm2) + ValueType(1./60.)*(xp3-xm3);
645 template<
typename Accessor>
646 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
648 return difference( grid.getValue(ijk.
offsetBy( 3,0,0)), grid.getValue(ijk.
offsetBy( 2,0,0)),
653 template<
typename Accessor>
654 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
656 return difference( grid.getValue(ijk.
offsetBy( 0, 3,0)), grid.getValue(ijk.
offsetBy( 0, 2,0)),
658 grid.getValue(ijk.
offsetBy( 0,-2,0)), grid.getValue(ijk.
offsetBy( 0,-3,0)));
661 template<
typename Accessor>
662 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
664 return difference( grid.getValue(ijk.
offsetBy( 0, 0, 3)), grid.getValue(ijk.
offsetBy( 0, 0, 2)),
665 grid.getValue(ijk.
offsetBy( 0, 0, 1)), grid.getValue(ijk.
offsetBy( 0, 0,-1)),
666 grid.getValue(ijk.
offsetBy( 0, 0,-2)), grid.getValue(ijk.
offsetBy( 0, 0,-3)));
670 template<
typename Stencil>
671 static typename Stencil::ValueType
inX(
const Stencil& S)
673 return difference(S.template getValue< 3, 0, 0>(),
674 S.template getValue< 2, 0, 0>(),
675 S.template getValue< 1, 0, 0>(),
676 S.template getValue<-1, 0, 0>(),
677 S.template getValue<-2, 0, 0>(),
678 S.template getValue<-3, 0, 0>());
681 template<
typename Stencil>
682 static typename Stencil::ValueType
inY(
const Stencil& S)
685 return difference( S.template getValue< 0, 3, 0>(),
686 S.template getValue< 0, 2, 0>(),
687 S.template getValue< 0, 1, 0>(),
688 S.template getValue< 0,-1, 0>(),
689 S.template getValue< 0,-2, 0>(),
690 S.template getValue< 0,-3, 0>());
693 template<
typename Stencil>
694 static typename Stencil::ValueType
inZ(
const Stencil& S)
697 return difference( S.template getValue< 0, 0, 3>(),
698 S.template getValue< 0, 0, 2>(),
699 S.template getValue< 0, 0, 1>(),
700 S.template getValue< 0, 0,-1>(),
701 S.template getValue< 0, 0,-2>(),
702 S.template getValue< 0, 0,-3>());
712 template <
typename ValueType>
713 static ValueType
difference(
const ValueType& xp1,
const ValueType& xp0) {
719 template<
typename Accessor>
720 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
722 return difference(grid.getValue(ijk.
offsetBy(1, 0, 0)), grid.getValue(ijk));
725 template<
typename Accessor>
726 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
728 return difference(grid.getValue(ijk.
offsetBy(0, 1, 0)), grid.getValue(ijk));
731 template<
typename Accessor>
732 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
734 return difference(grid.getValue(ijk.
offsetBy(0, 0, 1)), grid.getValue(ijk));
738 template<
typename Stencil>
739 static typename Stencil::ValueType
inX(
const Stencil& S)
741 return difference(S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>());
744 template<
typename Stencil>
745 static typename Stencil::ValueType
inY(
const Stencil& S)
747 return difference(S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>());
750 template<
typename Stencil>
751 static typename Stencil::ValueType
inZ(
const Stencil& S)
753 return difference(S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>());
763 template <
typename ValueType>
764 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
const ValueType& xp0) {
765 return ValueType(2)*xp1 -(ValueType(0.5)*xp2 + ValueType(3./2.)*xp0);
770 template<
typename Accessor>
771 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
773 return difference(grid.getValue(ijk.
offsetBy(2,0,0)), grid.getValue(ijk.
offsetBy(1,0,0)), grid.getValue(ijk));
776 template<
typename Accessor>
777 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
779 return difference(grid.getValue(ijk.
offsetBy(0,2,0)), grid.getValue(ijk.
offsetBy(0,1,0)), grid.getValue(ijk));
782 template<
typename Accessor>
783 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
785 return difference(grid.getValue(ijk.
offsetBy(0,0,2)), grid.getValue(ijk.
offsetBy(0,0,1)), grid.getValue(ijk));
790 template<
typename Stencil>
791 static typename Stencil::ValueType
inX(
const Stencil& S)
793 return difference( S.template getValue< 2, 0, 0>(),
794 S.template getValue< 1, 0, 0>(),
795 S.template getValue< 0, 0, 0>() );
798 template<
typename Stencil>
799 static typename Stencil::ValueType
inY(
const Stencil& S)
801 return difference( S.template getValue< 0, 2, 0>(),
802 S.template getValue< 0, 1, 0>(),
803 S.template getValue< 0, 0, 0>() );
806 template<
typename Stencil>
807 static typename Stencil::ValueType
inZ(
const Stencil& S)
809 return difference( S.template getValue< 0, 0, 2>(),
810 S.template getValue< 0, 0, 1>(),
811 S.template getValue< 0, 0, 0>() );
822 template <
typename ValueType>
823 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
const ValueType& xp1,
const ValueType& xp0) {
824 return ValueType(1./3.)*xp3 - ValueType(1.5)*xp2 + ValueType(3.)*xp1 - ValueType(11./6.)*xp0;
829 template<
typename Accessor>
830 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
832 return difference( grid.getValue(ijk.
offsetBy(3,0,0)),
835 grid.getValue(ijk) );
838 template<
typename Accessor>
839 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
841 return difference( grid.getValue(ijk.
offsetBy(0,3,0)),
844 grid.getValue(ijk) );
847 template<
typename Accessor>
848 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
850 return difference( grid.getValue(ijk.
offsetBy(0,0,3)),
853 grid.getValue(ijk) );
858 template<
typename Stencil>
859 static typename Stencil::ValueType
inX(
const Stencil& S)
861 return difference(S.template getValue< 3, 0, 0>(),
862 S.template getValue< 2, 0, 0>(),
863 S.template getValue< 1, 0, 0>(),
864 S.template getValue< 0, 0, 0>() );
867 template<
typename Stencil>
868 static typename Stencil::ValueType
inY(
const Stencil& S)
870 return difference(S.template getValue< 0, 3, 0>(),
871 S.template getValue< 0, 2, 0>(),
872 S.template getValue< 0, 1, 0>(),
873 S.template getValue< 0, 0, 0>() );
876 template<
typename Stencil>
877 static typename Stencil::ValueType
inZ(
const Stencil& S)
879 return difference( S.template getValue< 0, 0, 3>(),
880 S.template getValue< 0, 0, 2>(),
881 S.template getValue< 0, 0, 1>(),
882 S.template getValue< 0, 0, 0>() );
892 template <
typename ValueType>
893 static ValueType
difference(
const ValueType& xm1,
const ValueType& xm0) {
899 template<
typename Accessor>
900 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
902 return difference(grid.getValue(ijk.
offsetBy(-1,0,0)), grid.getValue(ijk));
905 template<
typename Accessor>
906 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
908 return difference(grid.getValue(ijk.
offsetBy(0,-1,0)), grid.getValue(ijk));
911 template<
typename Accessor>
912 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
914 return difference(grid.getValue(ijk.
offsetBy(0, 0,-1)), grid.getValue(ijk));
919 template<
typename Stencil>
920 static typename Stencil::ValueType
inX(
const Stencil& S)
922 return difference(S.template getValue<-1, 0, 0>(), S.template getValue< 0, 0, 0>());
925 template<
typename Stencil>
926 static typename Stencil::ValueType
inY(
const Stencil& S)
928 return difference(S.template getValue< 0,-1, 0>(), S.template getValue< 0, 0, 0>());
931 template<
typename Stencil>
932 static typename Stencil::ValueType
inZ(
const Stencil& S)
934 return difference(S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0, 0>());
944 template <
typename ValueType>
945 static ValueType
difference(
const ValueType& xm2,
const ValueType& xm1,
const ValueType& xm0) {
951 template<
typename Accessor>
952 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
954 return difference( grid.getValue(ijk.
offsetBy(-2,0,0)),
955 grid.getValue(ijk.
offsetBy(-1,0,0)),
956 grid.getValue(ijk) );
959 template<
typename Accessor>
960 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
962 return difference( grid.getValue(ijk.
offsetBy(0,-2,0)),
963 grid.getValue(ijk.
offsetBy(0,-1,0)),
964 grid.getValue(ijk) );
967 template<
typename Accessor>
968 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
970 return difference( grid.getValue(ijk.
offsetBy(0,0,-2)),
971 grid.getValue(ijk.
offsetBy(0,0,-1)),
972 grid.getValue(ijk) );
976 template<
typename Stencil>
977 static typename Stencil::ValueType
inX(
const Stencil& S)
979 return difference( S.template getValue<-2, 0, 0>(),
980 S.template getValue<-1, 0, 0>(),
981 S.template getValue< 0, 0, 0>() );
984 template<
typename Stencil>
985 static typename Stencil::ValueType
inY(
const Stencil& S)
987 return difference( S.template getValue< 0,-2, 0>(),
988 S.template getValue< 0,-1, 0>(),
989 S.template getValue< 0, 0, 0>() );
992 template<
typename Stencil>
993 static typename Stencil::ValueType
inZ(
const Stencil& S)
995 return difference( S.template getValue< 0, 0,-2>(),
996 S.template getValue< 0, 0,-1>(),
997 S.template getValue< 0, 0, 0>() );
1007 template <
typename ValueType>
1008 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
const ValueType& xm1,
const ValueType& xm0){
1013 template<
typename Accessor>
1014 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1016 return difference( grid.getValue(ijk.
offsetBy(-3,0,0)),
1017 grid.getValue(ijk.
offsetBy(-2,0,0)),
1018 grid.getValue(ijk.
offsetBy(-1,0,0)),
1019 grid.getValue(ijk) );
1022 template<
typename Accessor>
1023 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1025 return difference( grid.getValue(ijk.
offsetBy( 0,-3,0)),
1026 grid.getValue(ijk.
offsetBy( 0,-2,0)),
1027 grid.getValue(ijk.
offsetBy( 0,-1,0)),
1028 grid.getValue(ijk) );
1031 template<
typename Accessor>
1032 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1034 return difference( grid.getValue(ijk.
offsetBy( 0, 0,-3)),
1035 grid.getValue(ijk.
offsetBy( 0, 0,-2)),
1036 grid.getValue(ijk.
offsetBy( 0, 0,-1)),
1037 grid.getValue(ijk) );
1041 template<
typename Stencil>
1042 static typename Stencil::ValueType
inX(
const Stencil& S)
1044 return difference( S.template getValue<-3, 0, 0>(),
1045 S.template getValue<-2, 0, 0>(),
1046 S.template getValue<-1, 0, 0>(),
1047 S.template getValue< 0, 0, 0>() );
1050 template<
typename Stencil>
1051 static typename Stencil::ValueType
inY(
const Stencil& S)
1053 return difference( S.template getValue< 0,-3, 0>(),
1054 S.template getValue< 0,-2, 0>(),
1055 S.template getValue< 0,-1, 0>(),
1056 S.template getValue< 0, 0, 0>() );
1059 template<
typename Stencil>
1060 static typename Stencil::ValueType
inZ(
const Stencil& S)
1062 return difference( S.template getValue< 0, 0,-3>(),
1063 S.template getValue< 0, 0,-2>(),
1064 S.template getValue< 0, 0,-1>(),
1065 S.template getValue< 0, 0, 0>() );
1074 template <
typename ValueType>
1075 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
1076 const ValueType& xp1,
const ValueType& xp0,
1077 const ValueType& xm1,
const ValueType& xm2) {
1078 return WENO5<ValueType>(xp3, xp2, xp1, xp0, xm1)
1079 - WENO5<ValueType>(xp2, xp1, xp0, xm1, xm2);
1084 template<
typename Accessor>
1085 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1087 typedef typename Accessor::ValueType ValueType;
1089 V[0] = grid.getValue(ijk.
offsetBy(3,0,0));
1090 V[1] = grid.getValue(ijk.
offsetBy(2,0,0));
1091 V[2] = grid.getValue(ijk.
offsetBy(1,0,0));
1092 V[3] = grid.getValue(ijk);
1093 V[4] = grid.getValue(ijk.
offsetBy(-1,0,0));
1094 V[5] = grid.getValue(ijk.
offsetBy(-2,0,0));
1096 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1099 template<
typename Accessor>
1100 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1102 typedef typename Accessor::ValueType ValueType;
1104 V[0] = grid.getValue(ijk.
offsetBy(0,3,0));
1105 V[1] = grid.getValue(ijk.
offsetBy(0,2,0));
1106 V[2] = grid.getValue(ijk.
offsetBy(0,1,0));
1107 V[3] = grid.getValue(ijk);
1108 V[4] = grid.getValue(ijk.
offsetBy(0,-1,0));
1109 V[5] = grid.getValue(ijk.
offsetBy(0,-2,0));
1111 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1114 template<
typename Accessor>
1115 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1117 typedef typename Accessor::ValueType ValueType;
1119 V[0] = grid.getValue(ijk.
offsetBy(0,0,3));
1120 V[1] = grid.getValue(ijk.
offsetBy(0,0,2));
1121 V[2] = grid.getValue(ijk.
offsetBy(0,0,1));
1122 V[3] = grid.getValue(ijk);
1123 V[4] = grid.getValue(ijk.
offsetBy(0,0,-1));
1124 V[5] = grid.getValue(ijk.
offsetBy(0,0,-2));
1126 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1130 template<
typename Stencil>
1131 static typename Stencil::ValueType
inX(
const Stencil& S)
1134 return difference( S.template getValue< 3, 0, 0>(),
1135 S.template getValue< 2, 0, 0>(),
1136 S.template getValue< 1, 0, 0>(),
1137 S.template getValue< 0, 0, 0>(),
1138 S.template getValue<-1, 0, 0>(),
1139 S.template getValue<-2, 0, 0>() );
1143 template<
typename Stencil>
1144 static typename Stencil::ValueType
inY(
const Stencil& S)
1146 return difference( S.template getValue< 0, 3, 0>(),
1147 S.template getValue< 0, 2, 0>(),
1148 S.template getValue< 0, 1, 0>(),
1149 S.template getValue< 0, 0, 0>(),
1150 S.template getValue< 0,-1, 0>(),
1151 S.template getValue< 0,-2, 0>() );
1154 template<
typename Stencil>
1155 static typename Stencil::ValueType
inZ(
const Stencil& S)
1158 return difference( S.template getValue< 0, 0, 3>(),
1159 S.template getValue< 0, 0, 2>(),
1160 S.template getValue< 0, 0, 1>(),
1161 S.template getValue< 0, 0, 0>(),
1162 S.template getValue< 0, 0,-1>(),
1163 S.template getValue< 0, 0,-2>() );
1172 template <
typename ValueType>
1173 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
1174 const ValueType& xp1,
const ValueType& xp0,
1175 const ValueType& xm1,
const ValueType& xm2) {
1176 return WENO5<ValueType>(xp3 - xp2, xp2 - xp1, xp1 - xp0, xp0-xm1, xm1-xm2);
1180 template<
typename Accessor>
1181 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1183 typedef typename Accessor::ValueType ValueType;
1185 V[0] = grid.getValue(ijk.
offsetBy(3,0,0));
1186 V[1] = grid.getValue(ijk.
offsetBy(2,0,0));
1187 V[2] = grid.getValue(ijk.
offsetBy(1,0,0));
1188 V[3] = grid.getValue(ijk);
1189 V[4] = grid.getValue(ijk.
offsetBy(-1,0,0));
1190 V[5] = grid.getValue(ijk.
offsetBy(-2,0,0));
1192 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1196 template<
typename Accessor>
1197 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1199 typedef typename Accessor::ValueType ValueType;
1201 V[0] = grid.getValue(ijk.
offsetBy(0,3,0));
1202 V[1] = grid.getValue(ijk.
offsetBy(0,2,0));
1203 V[2] = grid.getValue(ijk.
offsetBy(0,1,0));
1204 V[3] = grid.getValue(ijk);
1205 V[4] = grid.getValue(ijk.
offsetBy(0,-1,0));
1206 V[5] = grid.getValue(ijk.
offsetBy(0,-2,0));
1208 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1211 template<
typename Accessor>
1212 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1214 typedef typename Accessor::ValueType ValueType;
1216 V[0] = grid.getValue(ijk.
offsetBy(0,0,3));
1217 V[1] = grid.getValue(ijk.
offsetBy(0,0,2));
1218 V[2] = grid.getValue(ijk.
offsetBy(0,0,1));
1219 V[3] = grid.getValue(ijk);
1220 V[4] = grid.getValue(ijk.
offsetBy(0,0,-1));
1221 V[5] = grid.getValue(ijk.
offsetBy(0,0,-2));
1223 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1227 template<
typename Stencil>
1228 static typename Stencil::ValueType
inX(
const Stencil& S)
1231 return difference( S.template getValue< 3, 0, 0>(),
1232 S.template getValue< 2, 0, 0>(),
1233 S.template getValue< 1, 0, 0>(),
1234 S.template getValue< 0, 0, 0>(),
1235 S.template getValue<-1, 0, 0>(),
1236 S.template getValue<-2, 0, 0>() );
1240 template<
typename Stencil>
1241 static typename Stencil::ValueType
inY(
const Stencil& S)
1243 return difference( S.template getValue< 0, 3, 0>(),
1244 S.template getValue< 0, 2, 0>(),
1245 S.template getValue< 0, 1, 0>(),
1246 S.template getValue< 0, 0, 0>(),
1247 S.template getValue< 0,-1, 0>(),
1248 S.template getValue< 0,-2, 0>() );
1251 template<
typename Stencil>
1252 static typename Stencil::ValueType
inZ(
const Stencil& S)
1255 return difference( S.template getValue< 0, 0, 3>(),
1256 S.template getValue< 0, 0, 2>(),
1257 S.template getValue< 0, 0, 1>(),
1258 S.template getValue< 0, 0, 0>(),
1259 S.template getValue< 0, 0,-1>(),
1260 S.template getValue< 0, 0,-2>() );
1269 template<
typename ValueType>
1270 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
const ValueType& xm1,
1271 const ValueType& xm0,
const ValueType& xp1,
const ValueType& xp2) {
1277 template<
typename Accessor>
1278 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1280 typedef typename Accessor::ValueType ValueType;
1282 V[0] = grid.getValue(ijk.
offsetBy(-3,0,0));
1283 V[1] = grid.getValue(ijk.
offsetBy(-2,0,0));
1284 V[2] = grid.getValue(ijk.
offsetBy(-1,0,0));
1285 V[3] = grid.getValue(ijk);
1286 V[4] = grid.getValue(ijk.
offsetBy(1,0,0));
1287 V[5] = grid.getValue(ijk.
offsetBy(2,0,0));
1289 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1292 template<
typename Accessor>
1293 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1295 typedef typename Accessor::ValueType ValueType;
1297 V[0] = grid.getValue(ijk.
offsetBy(0,-3,0));
1298 V[1] = grid.getValue(ijk.
offsetBy(0,-2,0));
1299 V[2] = grid.getValue(ijk.
offsetBy(0,-1,0));
1300 V[3] = grid.getValue(ijk);
1301 V[4] = grid.getValue(ijk.
offsetBy(0,1,0));
1302 V[5] = grid.getValue(ijk.
offsetBy(0,2,0));
1304 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1307 template<
typename Accessor>
1308 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1310 typedef typename Accessor::ValueType ValueType;
1312 V[0] = grid.getValue(ijk.
offsetBy(0,0,-3));
1313 V[1] = grid.getValue(ijk.
offsetBy(0,0,-2));
1314 V[2] = grid.getValue(ijk.
offsetBy(0,0,-1));
1315 V[3] = grid.getValue(ijk);
1316 V[4] = grid.getValue(ijk.
offsetBy(0,0,1));
1317 V[5] = grid.getValue(ijk.
offsetBy(0,0,2));
1319 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1323 template<
typename Stencil>
1324 static typename Stencil::ValueType
inX(
const Stencil& S)
1326 typedef typename Stencil::ValueType ValueType;
1328 V[0] = S.template getValue<-3, 0, 0>();
1329 V[1] = S.template getValue<-2, 0, 0>();
1330 V[2] = S.template getValue<-1, 0, 0>();
1331 V[3] = S.template getValue< 0, 0, 0>();
1332 V[4] = S.template getValue< 1, 0, 0>();
1333 V[5] = S.template getValue< 2, 0, 0>();
1335 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1338 template<
typename Stencil>
1339 static typename Stencil::ValueType
inY(
const Stencil& S)
1341 typedef typename Stencil::ValueType ValueType;
1343 V[0] = S.template getValue< 0,-3, 0>();
1344 V[1] = S.template getValue< 0,-2, 0>();
1345 V[2] = S.template getValue< 0,-1, 0>();
1346 V[3] = S.template getValue< 0, 0, 0>();
1347 V[4] = S.template getValue< 0, 1, 0>();
1348 V[5] = S.template getValue< 0, 2, 0>();
1350 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1353 template<
typename Stencil>
1354 static typename Stencil::ValueType
inZ(
const Stencil& S)
1356 typedef typename Stencil::ValueType ValueType;
1358 V[0] = S.template getValue< 0, 0,-3>();
1359 V[1] = S.template getValue< 0, 0,-2>();
1360 V[2] = S.template getValue< 0, 0,-1>();
1361 V[3] = S.template getValue< 0, 0, 0>();
1362 V[4] = S.template getValue< 0, 0, 1>();
1363 V[5] = S.template getValue< 0, 0, 2>();
1365 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1373 template<
typename ValueType>
1374 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
const ValueType& xm1,
1375 const ValueType& xm0,
const ValueType& xp1,
const ValueType& xp2) {
1380 template<
typename Accessor>
1381 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1383 typedef typename Accessor::ValueType ValueType;
1385 V[0] = grid.getValue(ijk.
offsetBy(-3,0,0));
1386 V[1] = grid.getValue(ijk.
offsetBy(-2,0,0));
1387 V[2] = grid.getValue(ijk.
offsetBy(-1,0,0));
1388 V[3] = grid.getValue(ijk);
1389 V[4] = grid.getValue(ijk.
offsetBy(1,0,0));
1390 V[5] = grid.getValue(ijk.
offsetBy(2,0,0));
1392 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1395 template<
typename Accessor>
1396 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1398 typedef typename Accessor::ValueType ValueType;
1400 V[0] = grid.getValue(ijk.
offsetBy(0,-3,0));
1401 V[1] = grid.getValue(ijk.
offsetBy(0,-2,0));
1402 V[2] = grid.getValue(ijk.
offsetBy(0,-1,0));
1403 V[3] = grid.getValue(ijk);
1404 V[4] = grid.getValue(ijk.
offsetBy(0,1,0));
1405 V[5] = grid.getValue(ijk.
offsetBy(0,2,0));
1407 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1410 template<
typename Accessor>
1411 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1413 typedef typename Accessor::ValueType ValueType;
1415 V[0] = grid.getValue(ijk.
offsetBy(0,0,-3));
1416 V[1] = grid.getValue(ijk.
offsetBy(0,0,-2));
1417 V[2] = grid.getValue(ijk.
offsetBy(0,0,-1));
1418 V[3] = grid.getValue(ijk);
1419 V[4] = grid.getValue(ijk.
offsetBy(0,0,1));
1420 V[5] = grid.getValue(ijk.
offsetBy(0,0,2));
1422 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1426 template<
typename Stencil>
1427 static typename Stencil::ValueType
inX(
const Stencil& S)
1429 typedef typename Stencil::ValueType ValueType;
1431 V[0] = S.template getValue<-3, 0, 0>();
1432 V[1] = S.template getValue<-2, 0, 0>();
1433 V[2] = S.template getValue<-1, 0, 0>();
1434 V[3] = S.template getValue< 0, 0, 0>();
1435 V[4] = S.template getValue< 1, 0, 0>();
1436 V[5] = S.template getValue< 2, 0, 0>();
1438 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1441 template<
typename Stencil>
1442 static typename Stencil::ValueType
inY(
const Stencil& S)
1444 typedef typename Stencil::ValueType ValueType;
1446 V[0] = S.template getValue< 0,-3, 0>();
1447 V[1] = S.template getValue< 0,-2, 0>();
1448 V[2] = S.template getValue< 0,-1, 0>();
1449 V[3] = S.template getValue< 0, 0, 0>();
1450 V[4] = S.template getValue< 0, 1, 0>();
1451 V[5] = S.template getValue< 0, 2, 0>();
1453 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1456 template<
typename Stencil>
1457 static typename Stencil::ValueType
inZ(
const Stencil& S)
1459 typedef typename Stencil::ValueType ValueType;
1461 V[0] = S.template getValue< 0, 0,-3>();
1462 V[1] = S.template getValue< 0, 0,-2>();
1463 V[2] = S.template getValue< 0, 0,-1>();
1464 V[3] = S.template getValue< 0, 0, 0>();
1465 V[4] = S.template getValue< 0, 0, 1>();
1466 V[5] = S.template getValue< 0, 0, 2>();
1468 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1473 template<DScheme DiffScheme>
1477 template<
typename Accessor>
1478 static typename Accessor::ValueType::value_type
inX(
const Accessor& grid,
const Coord& ijk,
int n)
1483 template<
typename Accessor>
1484 static typename Accessor::ValueType::value_type
inY(
const Accessor& grid,
const Coord& ijk,
int n)
1488 template<
typename Accessor>
1489 static typename Accessor::ValueType::value_type
inZ(
const Accessor& grid,
const Coord& ijk,
int n)
1496 template<
typename Stencil>
1497 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1502 template<
typename Stencil>
1503 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1508 template<
typename Stencil>
1509 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1521 template<
typename Accessor>
1522 static typename Accessor::ValueType::value_type
inX(
const Accessor& grid,
const Coord& ijk,
int n)
1525 grid.getValue(ijk.
offsetBy(-1, 0, 0))[n] );
1528 template<
typename Accessor>
1529 static typename Accessor::ValueType::value_type
inY(
const Accessor& grid,
const Coord& ijk,
int n)
1532 grid.getValue(ijk.
offsetBy(0,-1, 0))[n] );
1535 template<
typename Accessor>
1536 static typename Accessor::ValueType::value_type
inZ(
const Accessor& grid,
const Coord& ijk,
int n)
1539 grid.getValue(ijk.
offsetBy(0, 0,-1))[n] );
1543 template<
typename Stencil>
1544 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1547 S.template getValue<-1, 0, 0>()[n] );
1550 template<
typename Stencil>
1551 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1554 S.template getValue< 0,-1, 0>()[n] );
1557 template<
typename Stencil>
1558 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1561 S.template getValue< 0, 0,-1>()[n] );
1570 template<
typename Accessor>
1571 static typename Accessor::ValueType::value_type
inX(
const Accessor& grid,
const Coord& ijk,
int n)
1574 grid.getValue(ijk.
offsetBy(-1, 0, 0))[n] );
1577 template<
typename Accessor>
1578 static typename Accessor::ValueType::value_type
inY(
const Accessor& grid,
const Coord& ijk,
int n)
1581 grid.getValue(ijk.
offsetBy(0,-1, 0))[n] );
1584 template<
typename Accessor>
1585 static typename Accessor::ValueType::value_type
inZ(
const Accessor& grid,
const Coord& ijk,
int n)
1588 grid.getValue(ijk.
offsetBy(0, 0,-1))[n] );
1593 template<
typename Stencil>
1594 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1597 S.template getValue<-1, 0, 0>()[n] );
1600 template<
typename Stencil>
1601 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1604 S.template getValue< 0,-1, 0>()[n] );
1607 template<
typename Stencil>
1608 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1611 S.template getValue< 0, 0,-1>()[n] );
1622 template<
typename Accessor>
1623 static typename Accessor::ValueType::value_type
inX(
const Accessor& grid,
const Coord& ijk,
int n) {
1625 grid.getValue(ijk.
offsetBy(-1,0, 0))[n], grid.getValue(ijk.
offsetBy(-2, 0, 0))[n]);
1628 template<
typename Accessor>
1629 static typename Accessor::ValueType::value_type
inY(
const Accessor& grid,
const Coord& ijk,
int n) {
1631 grid.getValue(ijk.
offsetBy( 0,-1, 0))[n], grid.getValue(ijk.
offsetBy( 0,-2, 0))[n]);
1634 template<
typename Accessor>
1635 static typename Accessor::ValueType::value_type
inZ(
const Accessor& grid,
const Coord& ijk,
int n) {
1637 grid.getValue(ijk.
offsetBy(0,0,-1))[n], grid.getValue(ijk.
offsetBy( 0, 0,-2))[n]);
1641 template<
typename Stencil>
1642 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n) {
1644 S.template getValue<-1, 0, 0>()[n], S.template getValue<-2, 0, 0>()[n] );
1647 template<
typename Stencil>
1648 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n) {
1650 S.template getValue< 0,-1, 0>()[n], S.template getValue< 0,-2, 0>()[n]);
1653 template<
typename Stencil>
1654 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n) {
1656 S.template getValue< 0, 0,-1>()[n], S.template getValue< 0, 0,-2>()[n]);
1666 template<
typename Accessor>
1667 static typename Accessor::ValueType::value_type
inX(
const Accessor& grid,
const Coord& ijk,
int n)
1670 grid.getValue(ijk.
offsetBy( 1, 0, 0))[n], grid.getValue(ijk.
offsetBy(-1, 0, 0))[n],
1671 grid.getValue(ijk.
offsetBy(-2, 0, 0))[n], grid.getValue(ijk.
offsetBy(-3, 0, 0))[n] );
1674 template<
typename Accessor>
1675 static typename Accessor::ValueType::value_type
inY(
const Accessor& grid,
const Coord& ijk,
int n)
1679 grid.getValue(ijk.
offsetBy( 0, 1, 0))[n], grid.getValue(ijk.
offsetBy( 0,-1, 0))[n],
1680 grid.getValue(ijk.
offsetBy( 0,-2, 0))[n], grid.getValue(ijk.
offsetBy( 0,-3, 0))[n] );
1683 template<
typename Accessor>
1684 static typename Accessor::ValueType::value_type
inZ(
const Accessor& grid,
const Coord& ijk,
int n)
1688 grid.getValue(ijk.
offsetBy( 0, 0, 1))[n], grid.getValue(ijk.
offsetBy( 0, 0,-1))[n],
1689 grid.getValue(ijk.
offsetBy( 0, 0,-2))[n], grid.getValue(ijk.
offsetBy( 0, 0,-3))[n] );
1694 template<
typename Stencil>
1695 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1698 S.template getValue< 1, 0, 0>()[n], S.template getValue<-1, 0, 0>()[n],
1699 S.template getValue<-2, 0, 0>()[n], S.template getValue<-3, 0, 0>()[n] );
1702 template<
typename Stencil>
1703 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1706 S.template getValue< 0, 1, 0>()[n], S.template getValue< 0,-1, 0>()[n],
1707 S.template getValue< 0,-2, 0>()[n], S.template getValue< 0,-3, 0>()[n] );
1710 template<
typename Stencil>
1711 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1714 S.template getValue< 0, 0, 1>()[n], S.template getValue< 0, 0,-1>()[n],
1715 S.template getValue< 0, 0,-2>()[n], S.template getValue< 0, 0,-3>()[n] );
1719 template<DDScheme DiffScheme>
1723 template<
typename Accessor>
1724 static typename Accessor::ValueType inX(
const Accessor& grid,
const Coord& ijk);
1725 template<
typename Accessor>
1726 static typename Accessor::ValueType inY(
const Accessor& grid,
const Coord& ijk);
1727 template<
typename Accessor>
1728 static typename Accessor::ValueType inZ(
const Accessor& grid,
const Coord& ijk);
1731 template<
typename Accessor>
1732 static typename Accessor::ValueType inXandY(
const Accessor& grid,
const Coord& ijk);
1734 template<
typename Accessor>
1735 static typename Accessor::ValueType inXandZ(
const Accessor& grid,
const Coord& ijk);
1737 template<
typename Accessor>
1738 static typename Accessor::ValueType inYandZ(
const Accessor& grid,
const Coord& ijk);
1742 template<
typename Stencil>
1743 static typename Stencil::ValueType inX(
const Stencil& S);
1744 template<
typename Stencil>
1745 static typename Stencil::ValueType inY(
const Stencil& S);
1746 template<
typename Stencil>
1747 static typename Stencil::ValueType inZ(
const Stencil& S);
1750 template<
typename Stencil>
1751 static typename Stencil::ValueType inXandY(
const Stencil& S);
1753 template<
typename Stencil>
1754 static typename Stencil::ValueType inXandZ(
const Stencil& S);
1756 template<
typename Stencil>
1757 static typename Stencil::ValueType inYandZ(
const Stencil& S);
1765 template <
typename ValueType>
1766 static ValueType
difference(
const ValueType& xp1,
const ValueType& xp0,
const ValueType& xm1) {
1767 return xp1 + xm1 - ValueType(2)*xp0;
1770 template <
typename ValueType>
1772 const ValueType& xmyp,
const ValueType& xmym) {
1773 return ValueType(0.25)*(xpyp + xmym - xpym - xmyp);
1777 template<
typename Accessor>
1778 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1780 return difference( grid.getValue(ijk.
offsetBy( 1,0,0)), grid.getValue(ijk),
1781 grid.getValue(ijk.
offsetBy(-1,0,0)) );
1784 template<
typename Accessor>
1785 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1788 return difference( grid.getValue(ijk.
offsetBy(0, 1,0)), grid.getValue(ijk),
1789 grid.getValue(ijk.
offsetBy(0,-1,0)) );
1792 template<
typename Accessor>
1793 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1795 return difference( grid.getValue(ijk.
offsetBy( 0,0, 1)), grid.getValue(ijk),
1796 grid.getValue(ijk.
offsetBy( 0,0,-1)) );
1800 template<
typename Accessor>
1801 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
1803 return crossdifference(grid.getValue(ijk.
offsetBy(1, 1,0)), grid.getValue(ijk.
offsetBy( 1,-1,0)),
1804 grid.getValue(ijk.
offsetBy(-1,1,0)), grid.getValue(ijk.
offsetBy(-1,-1,0)));
1808 template<
typename Accessor>
1809 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
1811 return crossdifference(grid.getValue(ijk.
offsetBy(1,0, 1)), grid.getValue(ijk.
offsetBy(1, 0,-1)),
1812 grid.getValue(ijk.
offsetBy(-1,0,1)), grid.getValue(ijk.
offsetBy(-1,0,-1)) );
1815 template<
typename Accessor>
1816 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
1818 return crossdifference(grid.getValue(ijk.
offsetBy(0, 1,1)), grid.getValue(ijk.
offsetBy(0, 1,-1)),
1819 grid.getValue(ijk.
offsetBy(0,-1,1)), grid.getValue(ijk.
offsetBy(0,-1,-1)) );
1824 template<
typename Stencil>
1825 static typename Stencil::ValueType
inX(
const Stencil& S)
1827 return difference( S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>(),
1828 S.template getValue<-1, 0, 0>() );
1831 template<
typename Stencil>
1832 static typename Stencil::ValueType
inY(
const Stencil& S)
1834 return difference( S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>(),
1835 S.template getValue< 0,-1, 0>() );
1838 template<
typename Stencil>
1839 static typename Stencil::ValueType
inZ(
const Stencil& S)
1841 return difference( S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>(),
1842 S.template getValue< 0, 0,-1>() );
1846 template<
typename Stencil>
1847 static typename Stencil::ValueType
inXandY(
const Stencil& S)
1849 return crossdifference(S.template getValue< 1, 1, 0>(), S.template getValue< 1,-1, 0>(),
1850 S.template getValue<-1, 1, 0>(), S.template getValue<-1,-1, 0>() );
1853 template<
typename Stencil>
1854 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
1856 return crossdifference(S.template getValue< 1, 0, 1>(), S.template getValue< 1, 0,-1>(),
1857 S.template getValue<-1, 0, 1>(), S.template getValue<-1, 0,-1>() );
1860 template<
typename Stencil>
1861 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
1863 return crossdifference(S.template getValue< 0, 1, 1>(), S.template getValue< 0, 1,-1>(),
1864 S.template getValue< 0,-1, 1>(), S.template getValue< 0,-1,-1>() );
1874 template <
typename ValueType>
1875 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
const ValueType& xp0,
1876 const ValueType& xm1,
const ValueType& xm2) {
1877 return ValueType(-1./12.)*(xp2 + xm2) + ValueType(4./3.)*(xp1 + xm1) -ValueType(2.5)*xp0;
1880 template <
typename ValueType>
1882 const ValueType& xp2ym1,
const ValueType& xp2ym2,
1883 const ValueType& xp1yp2,
const ValueType& xp1yp1,
1884 const ValueType& xp1ym1,
const ValueType& xp1ym2,
1885 const ValueType& xm2yp2,
const ValueType& xm2yp1,
1886 const ValueType& xm2ym1,
const ValueType& xm2ym2,
1887 const ValueType& xm1yp2,
const ValueType& xm1yp1,
1888 const ValueType& xm1ym1,
const ValueType& xm1ym2 ) {
1890 ValueType(2./3.0)*(xp1yp1 - xm1yp1 - xp1ym1 + xm1ym1)-
1891 ValueType(1./12.)*(xp2yp1 - xm2yp1 - xp2ym1 + xm2ym1);
1893 ValueType(2./3.0)*(xp1yp2 - xm1yp2 - xp1ym2 + xm1ym2)-
1894 ValueType(1./12.)*(xp2yp2 - xm2yp2 - xp2ym2 + xm2ym2);
1896 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
1902 template<
typename Accessor>
1903 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1905 return difference(grid.getValue(ijk.
offsetBy(2,0,0)), grid.getValue(ijk.
offsetBy( 1,0,0)),
1907 grid.getValue(ijk.
offsetBy(-1,0,0)), grid.getValue(ijk.
offsetBy(-2, 0, 0)));
1910 template<
typename Accessor>
1911 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1913 return difference(grid.getValue(ijk.
offsetBy(0, 2,0)), grid.getValue(ijk.
offsetBy(0, 1,0)),
1915 grid.getValue(ijk.
offsetBy(0,-1,0)), grid.getValue(ijk.
offsetBy(0,-2, 0)));
1918 template<
typename Accessor>
1919 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1921 return difference(grid.getValue(ijk.
offsetBy(0,0, 2)), grid.getValue(ijk.
offsetBy(0, 0,1)),
1927 template<
typename Accessor>
1928 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
1930 typedef typename Accessor::ValueType ValueType;
1931 typename Accessor::ValueType tmp1 =
1934 typename Accessor::ValueType tmp2 =
1937 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
1940 template<
typename Accessor>
1941 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
1943 typedef typename Accessor::ValueType ValueType;
1944 typename Accessor::ValueType tmp1 =
1947 typename Accessor::ValueType tmp2 =
1950 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
1953 template<
typename Accessor>
1954 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
1956 typedef typename Accessor::ValueType ValueType;
1957 typename Accessor::ValueType tmp1 =
1960 typename Accessor::ValueType tmp2 =
1963 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
1968 template<
typename Stencil>
1969 static typename Stencil::ValueType
inX(
const Stencil& S)
1971 return difference(S.template getValue< 2, 0, 0>(), S.template getValue< 1, 0, 0>(),
1972 S.template getValue< 0, 0, 0>(),
1973 S.template getValue<-1, 0, 0>(), S.template getValue<-2, 0, 0>() );
1976 template<
typename Stencil>
1977 static typename Stencil::ValueType
inY(
const Stencil& S)
1979 return difference(S.template getValue< 0, 2, 0>(), S.template getValue< 0, 1, 0>(),
1980 S.template getValue< 0, 0, 0>(),
1981 S.template getValue< 0,-1, 0>(), S.template getValue< 0,-2, 0>() );
1984 template<
typename Stencil>
1985 static typename Stencil::ValueType
inZ(
const Stencil& S)
1987 return difference(S.template getValue< 0, 0, 2>(), S.template getValue< 0, 0, 1>(),
1988 S.template getValue< 0, 0, 0>(),
1989 S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0,-2>() );
1993 template<
typename Stencil>
1994 static typename Stencil::ValueType
inXandY(
const Stencil& S)
1996 return crossdifference( S.template getValue< 2, 2, 0>(), S.template getValue< 2, 1, 0>(),
1997 S.template getValue< 2,-1, 0>(), S.template getValue< 2,-2, 0>(),
1998 S.template getValue< 1, 2, 0>(), S.template getValue< 1, 1, 0>(),
1999 S.template getValue< 1,-1, 0>(), S.template getValue< 1,-2, 0>(),
2000 S.template getValue<-2, 2, 0>(), S.template getValue<-2, 1, 0>(),
2001 S.template getValue<-2,-1, 0>(), S.template getValue<-2,-2, 0>(),
2002 S.template getValue<-1, 2, 0>(), S.template getValue<-1, 1, 0>(),
2003 S.template getValue<-1,-1, 0>(), S.template getValue<-1,-2, 0>() );
2006 template<
typename Stencil>
2007 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
2009 return crossdifference( S.template getValue< 2, 0, 2>(), S.template getValue< 2, 0, 1>(),
2010 S.template getValue< 2, 0,-1>(), S.template getValue< 2, 0,-2>(),
2011 S.template getValue< 1, 0, 2>(), S.template getValue< 1, 0, 1>(),
2012 S.template getValue< 1, 0,-1>(), S.template getValue< 1, 0,-2>(),
2013 S.template getValue<-2, 0, 2>(), S.template getValue<-2, 0, 1>(),
2014 S.template getValue<-2, 0,-1>(), S.template getValue<-2, 0,-2>(),
2015 S.template getValue<-1, 0, 2>(), S.template getValue<-1, 0, 1>(),
2016 S.template getValue<-1, 0,-1>(), S.template getValue<-1, 0,-2>() );
2019 template<
typename Stencil>
2020 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
2022 return crossdifference( S.template getValue< 0, 2, 2>(), S.template getValue< 0, 2, 1>(),
2023 S.template getValue< 0, 2,-1>(), S.template getValue< 0, 2,-2>(),
2024 S.template getValue< 0, 1, 2>(), S.template getValue< 0, 1, 1>(),
2025 S.template getValue< 0, 1,-1>(), S.template getValue< 0, 1,-2>(),
2026 S.template getValue< 0,-2, 2>(), S.template getValue< 0,-2, 1>(),
2027 S.template getValue< 0,-2,-1>(), S.template getValue< 0,-2,-2>(),
2028 S.template getValue< 0,-1, 2>(), S.template getValue< 0,-1, 1>(),
2029 S.template getValue< 0,-1,-1>(), S.template getValue< 0,-1,-2>() );
2041 template <
typename ValueType>
2042 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
const ValueType& xp1,
2043 const ValueType& xp0,
2044 const ValueType& xm1,
const ValueType& xm2,
const ValueType& xm3) {
2045 return ValueType(1./90.)*(xp3 + xm3) - ValueType(3./20.)*(xp2 + xm2)
2046 + ValueType(1.5)*(xp1 + xm1) - ValueType(49./18.)*xp0;
2049 template <
typename ValueType>
2051 const ValueType& xp1ym1,
const ValueType& xm1ym1,
2052 const ValueType& xp2yp1,
const ValueType& xm2yp1,
2053 const ValueType& xp2ym1,
const ValueType& xm2ym1,
2054 const ValueType& xp3yp1,
const ValueType& xm3yp1,
2055 const ValueType& xp3ym1,
const ValueType& xm3ym1,
2056 const ValueType& xp1yp2,
const ValueType& xm1yp2,
2057 const ValueType& xp1ym2,
const ValueType& xm1ym2,
2058 const ValueType& xp2yp2,
const ValueType& xm2yp2,
2059 const ValueType& xp2ym2,
const ValueType& xm2ym2,
2060 const ValueType& xp3yp2,
const ValueType& xm3yp2,
2061 const ValueType& xp3ym2,
const ValueType& xm3ym2,
2062 const ValueType& xp1yp3,
const ValueType& xm1yp3,
2063 const ValueType& xp1ym3,
const ValueType& xm1ym3,
2064 const ValueType& xp2yp3,
const ValueType& xm2yp3,
2065 const ValueType& xp2ym3,
const ValueType& xm2ym3,
2066 const ValueType& xp3yp3,
const ValueType& xm3yp3,
2067 const ValueType& xp3ym3,
const ValueType& xm3ym3 )
2070 ValueType(0.7500)*(xp1yp1 - xm1yp1 - xp1ym1 + xm1ym1) -
2071 ValueType(0.1500)*(xp2yp1 - xm2yp1 - xp2ym1 + xm2ym1) +
2072 ValueType(1./60.)*(xp3yp1 - xm3yp1 - xp3ym1 + xm3ym1);
2075 ValueType(0.7500)*(xp1yp2 - xm1yp2 - xp1ym2 + xm1ym2) -
2076 ValueType(0.1500)*(xp2yp2 - xm2yp2 - xp2ym2 + xm2ym2) +
2077 ValueType(1./60.)*(xp3yp2 - xm3yp2 - xp3ym2 + xm3ym2);
2080 ValueType(0.7500)*(xp1yp3 - xm1yp3 - xp1ym3 + xm1ym3) -
2081 ValueType(0.1500)*(xp2yp3 - xm2yp3 - xp2ym3 + xm2ym3) +
2082 ValueType(1./60.)*(xp3yp3 - xm3yp3 - xp3ym3 + xm3ym3);
2084 return ValueType(0.75)*tmp1 - ValueType(0.15)*tmp2 + ValueType(1./60)*tmp3;
2089 template<
typename Accessor>
2090 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
2092 return difference(grid.getValue(ijk.
offsetBy( 3, 0, 0)), grid.getValue(ijk.
offsetBy( 2, 0, 0)),
2093 grid.getValue(ijk.
offsetBy( 1, 0, 0)), grid.getValue(ijk),
2094 grid.getValue(ijk.
offsetBy(-1, 0, 0)), grid.getValue(ijk.
offsetBy(-2, 0, 0)),
2095 grid.getValue(ijk.
offsetBy(-3, 0, 0)) );
2099 template<
typename Accessor>
2100 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
2103 return difference(grid.getValue(ijk.
offsetBy( 0, 3, 0)), grid.getValue(ijk.
offsetBy( 0, 2, 0)),
2104 grid.getValue(ijk.
offsetBy( 0, 1, 0)), grid.getValue(ijk),
2105 grid.getValue(ijk.
offsetBy( 0,-1, 0)), grid.getValue(ijk.
offsetBy( 0,-2, 0)),
2106 grid.getValue(ijk.
offsetBy( 0,-3, 0)) );
2110 template<
typename Accessor>
2111 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
2114 return difference(grid.getValue(ijk.
offsetBy( 0, 0, 3)), grid.getValue(ijk.
offsetBy( 0, 0, 2)),
2115 grid.getValue(ijk.
offsetBy( 0, 0, 1)), grid.getValue(ijk),
2116 grid.getValue(ijk.
offsetBy( 0, 0,-1)), grid.getValue(ijk.
offsetBy( 0, 0,-2)),
2117 grid.getValue(ijk.
offsetBy( 0, 0,-3)) );
2121 template<
typename Accessor>
2122 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
2124 typename Accessor::ValueType tmp1 =
2127 typename Accessor::ValueType tmp2 =
2130 typename Accessor::ValueType tmp3 =
2133 return 0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3;
2136 template<
typename Accessor>
2137 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
2139 typename Accessor::ValueType tmp1 =
2142 typename Accessor::ValueType tmp2 =
2145 typename Accessor::ValueType tmp3 =
2148 return 0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3;
2151 template<
typename Accessor>
2152 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
2154 typename Accessor::ValueType tmp1 =
2157 typename Accessor::ValueType tmp2 =
2160 typename Accessor::ValueType tmp3 =
2163 return 0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3;
2168 template<
typename Stencil>
2169 static typename Stencil::ValueType
inX(
const Stencil& S)
2171 return difference( S.template getValue< 3, 0, 0>(), S.template getValue< 2, 0, 0>(),
2172 S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>(),
2173 S.template getValue<-1, 0, 0>(), S.template getValue<-2, 0, 0>(),
2174 S.template getValue<-3, 0, 0>() );
2177 template<
typename Stencil>
2178 static typename Stencil::ValueType
inY(
const Stencil& S)
2180 return difference( S.template getValue< 0, 3, 0>(), S.template getValue< 0, 2, 0>(),
2181 S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>(),
2182 S.template getValue< 0,-1, 0>(), S.template getValue< 0,-2, 0>(),
2183 S.template getValue< 0,-3, 0>() );
2187 template<
typename Stencil>
2188 static typename Stencil::ValueType
inZ(
const Stencil& S)
2190 return difference( S.template getValue< 0, 0, 3>(), S.template getValue< 0, 0, 2>(),
2191 S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>(),
2192 S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0,-2>(),
2193 S.template getValue< 0, 0,-3>() );
2196 template<
typename Stencil>
2197 static typename Stencil::ValueType
inXandY(
const Stencil& S)
2199 return crossdifference( S.template getValue< 1, 1, 0>(), S.template getValue<-1, 1, 0>(),
2200 S.template getValue< 1,-1, 0>(), S.template getValue<-1,-1, 0>(),
2201 S.template getValue< 2, 1, 0>(), S.template getValue<-2, 1, 0>(),
2202 S.template getValue< 2,-1, 0>(), S.template getValue<-2,-1, 0>(),
2203 S.template getValue< 3, 1, 0>(), S.template getValue<-3, 1, 0>(),
2204 S.template getValue< 3,-1, 0>(), S.template getValue<-3,-1, 0>(),
2205 S.template getValue< 1, 2, 0>(), S.template getValue<-1, 2, 0>(),
2206 S.template getValue< 1,-2, 0>(), S.template getValue<-1,-2, 0>(),
2207 S.template getValue< 2, 2, 0>(), S.template getValue<-2, 2, 0>(),
2208 S.template getValue< 2,-2, 0>(), S.template getValue<-2,-2, 0>(),
2209 S.template getValue< 3, 2, 0>(), S.template getValue<-3, 2, 0>(),
2210 S.template getValue< 3,-2, 0>(), S.template getValue<-3,-2, 0>(),
2211 S.template getValue< 1, 3, 0>(), S.template getValue<-1, 3, 0>(),
2212 S.template getValue< 1,-3, 0>(), S.template getValue<-1,-3, 0>(),
2213 S.template getValue< 2, 3, 0>(), S.template getValue<-2, 3, 0>(),
2214 S.template getValue< 2,-3, 0>(), S.template getValue<-2,-3, 0>(),
2215 S.template getValue< 3, 3, 0>(), S.template getValue<-3, 3, 0>(),
2216 S.template getValue< 3,-3, 0>(), S.template getValue<-3,-3, 0>() );
2220 template<
typename Stencil>
2221 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
2223 return crossdifference( S.template getValue< 1, 0, 1>(), S.template getValue<-1, 0, 1>(),
2224 S.template getValue< 1, 0,-1>(), S.template getValue<-1, 0,-1>(),
2225 S.template getValue< 2, 0, 1>(), S.template getValue<-2, 0, 1>(),
2226 S.template getValue< 2, 0,-1>(), S.template getValue<-2, 0,-1>(),
2227 S.template getValue< 3, 0, 1>(), S.template getValue<-3, 0, 1>(),
2228 S.template getValue< 3, 0,-1>(), S.template getValue<-3, 0,-1>(),
2229 S.template getValue< 1, 0, 2>(), S.template getValue<-1, 0, 2>(),
2230 S.template getValue< 1, 0,-2>(), S.template getValue<-1, 0,-2>(),
2231 S.template getValue< 2, 0, 2>(), S.template getValue<-2, 0, 2>(),
2232 S.template getValue< 2, 0,-2>(), S.template getValue<-2, 0,-2>(),
2233 S.template getValue< 3, 0, 2>(), S.template getValue<-3, 0, 2>(),
2234 S.template getValue< 3, 0,-2>(), S.template getValue<-3, 0,-2>(),
2235 S.template getValue< 1, 0, 3>(), S.template getValue<-1, 0, 3>(),
2236 S.template getValue< 1, 0,-3>(), S.template getValue<-1, 0,-3>(),
2237 S.template getValue< 2, 0, 3>(), S.template getValue<-2, 0, 3>(),
2238 S.template getValue< 2, 0,-3>(), S.template getValue<-2, 0,-3>(),
2239 S.template getValue< 3, 0, 3>(), S.template getValue<-3, 0, 3>(),
2240 S.template getValue< 3, 0,-3>(), S.template getValue<-3, 0,-3>() );
2244 template<
typename Stencil>
2245 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
2247 return crossdifference( S.template getValue< 0, 1, 1>(), S.template getValue< 0,-1, 1>(),
2248 S.template getValue< 0, 1,-1>(), S.template getValue< 0,-1,-1>(),
2249 S.template getValue< 0, 2, 1>(), S.template getValue< 0,-2, 1>(),
2250 S.template getValue< 0, 2,-1>(), S.template getValue< 0,-2,-1>(),
2251 S.template getValue< 0, 3, 1>(), S.template getValue< 0,-3, 1>(),
2252 S.template getValue< 0, 3,-1>(), S.template getValue< 0,-3,-1>(),
2253 S.template getValue< 0, 1, 2>(), S.template getValue< 0,-1, 2>(),
2254 S.template getValue< 0, 1,-2>(), S.template getValue< 0,-1,-2>(),
2255 S.template getValue< 0, 2, 2>(), S.template getValue< 0,-2, 2>(),
2256 S.template getValue< 0, 2,-2>(), S.template getValue< 0,-2,-2>(),
2257 S.template getValue< 0, 3, 2>(), S.template getValue< 0,-3, 2>(),
2258 S.template getValue< 0, 3,-2>(), S.template getValue< 0,-3,-2>(),
2259 S.template getValue< 0, 1, 3>(), S.template getValue< 0,-1, 3>(),
2260 S.template getValue< 0, 1,-3>(), S.template getValue< 0,-1,-3>(),
2261 S.template getValue< 0, 2, 3>(), S.template getValue< 0,-2, 3>(),
2262 S.template getValue< 0, 2,-3>(), S.template getValue< 0,-2,-3>(),
2263 S.template getValue< 0, 3, 3>(), S.template getValue< 0,-3, 3>(),
2264 S.template getValue< 0, 3,-3>(), S.template getValue< 0,-3,-3>() );
2273 #endif // OPENVDB_MATH_FINITEDIFFERENCE_HAS_BEEN_INCLUDED
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:623
Real GudonovsNormSqrd(bool isOutside, Real dP_xm, Real dP_xp, Real dP_ym, Real dP_yp, Real dP_zm, Real dP_zp)
Definition: FiniteDifference.h:351
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1503
static ValueType difference(const ValueType &xp1, const ValueType &xm1)
Definition: FiniteDifference.h:516
Definition: FiniteDifference.h:77
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1293
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:771
Definition: FiniteDifference.h:196
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:848
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1629
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1131
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1497
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2111
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:662
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:783
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:492
TemporalIntegrationScheme
Temporal integrations schemes.
Definition: FiniteDifference.h:261
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:912
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1339
Definition: FiniteDifference.h:61
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:745
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:1994
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:535
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:799
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1536
Definition: FiniteDifference.h:184
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:694
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:479
Definition: FiniteDifference.h:68
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:671
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:726
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1032
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1594
Definition: FiniteDifference.h:265
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1675
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1197
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1115
Definition: FiniteDifference.h:262
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:968
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1427
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:2245
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:543
TemporalIntegrationScheme stringToTemporalIntegrationScheme(const std::string &s)
Definition: FiniteDifference.h:284
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1809
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:839
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0, const ValueType &xp1, const ValueType &xp2)
Definition: FiniteDifference.h:1374
Definition: FiniteDifference.h:62
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:977
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:473
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2090
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1100
static ValueType difference(const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:893
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:646
Definition: FiniteDifference.h:264
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:605
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1051
Definition: FiniteDifference.h:263
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1785
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1977
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:906
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:932
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:2007
std::string temporalIntegrationSchemeToMenuName(TemporalIntegrationScheme tis)
Definition: FiniteDifference.h:304
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:614
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1954
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:556
Type Pow2(Type x)
Return .
Definition: Math.h:467
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0, const ValueType &xp1, const ValueType &xp2)
Definition: FiniteDifference.h:1270
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:1847
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2137
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:570
Definition: FiniteDifference.h:179
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1014
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1023
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:523
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2100
DDScheme
Different discrete schemes used in the second derivatives.
Definition: FiniteDifference.h:177
BiasedGradientScheme stringToBiasedGradientScheme(const std::string &s)
Definition: FiniteDifference.h:219
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:791
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:920
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:578
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:549
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:952
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1075
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1601
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1985
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:993
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1155
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:682
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:2042
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
Definition: FiniteDifference.h:198
static ValueType difference(const ValueType &xp1, const ValueType &xm1)
Definition: FiniteDifference.h:467
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1173
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1060
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1522
Definition: FiniteDifference.h:60
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:498
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:1854
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:926
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1703
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:985
Definition: FiniteDifference.h:70
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1642
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2122
std::string biasedGradientSchemeToMenuName(BiasedGradientScheme bgs)
Definition: FiniteDifference.h:242
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:739
Definition: FiniteDifference.h:201
Definition: FiniteDifference.h:71
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:1861
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1478
Definition: FiniteDifference.h:1474
#define OPENVDB_VERSION_NAME
Definition: version.h:45
static ValueType difference(const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:713
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:47
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:764
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1558
Definition: FiniteDifference.h:181
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:2188
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:720
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1144
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1648
Definition: FiniteDifference.h:67
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:777
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1695
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1484
Definition: FiniteDifference.h:193
Definition: FiniteDifference.h:63
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1252
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:504
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1212
Definition: FiniteDifference.h:439
Definition: FiniteDifference.h:65
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1489
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:751
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1354
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1667
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1308
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1911
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1578
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1816
Definition: FiniteDifference.h:72
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1839
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:960
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:586
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1085
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:529
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1509
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1324
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:807
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1623
std::string dsSchemeToString(DScheme dss)
Definition: FiniteDifference.h:81
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1941
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1442
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1654
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:2050
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:2178
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:877
double Real
Definition: Types.h:62
Definition: FiniteDifference.h:73
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:2020
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1457
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:654
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1825
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1411
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1919
const Type & Min(const Type &a, const Type &b)
Return the minimum of two values.
Definition: Math.h:575
std::string dsSchemeToMenuName(DScheme dss)
Definition: FiniteDifference.h:147
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1778
Definition: FiniteDifference.h:180
Definition: FiniteDifference.h:1720
static ValueType difference(const ValueType &xp1, const ValueType &xp0, const ValueType &xm1)
Definition: FiniteDifference.h:1766
Definition: FiniteDifference.h:74
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1181
Definition: FiniteDifference.h:268
ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, float scale2=0.01)
implimentation of nonimally fith-order finite-difference WENO. This function returns the numerical fl...
Definition: FiniteDifference.h:331
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1711
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1608
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1903
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:900
std::string biasedGradientSchemeToString(BiasedGradientScheme bgs)
Definition: FiniteDifference.h:204
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1551
Definition: FiniteDifference.h:66
Definition: FiniteDifference.h:195
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1529
std::string temporalIntegrationSchemeToString(TemporalIntegrationScheme tis)
Definition: FiniteDifference.h:271
DScheme stringToDScheme(const std::string &s)
Definition: FiniteDifference.h:105
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1278
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1969
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1544
BiasedGradientScheme
Biased Gradients are limited to non-centered differences.
Definition: FiniteDifference.h:192
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:102
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1635
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:2197
static ValueType crossdifference(const ValueType &xpyp, const ValueType &xpym, const ValueType &xmyp, const ValueType &xmym)
Definition: FiniteDifference.h:1771
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1241
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1832
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
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:1881
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1928
Definition: FiniteDifference.h:178
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1042
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1801
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1875
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:868
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:823
Definition: FiniteDifference.h:64
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1381
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xm1, const ValueType &xm2, const ValueType &xm3)
Definition: FiniteDifference.h:638
Definition: FiniteDifference.h:197
Definition: FiniteDifference.h:69
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1684
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1585
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1396
const Type & Max(const Type &a, const Type &b)
Return the maximum of two values.
Definition: Math.h:514
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:485
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:595
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:2169
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2152
Definition: FiniteDifference.h:194
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:732
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1793
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:1008
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1228
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1571
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:859
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:2221
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:830
static ValueType difference(const ValueType &xm2, const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:945