33 #ifndef OPENVDB_MATH_FINITEDIFFERENCE_HAS_BEEN_INCLUDED 34 #define OPENVDB_MATH_FINITEDIFFERENCE_HAS_BEEN_INCLUDED 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.01f)
334 const double C = 13.0 / 12.0;
339 const double eps = 1.0e-6 * static_cast<double>(scale2);
345 return static_cast<ValueType>(static_cast<ValueType>(
346 A1*(2.0*v1 - 7.0*v2 + 11.0*v3) +
347 A2*(5.0*v3 - v2 + 2.0*v4) +
348 A3*(2.0*v3 + 5.0*v4 - v5))/(6.0*(A1+A2+A3)));
352 template <
typename Real>
377 template<
typename Real>
381 return GodunovsNormSqrd<Real>(isOutside,
382 gradient_m[0], gradient_p[0],
383 gradient_m[1], gradient_p[1],
384 gradient_m[2], gradient_p[2]);
389 inline simd::Float4 simdMin(
const simd::Float4& a,
const simd::Float4& b) {
390 return simd::Float4(_mm_min_ps(a.base(), b.base()));
392 inline simd::Float4 simdMax(
const simd::Float4& a,
const simd::Float4& b) {
393 return simd::Float4(_mm_max_ps(a.base(), b.base()));
396 inline float simdSum(
const simd::Float4& v);
398 inline simd::Float4
Pow2(
const simd::Float4& v) {
return v * v; }
402 WENO5<simd::Float4>(
const simd::Float4& v1,
const simd::Float4& v2,
const simd::Float4& v3,
403 const simd::Float4& v4,
const simd::Float4& v5,
float scale2)
406 using F4 = simd::Float4;
409 eps(1.0e-6f * scale2),
410 two(2.0), three(3.0), four(4.0), five(5.0), fourth(0.25),
411 A1 = F4(0.1f) /
Pow2(C*
Pow2(v1-two*v2+v3) + fourth*
Pow2(v1-four*v2+three*v3) + eps),
412 A2 = F4(0.6f) /
Pow2(C*
Pow2(v2-two*v3+v4) + fourth*
Pow2(v2-v4) + eps),
413 A3 = F4(0.3f) /
Pow2(C*
Pow2(v3-two*v4+v5) + fourth*
Pow2(three*v3-four*v4+v5) + eps);
414 return (A1 * (two * v1 - F4(7.0) * v2 + F4(11.0) * v3) +
415 A2 * (five * v3 - v2 + two * v4) +
416 A3 * (two * v3 + five * v4 - v5)) / (F4(6.0) * (A1 + A2 + A3));
421 simdSum(
const simd::Float4& v)
424 __m128 temp = _mm_add_ps(v.base(), _mm_movehl_ps(v.base(), v.base()));
426 temp = _mm_add_ss(temp, _mm_shuffle_ps(temp, temp, 1));
427 return _mm_cvtss_f32(temp);
431 GodunovsNormSqrd(
bool isOutside,
const simd::Float4& dP_m,
const simd::Float4& dP_p)
433 const simd::Float4 zero(0.0);
434 simd::Float4 v = isOutside
436 : simdMax(math::
Pow2(simdMin(dP_m, zero)), math::
Pow2(simdMax(dP_p, zero)));
442 template<DScheme DiffScheme>
446 template<
typename Accessor>
447 static typename Accessor::ValueType inX(
const Accessor& grid,
const Coord& ijk);
449 template<
typename Accessor>
450 static typename Accessor::ValueType inY(
const Accessor& grid,
const Coord& ijk);
452 template<
typename Accessor>
453 static typename Accessor::ValueType inZ(
const Accessor& grid,
const Coord& ijk);
456 template<
typename Stencil>
457 static typename Stencil::ValueType inX(
const Stencil& S);
459 template<
typename Stencil>
460 static typename Stencil::ValueType inY(
const Stencil& S);
462 template<
typename Stencil>
463 static typename Stencil::ValueType inZ(
const Stencil& S);
470 template <
typename ValueType>
471 static ValueType
difference(
const ValueType& xp1,
const ValueType& xm1) {
476 template<
typename Accessor>
477 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
480 grid.getValue(ijk.
offsetBy(1, 0, 0)),
481 grid.getValue(ijk.
offsetBy(-1, 0, 0)));
484 template<
typename Accessor>
485 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
488 grid.getValue(ijk.
offsetBy(0, 1, 0)),
489 grid.getValue(ijk.
offsetBy( 0, -1, 0)));
492 template<
typename Accessor>
493 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
496 grid.getValue(ijk.
offsetBy(0, 0, 1)),
497 grid.getValue(ijk.
offsetBy( 0, 0, -1)));
501 template<
typename Stencil>
502 static typename Stencil::ValueType
inX(
const Stencil& S)
504 return difference( S.template getValue< 1, 0, 0>(), S.template getValue<-1, 0, 0>());
507 template<
typename Stencil>
508 static typename Stencil::ValueType
inY(
const Stencil& S)
510 return difference( S.template getValue< 0, 1, 0>(), S.template getValue< 0,-1, 0>());
513 template<
typename Stencil>
514 static typename Stencil::ValueType
inZ(
const Stencil& S)
516 return difference( S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0,-1>());
525 template <
typename ValueType>
526 static ValueType
difference(
const ValueType& xp1,
const ValueType& xm1) {
527 return (xp1 - xm1)*ValueType(0.5);
532 template<
typename Accessor>
533 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
536 grid.getValue(ijk.
offsetBy(1, 0, 0)),
537 grid.getValue(ijk.
offsetBy(-1, 0, 0)));
540 template<
typename Accessor>
541 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
544 grid.getValue(ijk.
offsetBy(0, 1, 0)),
545 grid.getValue(ijk.
offsetBy( 0, -1, 0)));
548 template<
typename Accessor>
549 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
552 grid.getValue(ijk.
offsetBy(0, 0, 1)),
553 grid.getValue(ijk.
offsetBy( 0, 0, -1)));
558 template<
typename Stencil>
559 static typename Stencil::ValueType
inX(
const Stencil& S)
561 return difference(S.template getValue< 1, 0, 0>(), S.template getValue<-1, 0, 0>());
563 template<
typename Stencil>
564 static typename Stencil::ValueType
inY(
const Stencil& S)
566 return difference(S.template getValue< 0, 1, 0>(), S.template getValue< 0,-1, 0>());
569 template<
typename Stencil>
570 static typename Stencil::ValueType
inZ(
const Stencil& S)
572 return difference(S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0,-1>());
582 template <
typename ValueType>
583 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
584 const ValueType& xm1,
const ValueType& xm2 ) {
585 return ValueType(2./3.)*(xp1 - xm1) + ValueType(1./12.)*(xm2 - xp2) ;
590 template<
typename Accessor>
591 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
598 template<
typename Accessor>
599 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
603 grid.getValue(ijk.
offsetBy( 0, 2, 0)), grid.getValue(ijk.
offsetBy( 0, 1, 0)),
604 grid.getValue(ijk.
offsetBy( 0,-1, 0)), grid.getValue(ijk.
offsetBy( 0,-2, 0)) );
607 template<
typename Accessor>
608 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
612 grid.getValue(ijk.
offsetBy( 0, 0, 2)), grid.getValue(ijk.
offsetBy( 0, 0, 1)),
613 grid.getValue(ijk.
offsetBy( 0, 0,-1)), grid.getValue(ijk.
offsetBy( 0, 0,-2)) );
618 template<
typename Stencil>
619 static typename Stencil::ValueType
inX(
const Stencil& S)
621 return difference( S.template getValue< 2, 0, 0>(),
622 S.template getValue< 1, 0, 0>(),
623 S.template getValue<-1, 0, 0>(),
624 S.template getValue<-2, 0, 0>() );
627 template<
typename Stencil>
628 static typename Stencil::ValueType
inY(
const Stencil& S)
630 return difference( S.template getValue< 0, 2, 0>(),
631 S.template getValue< 0, 1, 0>(),
632 S.template getValue< 0,-1, 0>(),
633 S.template getValue< 0,-2, 0>() );
636 template<
typename Stencil>
637 static typename Stencil::ValueType
inZ(
const Stencil& S)
639 return difference( S.template getValue< 0, 0, 2>(),
640 S.template getValue< 0, 0, 1>(),
641 S.template getValue< 0, 0,-1>(),
642 S.template getValue< 0, 0,-2>() );
651 template <
typename ValueType>
652 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
const ValueType& xp1,
653 const ValueType& xm1,
const ValueType& xm2,
const ValueType& xm3 )
655 return ValueType(3./4.)*(xp1 - xm1) - ValueType(0.15)*(xp2 - xm2)
656 + ValueType(1./60.)*(xp3-xm3);
661 template<
typename Accessor>
662 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
670 template<
typename Accessor>
671 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
674 grid.getValue(ijk.
offsetBy( 0, 3, 0)), grid.getValue(ijk.
offsetBy( 0, 2, 0)),
675 grid.getValue(ijk.
offsetBy( 0, 1, 0)), grid.getValue(ijk.
offsetBy( 0,-1, 0)),
676 grid.getValue(ijk.
offsetBy( 0,-2, 0)), grid.getValue(ijk.
offsetBy( 0,-3, 0)));
679 template<
typename Accessor>
680 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
683 grid.getValue(ijk.
offsetBy( 0, 0, 3)), grid.getValue(ijk.
offsetBy( 0, 0, 2)),
684 grid.getValue(ijk.
offsetBy( 0, 0, 1)), grid.getValue(ijk.
offsetBy( 0, 0,-1)),
685 grid.getValue(ijk.
offsetBy( 0, 0,-2)), grid.getValue(ijk.
offsetBy( 0, 0,-3)));
689 template<
typename Stencil>
690 static typename Stencil::ValueType
inX(
const Stencil& S)
692 return difference(S.template getValue< 3, 0, 0>(),
693 S.template getValue< 2, 0, 0>(),
694 S.template getValue< 1, 0, 0>(),
695 S.template getValue<-1, 0, 0>(),
696 S.template getValue<-2, 0, 0>(),
697 S.template getValue<-3, 0, 0>());
700 template<
typename Stencil>
701 static typename Stencil::ValueType
inY(
const Stencil& S)
704 return difference( S.template getValue< 0, 3, 0>(),
705 S.template getValue< 0, 2, 0>(),
706 S.template getValue< 0, 1, 0>(),
707 S.template getValue< 0,-1, 0>(),
708 S.template getValue< 0,-2, 0>(),
709 S.template getValue< 0,-3, 0>());
712 template<
typename Stencil>
713 static typename Stencil::ValueType
inZ(
const Stencil& S)
716 return difference( S.template getValue< 0, 0, 3>(),
717 S.template getValue< 0, 0, 2>(),
718 S.template getValue< 0, 0, 1>(),
719 S.template getValue< 0, 0,-1>(),
720 S.template getValue< 0, 0,-2>(),
721 S.template getValue< 0, 0,-3>());
731 template <
typename ValueType>
732 static ValueType
difference(
const ValueType& xp1,
const ValueType& xp0) {
738 template<
typename Accessor>
739 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
741 return difference(grid.getValue(ijk.
offsetBy(1, 0, 0)), grid.getValue(ijk));
744 template<
typename Accessor>
745 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
747 return difference(grid.getValue(ijk.
offsetBy(0, 1, 0)), grid.getValue(ijk));
750 template<
typename Accessor>
751 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
753 return difference(grid.getValue(ijk.
offsetBy(0, 0, 1)), grid.getValue(ijk));
757 template<
typename Stencil>
758 static typename Stencil::ValueType
inX(
const Stencil& S)
760 return difference(S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>());
763 template<
typename Stencil>
764 static typename Stencil::ValueType
inY(
const Stencil& S)
766 return difference(S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>());
769 template<
typename Stencil>
770 static typename Stencil::ValueType
inZ(
const Stencil& S)
772 return difference(S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>());
781 template <
typename ValueType>
782 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
const ValueType& xp0)
784 return ValueType(2)*xp1 -(ValueType(0.5)*xp2 + ValueType(3./2.)*xp0);
789 template<
typename Accessor>
790 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
798 template<
typename Accessor>
799 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
807 template<
typename Accessor>
808 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
818 template<
typename Stencil>
819 static typename Stencil::ValueType
inX(
const Stencil& S)
821 return difference( S.template getValue< 2, 0, 0>(),
822 S.template getValue< 1, 0, 0>(),
823 S.template getValue< 0, 0, 0>() );
826 template<
typename Stencil>
827 static typename Stencil::ValueType
inY(
const Stencil& S)
829 return difference( S.template getValue< 0, 2, 0>(),
830 S.template getValue< 0, 1, 0>(),
831 S.template getValue< 0, 0, 0>() );
834 template<
typename Stencil>
835 static typename Stencil::ValueType
inZ(
const Stencil& S)
837 return difference( S.template getValue< 0, 0, 2>(),
838 S.template getValue< 0, 0, 1>(),
839 S.template getValue< 0, 0, 0>() );
850 template<
typename ValueType>
851 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
852 const ValueType& xp1,
const ValueType& xp0)
854 return static_cast<ValueType>(xp3/3.0 - 1.5*xp2 + 3.0*xp1 - 11.0*xp0/6.0);
859 template<
typename Accessor>
860 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
862 return difference( grid.getValue(ijk.
offsetBy(3,0,0)),
865 grid.getValue(ijk) );
868 template<
typename Accessor>
869 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
871 return difference( grid.getValue(ijk.
offsetBy(0,3,0)),
874 grid.getValue(ijk) );
877 template<
typename Accessor>
878 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
880 return difference( grid.getValue(ijk.
offsetBy(0,0,3)),
883 grid.getValue(ijk) );
888 template<
typename Stencil>
889 static typename Stencil::ValueType
inX(
const Stencil& S)
891 return difference(S.template getValue< 3, 0, 0>(),
892 S.template getValue< 2, 0, 0>(),
893 S.template getValue< 1, 0, 0>(),
894 S.template getValue< 0, 0, 0>() );
897 template<
typename Stencil>
898 static typename Stencil::ValueType
inY(
const Stencil& S)
900 return difference(S.template getValue< 0, 3, 0>(),
901 S.template getValue< 0, 2, 0>(),
902 S.template getValue< 0, 1, 0>(),
903 S.template getValue< 0, 0, 0>() );
906 template<
typename Stencil>
907 static typename Stencil::ValueType
inZ(
const Stencil& S)
909 return difference( S.template getValue< 0, 0, 3>(),
910 S.template getValue< 0, 0, 2>(),
911 S.template getValue< 0, 0, 1>(),
912 S.template getValue< 0, 0, 0>() );
922 template <
typename ValueType>
923 static ValueType
difference(
const ValueType& xm1,
const ValueType& xm0) {
929 template<
typename Accessor>
930 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
932 return difference(grid.getValue(ijk.
offsetBy(-1,0,0)), grid.getValue(ijk));
935 template<
typename Accessor>
936 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
938 return difference(grid.getValue(ijk.
offsetBy(0,-1,0)), grid.getValue(ijk));
941 template<
typename Accessor>
942 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
944 return difference(grid.getValue(ijk.
offsetBy(0, 0,-1)), grid.getValue(ijk));
949 template<
typename Stencil>
950 static typename Stencil::ValueType
inX(
const Stencil& S)
952 return difference(S.template getValue<-1, 0, 0>(), S.template getValue< 0, 0, 0>());
955 template<
typename Stencil>
956 static typename Stencil::ValueType
inY(
const Stencil& S)
958 return difference(S.template getValue< 0,-1, 0>(), S.template getValue< 0, 0, 0>());
961 template<
typename Stencil>
962 static typename Stencil::ValueType
inZ(
const Stencil& S)
964 return difference(S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0, 0>());
974 template <
typename ValueType>
975 static ValueType
difference(
const ValueType& xm2,
const ValueType& xm1,
const ValueType& xm0)
982 template<
typename Accessor>
983 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
985 return difference( grid.getValue(ijk.
offsetBy(-2,0,0)),
986 grid.getValue(ijk.
offsetBy(-1,0,0)),
987 grid.getValue(ijk) );
990 template<
typename Accessor>
991 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
993 return difference( grid.getValue(ijk.
offsetBy(0,-2,0)),
994 grid.getValue(ijk.
offsetBy(0,-1,0)),
995 grid.getValue(ijk) );
998 template<
typename Accessor>
999 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1001 return difference( grid.getValue(ijk.
offsetBy(0,0,-2)),
1002 grid.getValue(ijk.
offsetBy(0,0,-1)),
1003 grid.getValue(ijk) );
1007 template<
typename Stencil>
1008 static typename Stencil::ValueType
inX(
const Stencil& S)
1010 return difference( S.template getValue<-2, 0, 0>(),
1011 S.template getValue<-1, 0, 0>(),
1012 S.template getValue< 0, 0, 0>() );
1015 template<
typename Stencil>
1016 static typename Stencil::ValueType
inY(
const Stencil& S)
1018 return difference( S.template getValue< 0,-2, 0>(),
1019 S.template getValue< 0,-1, 0>(),
1020 S.template getValue< 0, 0, 0>() );
1023 template<
typename Stencil>
1024 static typename Stencil::ValueType
inZ(
const Stencil& S)
1026 return difference( S.template getValue< 0, 0,-2>(),
1027 S.template getValue< 0, 0,-1>(),
1028 S.template getValue< 0, 0, 0>() );
1038 template <
typename ValueType>
1039 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
1040 const ValueType& xm1,
const ValueType& xm0)
1046 template<
typename Accessor>
1047 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1049 return difference( grid.getValue(ijk.
offsetBy(-3,0,0)),
1050 grid.getValue(ijk.
offsetBy(-2,0,0)),
1051 grid.getValue(ijk.
offsetBy(-1,0,0)),
1052 grid.getValue(ijk) );
1055 template<
typename Accessor>
1056 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1058 return difference( grid.getValue(ijk.
offsetBy( 0,-3,0)),
1059 grid.getValue(ijk.
offsetBy( 0,-2,0)),
1060 grid.getValue(ijk.
offsetBy( 0,-1,0)),
1061 grid.getValue(ijk) );
1064 template<
typename Accessor>
1065 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1067 return difference( grid.getValue(ijk.
offsetBy( 0, 0,-3)),
1068 grid.getValue(ijk.
offsetBy( 0, 0,-2)),
1069 grid.getValue(ijk.
offsetBy( 0, 0,-1)),
1070 grid.getValue(ijk) );
1074 template<
typename Stencil>
1075 static typename Stencil::ValueType
inX(
const Stencil& S)
1077 return difference( S.template getValue<-3, 0, 0>(),
1078 S.template getValue<-2, 0, 0>(),
1079 S.template getValue<-1, 0, 0>(),
1080 S.template getValue< 0, 0, 0>() );
1083 template<
typename Stencil>
1084 static typename Stencil::ValueType
inY(
const Stencil& S)
1086 return difference( S.template getValue< 0,-3, 0>(),
1087 S.template getValue< 0,-2, 0>(),
1088 S.template getValue< 0,-1, 0>(),
1089 S.template getValue< 0, 0, 0>() );
1092 template<
typename Stencil>
1093 static typename Stencil::ValueType
inZ(
const Stencil& S)
1095 return difference( S.template getValue< 0, 0,-3>(),
1096 S.template getValue< 0, 0,-2>(),
1097 S.template getValue< 0, 0,-1>(),
1098 S.template getValue< 0, 0, 0>() );
1107 template <
typename ValueType>
1108 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
1109 const ValueType& xp1,
const ValueType& xp0,
1110 const ValueType& xm1,
const ValueType& xm2) {
1111 return WENO5<ValueType>(xp3, xp2, xp1, xp0, xm1)
1112 - WENO5<ValueType>(xp2, xp1, xp0, xm1, xm2);
1117 template<
typename Accessor>
1118 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1120 using ValueType =
typename Accessor::ValueType;
1122 V[0] = grid.getValue(ijk.
offsetBy(3,0,0));
1123 V[1] = grid.getValue(ijk.
offsetBy(2,0,0));
1124 V[2] = grid.getValue(ijk.
offsetBy(1,0,0));
1125 V[3] = grid.getValue(ijk);
1126 V[4] = grid.getValue(ijk.
offsetBy(-1,0,0));
1127 V[5] = grid.getValue(ijk.
offsetBy(-2,0,0));
1129 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1132 template<
typename Accessor>
1133 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1135 using ValueType =
typename Accessor::ValueType;
1137 V[0] = grid.getValue(ijk.
offsetBy(0,3,0));
1138 V[1] = grid.getValue(ijk.
offsetBy(0,2,0));
1139 V[2] = grid.getValue(ijk.
offsetBy(0,1,0));
1140 V[3] = grid.getValue(ijk);
1141 V[4] = grid.getValue(ijk.
offsetBy(0,-1,0));
1142 V[5] = grid.getValue(ijk.
offsetBy(0,-2,0));
1144 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1147 template<
typename Accessor>
1148 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1150 using ValueType =
typename Accessor::ValueType;
1152 V[0] = grid.getValue(ijk.
offsetBy(0,0,3));
1153 V[1] = grid.getValue(ijk.
offsetBy(0,0,2));
1154 V[2] = grid.getValue(ijk.
offsetBy(0,0,1));
1155 V[3] = grid.getValue(ijk);
1156 V[4] = grid.getValue(ijk.
offsetBy(0,0,-1));
1157 V[5] = grid.getValue(ijk.
offsetBy(0,0,-2));
1159 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1163 template<
typename Stencil>
1164 static typename Stencil::ValueType
inX(
const Stencil& S)
1167 return static_cast<typename Stencil::ValueType>(difference(
1168 S.template getValue< 3, 0, 0>(),
1169 S.template getValue< 2, 0, 0>(),
1170 S.template getValue< 1, 0, 0>(),
1171 S.template getValue< 0, 0, 0>(),
1172 S.template getValue<-1, 0, 0>(),
1173 S.template getValue<-2, 0, 0>() ));
1177 template<
typename Stencil>
1178 static typename Stencil::ValueType
inY(
const Stencil& S)
1180 return static_cast<typename Stencil::ValueType>(difference(
1181 S.template getValue< 0, 3, 0>(),
1182 S.template getValue< 0, 2, 0>(),
1183 S.template getValue< 0, 1, 0>(),
1184 S.template getValue< 0, 0, 0>(),
1185 S.template getValue< 0,-1, 0>(),
1186 S.template getValue< 0,-2, 0>() ));
1189 template<
typename Stencil>
1190 static typename Stencil::ValueType
inZ(
const Stencil& S)
1192 return static_cast<typename Stencil::ValueType>(difference(
1193 S.template getValue< 0, 0, 3>(),
1194 S.template getValue< 0, 0, 2>(),
1195 S.template getValue< 0, 0, 1>(),
1196 S.template getValue< 0, 0, 0>(),
1197 S.template getValue< 0, 0,-1>(),
1198 S.template getValue< 0, 0,-2>() ));
1207 template <
typename ValueType>
1208 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
1209 const ValueType& xp1,
const ValueType& xp0,
1210 const ValueType& xm1,
const ValueType& xm2) {
1211 return WENO5<ValueType>(xp3 - xp2, xp2 - xp1, xp1 - xp0, xp0-xm1, xm1-xm2);
1215 template<
typename Accessor>
1216 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1218 using ValueType =
typename Accessor::ValueType;
1220 V[0] = grid.getValue(ijk.
offsetBy(3,0,0));
1221 V[1] = grid.getValue(ijk.
offsetBy(2,0,0));
1222 V[2] = grid.getValue(ijk.
offsetBy(1,0,0));
1223 V[3] = grid.getValue(ijk);
1224 V[4] = grid.getValue(ijk.
offsetBy(-1,0,0));
1225 V[5] = grid.getValue(ijk.
offsetBy(-2,0,0));
1227 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1231 template<
typename Accessor>
1232 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1234 using ValueType =
typename Accessor::ValueType;
1236 V[0] = grid.getValue(ijk.
offsetBy(0,3,0));
1237 V[1] = grid.getValue(ijk.
offsetBy(0,2,0));
1238 V[2] = grid.getValue(ijk.
offsetBy(0,1,0));
1239 V[3] = grid.getValue(ijk);
1240 V[4] = grid.getValue(ijk.
offsetBy(0,-1,0));
1241 V[5] = grid.getValue(ijk.
offsetBy(0,-2,0));
1243 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1246 template<
typename Accessor>
1247 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1249 using ValueType =
typename Accessor::ValueType;
1251 V[0] = grid.getValue(ijk.
offsetBy(0,0,3));
1252 V[1] = grid.getValue(ijk.
offsetBy(0,0,2));
1253 V[2] = grid.getValue(ijk.
offsetBy(0,0,1));
1254 V[3] = grid.getValue(ijk);
1255 V[4] = grid.getValue(ijk.
offsetBy(0,0,-1));
1256 V[5] = grid.getValue(ijk.
offsetBy(0,0,-2));
1258 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1262 template<
typename Stencil>
1263 static typename Stencil::ValueType
inX(
const Stencil& S)
1266 return difference( S.template getValue< 3, 0, 0>(),
1267 S.template getValue< 2, 0, 0>(),
1268 S.template getValue< 1, 0, 0>(),
1269 S.template getValue< 0, 0, 0>(),
1270 S.template getValue<-1, 0, 0>(),
1271 S.template getValue<-2, 0, 0>() );
1275 template<
typename Stencil>
1276 static typename Stencil::ValueType
inY(
const Stencil& S)
1278 return difference( S.template getValue< 0, 3, 0>(),
1279 S.template getValue< 0, 2, 0>(),
1280 S.template getValue< 0, 1, 0>(),
1281 S.template getValue< 0, 0, 0>(),
1282 S.template getValue< 0,-1, 0>(),
1283 S.template getValue< 0,-2, 0>() );
1286 template<
typename Stencil>
1287 static typename Stencil::ValueType
inZ(
const Stencil& S)
1290 return difference( S.template getValue< 0, 0, 3>(),
1291 S.template getValue< 0, 0, 2>(),
1292 S.template getValue< 0, 0, 1>(),
1293 S.template getValue< 0, 0, 0>(),
1294 S.template getValue< 0, 0,-1>(),
1295 S.template getValue< 0, 0,-2>() );
1304 template<
typename ValueType>
1305 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
const ValueType& xm1,
1306 const ValueType& xm0,
const ValueType& xp1,
const ValueType& xp2)
1313 template<
typename Accessor>
1314 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1316 using ValueType =
typename Accessor::ValueType;
1318 V[0] = grid.getValue(ijk.
offsetBy(-3,0,0));
1319 V[1] = grid.getValue(ijk.
offsetBy(-2,0,0));
1320 V[2] = grid.getValue(ijk.
offsetBy(-1,0,0));
1321 V[3] = grid.getValue(ijk);
1322 V[4] = grid.getValue(ijk.
offsetBy(1,0,0));
1323 V[5] = grid.getValue(ijk.
offsetBy(2,0,0));
1325 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1328 template<
typename Accessor>
1329 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1331 using ValueType =
typename Accessor::ValueType;
1333 V[0] = grid.getValue(ijk.
offsetBy(0,-3,0));
1334 V[1] = grid.getValue(ijk.
offsetBy(0,-2,0));
1335 V[2] = grid.getValue(ijk.
offsetBy(0,-1,0));
1336 V[3] = grid.getValue(ijk);
1337 V[4] = grid.getValue(ijk.
offsetBy(0,1,0));
1338 V[5] = grid.getValue(ijk.
offsetBy(0,2,0));
1340 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1343 template<
typename Accessor>
1344 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1346 using ValueType =
typename Accessor::ValueType;
1348 V[0] = grid.getValue(ijk.
offsetBy(0,0,-3));
1349 V[1] = grid.getValue(ijk.
offsetBy(0,0,-2));
1350 V[2] = grid.getValue(ijk.
offsetBy(0,0,-1));
1351 V[3] = grid.getValue(ijk);
1352 V[4] = grid.getValue(ijk.
offsetBy(0,0,1));
1353 V[5] = grid.getValue(ijk.
offsetBy(0,0,2));
1355 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1359 template<
typename Stencil>
1360 static typename Stencil::ValueType
inX(
const Stencil& S)
1362 using ValueType =
typename Stencil::ValueType;
1364 V[0] = S.template getValue<-3, 0, 0>();
1365 V[1] = S.template getValue<-2, 0, 0>();
1366 V[2] = S.template getValue<-1, 0, 0>();
1367 V[3] = S.template getValue< 0, 0, 0>();
1368 V[4] = S.template getValue< 1, 0, 0>();
1369 V[5] = S.template getValue< 2, 0, 0>();
1371 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1374 template<
typename Stencil>
1375 static typename Stencil::ValueType
inY(
const Stencil& S)
1377 using ValueType =
typename Stencil::ValueType;
1379 V[0] = S.template getValue< 0,-3, 0>();
1380 V[1] = S.template getValue< 0,-2, 0>();
1381 V[2] = S.template getValue< 0,-1, 0>();
1382 V[3] = S.template getValue< 0, 0, 0>();
1383 V[4] = S.template getValue< 0, 1, 0>();
1384 V[5] = S.template getValue< 0, 2, 0>();
1386 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1389 template<
typename Stencil>
1390 static typename Stencil::ValueType
inZ(
const Stencil& S)
1392 using ValueType =
typename Stencil::ValueType;
1394 V[0] = S.template getValue< 0, 0,-3>();
1395 V[1] = S.template getValue< 0, 0,-2>();
1396 V[2] = S.template getValue< 0, 0,-1>();
1397 V[3] = S.template getValue< 0, 0, 0>();
1398 V[4] = S.template getValue< 0, 0, 1>();
1399 V[5] = S.template getValue< 0, 0, 2>();
1401 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1409 template<
typename ValueType>
1410 static ValueType
difference(
const ValueType& xm3,
const ValueType& xm2,
const ValueType& xm1,
1411 const ValueType& xm0,
const ValueType& xp1,
const ValueType& xp2)
1417 template<
typename Accessor>
1418 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1420 using ValueType =
typename Accessor::ValueType;
1422 V[0] = grid.getValue(ijk.
offsetBy(-3,0,0));
1423 V[1] = grid.getValue(ijk.
offsetBy(-2,0,0));
1424 V[2] = grid.getValue(ijk.
offsetBy(-1,0,0));
1425 V[3] = grid.getValue(ijk);
1426 V[4] = grid.getValue(ijk.
offsetBy(1,0,0));
1427 V[5] = grid.getValue(ijk.
offsetBy(2,0,0));
1429 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1432 template<
typename Accessor>
1433 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1435 using ValueType =
typename Accessor::ValueType;
1437 V[0] = grid.getValue(ijk.
offsetBy(0,-3,0));
1438 V[1] = grid.getValue(ijk.
offsetBy(0,-2,0));
1439 V[2] = grid.getValue(ijk.
offsetBy(0,-1,0));
1440 V[3] = grid.getValue(ijk);
1441 V[4] = grid.getValue(ijk.
offsetBy(0,1,0));
1442 V[5] = grid.getValue(ijk.
offsetBy(0,2,0));
1444 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1447 template<
typename Accessor>
1448 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1450 using ValueType =
typename Accessor::ValueType;
1452 V[0] = grid.getValue(ijk.
offsetBy(0,0,-3));
1453 V[1] = grid.getValue(ijk.
offsetBy(0,0,-2));
1454 V[2] = grid.getValue(ijk.
offsetBy(0,0,-1));
1455 V[3] = grid.getValue(ijk);
1456 V[4] = grid.getValue(ijk.
offsetBy(0,0,1));
1457 V[5] = grid.getValue(ijk.
offsetBy(0,0,2));
1459 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1463 template<
typename Stencil>
1464 static typename Stencil::ValueType
inX(
const Stencil& S)
1466 using ValueType =
typename Stencil::ValueType;
1468 V[0] = S.template getValue<-3, 0, 0>();
1469 V[1] = S.template getValue<-2, 0, 0>();
1470 V[2] = S.template getValue<-1, 0, 0>();
1471 V[3] = S.template getValue< 0, 0, 0>();
1472 V[4] = S.template getValue< 1, 0, 0>();
1473 V[5] = S.template getValue< 2, 0, 0>();
1475 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1478 template<
typename Stencil>
1479 static typename Stencil::ValueType
inY(
const Stencil& S)
1481 using ValueType =
typename Stencil::ValueType;
1483 V[0] = S.template getValue< 0,-3, 0>();
1484 V[1] = S.template getValue< 0,-2, 0>();
1485 V[2] = S.template getValue< 0,-1, 0>();
1486 V[3] = S.template getValue< 0, 0, 0>();
1487 V[4] = S.template getValue< 0, 1, 0>();
1488 V[5] = S.template getValue< 0, 2, 0>();
1490 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1493 template<
typename Stencil>
1494 static typename Stencil::ValueType
inZ(
const Stencil& S)
1496 using ValueType =
typename Stencil::ValueType;
1498 V[0] = S.template getValue< 0, 0,-3>();
1499 V[1] = S.template getValue< 0, 0,-2>();
1500 V[2] = S.template getValue< 0, 0,-1>();
1501 V[3] = S.template getValue< 0, 0, 0>();
1502 V[4] = S.template getValue< 0, 0, 1>();
1503 V[5] = S.template getValue< 0, 0, 2>();
1505 return difference(V[0], V[1], V[2], V[3], V[4], V[5]);
1510 template<DScheme DiffScheme>
1514 template<
typename Accessor>
1515 static typename Accessor::ValueType::value_type
1521 template<
typename Accessor>
1522 static typename Accessor::ValueType::value_type
1527 template<
typename Accessor>
1528 static typename Accessor::ValueType::value_type
1536 template<
typename Stencil>
1537 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1542 template<
typename Stencil>
1543 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1548 template<
typename Stencil>
1549 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1561 template<
typename Accessor>
1562 static typename Accessor::ValueType::value_type
1566 grid.getValue(ijk.
offsetBy(-1, 0, 0))[n] );
1569 template<
typename Accessor>
1570 static typename Accessor::ValueType::value_type
1574 grid.getValue(ijk.
offsetBy(0,-1, 0))[n] );
1577 template<
typename Accessor>
1578 static typename Accessor::ValueType::value_type
1582 grid.getValue(ijk.
offsetBy(0, 0,-1))[n] );
1586 template<
typename Stencil>
1587 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1590 S.template getValue<-1, 0, 0>()[n] );
1593 template<
typename Stencil>
1594 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1597 S.template getValue< 0,-1, 0>()[n] );
1600 template<
typename Stencil>
1601 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1604 S.template getValue< 0, 0,-1>()[n] );
1613 template<
typename Accessor>
1614 static typename Accessor::ValueType::value_type
1618 grid.getValue(ijk.
offsetBy(-1, 0, 0))[n] );
1621 template<
typename Accessor>
1622 static typename Accessor::ValueType::value_type
1626 grid.getValue(ijk.
offsetBy(0,-1, 0))[n] );
1629 template<
typename Accessor>
1630 static typename Accessor::ValueType::value_type
1634 grid.getValue(ijk.
offsetBy(0, 0,-1))[n] );
1639 template<
typename Stencil>
1640 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1643 S.template getValue<-1, 0, 0>()[n] );
1646 template<
typename Stencil>
1647 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1650 S.template getValue< 0,-1, 0>()[n] );
1653 template<
typename Stencil>
1654 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1657 S.template getValue< 0, 0,-1>()[n] );
1668 template<
typename Accessor>
1669 static typename Accessor::ValueType::value_type
1673 grid.getValue(ijk.
offsetBy(2, 0, 0))[n], grid.getValue(ijk.
offsetBy( 1, 0, 0))[n],
1674 grid.getValue(ijk.
offsetBy(-1,0, 0))[n], grid.getValue(ijk.
offsetBy(-2, 0, 0))[n]);
1677 template<
typename Accessor>
1678 static typename Accessor::ValueType::value_type
1682 grid.getValue(ijk.
offsetBy( 0, 2, 0))[n], grid.getValue(ijk.
offsetBy( 0, 1, 0))[n],
1683 grid.getValue(ijk.
offsetBy( 0,-1, 0))[n], grid.getValue(ijk.
offsetBy( 0,-2, 0))[n]);
1686 template<
typename Accessor>
1687 static typename Accessor::ValueType::value_type
1691 grid.getValue(ijk.
offsetBy(0,0, 2))[n], grid.getValue(ijk.
offsetBy( 0, 0, 1))[n],
1692 grid.getValue(ijk.
offsetBy(0,0,-1))[n], grid.getValue(ijk.
offsetBy( 0, 0,-2))[n]);
1696 template<
typename Stencil>
1697 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1700 S.template getValue< 2, 0, 0>()[n], S.template getValue< 1, 0, 0>()[n],
1701 S.template getValue<-1, 0, 0>()[n], S.template getValue<-2, 0, 0>()[n] );
1704 template<
typename Stencil>
1705 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1708 S.template getValue< 0, 2, 0>()[n], S.template getValue< 0, 1, 0>()[n],
1709 S.template getValue< 0,-1, 0>()[n], S.template getValue< 0,-2, 0>()[n]);
1712 template<
typename Stencil>
1713 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1716 S.template getValue< 0, 0, 2>()[n], S.template getValue< 0, 0, 1>()[n],
1717 S.template getValue< 0, 0,-1>()[n], S.template getValue< 0, 0,-2>()[n]);
1728 template<
typename Accessor>
1729 static typename Accessor::ValueType::value_type
1733 grid.getValue(ijk.
offsetBy( 3, 0, 0))[n], grid.getValue(ijk.
offsetBy( 2, 0, 0))[n],
1734 grid.getValue(ijk.
offsetBy( 1, 0, 0))[n], grid.getValue(ijk.
offsetBy(-1, 0, 0))[n],
1735 grid.getValue(ijk.
offsetBy(-2, 0, 0))[n], grid.getValue(ijk.
offsetBy(-3, 0, 0))[n] );
1738 template<
typename Accessor>
1739 static typename Accessor::ValueType::value_type
1743 grid.getValue(ijk.
offsetBy( 0, 3, 0))[n], grid.getValue(ijk.
offsetBy( 0, 2, 0))[n],
1744 grid.getValue(ijk.
offsetBy( 0, 1, 0))[n], grid.getValue(ijk.
offsetBy( 0,-1, 0))[n],
1745 grid.getValue(ijk.
offsetBy( 0,-2, 0))[n], grid.getValue(ijk.
offsetBy( 0,-3, 0))[n] );
1748 template<
typename Accessor>
1749 static typename Accessor::ValueType::value_type
1753 grid.getValue(ijk.
offsetBy( 0, 0, 3))[n], grid.getValue(ijk.
offsetBy( 0, 0, 2))[n],
1754 grid.getValue(ijk.
offsetBy( 0, 0, 1))[n], grid.getValue(ijk.
offsetBy( 0, 0,-1))[n],
1755 grid.getValue(ijk.
offsetBy( 0, 0,-2))[n], grid.getValue(ijk.
offsetBy( 0, 0,-3))[n] );
1760 template<
typename Stencil>
1761 static typename Stencil::ValueType::value_type
inX(
const Stencil& S,
int n)
1764 S.template getValue< 3, 0, 0>()[n], S.template getValue< 2, 0, 0>()[n],
1765 S.template getValue< 1, 0, 0>()[n], S.template getValue<-1, 0, 0>()[n],
1766 S.template getValue<-2, 0, 0>()[n], S.template getValue<-3, 0, 0>()[n] );
1769 template<
typename Stencil>
1770 static typename Stencil::ValueType::value_type
inY(
const Stencil& S,
int n)
1773 S.template getValue< 0, 3, 0>()[n], S.template getValue< 0, 2, 0>()[n],
1774 S.template getValue< 0, 1, 0>()[n], S.template getValue< 0,-1, 0>()[n],
1775 S.template getValue< 0,-2, 0>()[n], S.template getValue< 0,-3, 0>()[n] );
1778 template<
typename Stencil>
1779 static typename Stencil::ValueType::value_type
inZ(
const Stencil& S,
int n)
1782 S.template getValue< 0, 0, 3>()[n], S.template getValue< 0, 0, 2>()[n],
1783 S.template getValue< 0, 0, 1>()[n], S.template getValue< 0, 0,-1>()[n],
1784 S.template getValue< 0, 0,-2>()[n], S.template getValue< 0, 0,-3>()[n] );
1788 template<DDScheme DiffScheme>
1792 template<
typename Accessor>
1793 static typename Accessor::ValueType inX(
const Accessor& grid,
const Coord& ijk);
1794 template<
typename Accessor>
1795 static typename Accessor::ValueType inY(
const Accessor& grid,
const Coord& ijk);
1796 template<
typename Accessor>
1797 static typename Accessor::ValueType inZ(
const Accessor& grid,
const Coord& ijk);
1800 template<
typename Accessor>
1801 static typename Accessor::ValueType inXandY(
const Accessor& grid,
const Coord& ijk);
1803 template<
typename Accessor>
1804 static typename Accessor::ValueType inXandZ(
const Accessor& grid,
const Coord& ijk);
1806 template<
typename Accessor>
1807 static typename Accessor::ValueType inYandZ(
const Accessor& grid,
const Coord& ijk);
1811 template<
typename Stencil>
1812 static typename Stencil::ValueType inX(
const Stencil& S);
1813 template<
typename Stencil>
1814 static typename Stencil::ValueType inY(
const Stencil& S);
1815 template<
typename Stencil>
1816 static typename Stencil::ValueType inZ(
const Stencil& S);
1819 template<
typename Stencil>
1820 static typename Stencil::ValueType inXandY(
const Stencil& S);
1822 template<
typename Stencil>
1823 static typename Stencil::ValueType inXandZ(
const Stencil& S);
1825 template<
typename Stencil>
1826 static typename Stencil::ValueType inYandZ(
const Stencil& S);
1834 template <
typename ValueType>
1835 static ValueType
difference(
const ValueType& xp1,
const ValueType& xp0,
const ValueType& xm1)
1837 return xp1 + xm1 - ValueType(2)*xp0;
1840 template <
typename ValueType>
1842 const ValueType& xmyp,
const ValueType& xmym)
1844 return ValueType(0.25)*(xpyp + xmym - xpym - xmyp);
1848 template<
typename Accessor>
1849 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1851 return difference( grid.getValue(ijk.
offsetBy( 1,0,0)), grid.getValue(ijk),
1852 grid.getValue(ijk.
offsetBy(-1,0,0)) );
1855 template<
typename Accessor>
1856 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1859 return difference( grid.getValue(ijk.
offsetBy(0, 1,0)), grid.getValue(ijk),
1860 grid.getValue(ijk.
offsetBy(0,-1,0)) );
1863 template<
typename Accessor>
1864 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
1866 return difference( grid.getValue(ijk.
offsetBy( 0,0, 1)), grid.getValue(ijk),
1867 grid.getValue(ijk.
offsetBy( 0,0,-1)) );
1871 template<
typename Accessor>
1872 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
1874 return crossdifference(
1876 grid.getValue(ijk.
offsetBy(-1,1,0)), grid.getValue(ijk.
offsetBy(-1,-1,0)));
1880 template<
typename Accessor>
1881 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
1883 return crossdifference(
1885 grid.getValue(ijk.
offsetBy(-1,0,1)), grid.getValue(ijk.
offsetBy(-1,0,-1)) );
1888 template<
typename Accessor>
1889 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
1891 return crossdifference(
1893 grid.getValue(ijk.
offsetBy(0,-1,1)), grid.getValue(ijk.
offsetBy(0,-1,-1)) );
1898 template<
typename Stencil>
1899 static typename Stencil::ValueType
inX(
const Stencil& S)
1901 return difference( S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>(),
1902 S.template getValue<-1, 0, 0>() );
1905 template<
typename Stencil>
1906 static typename Stencil::ValueType
inY(
const Stencil& S)
1908 return difference( S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>(),
1909 S.template getValue< 0,-1, 0>() );
1912 template<
typename Stencil>
1913 static typename Stencil::ValueType
inZ(
const Stencil& S)
1915 return difference( S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>(),
1916 S.template getValue< 0, 0,-1>() );
1920 template<
typename Stencil>
1921 static typename Stencil::ValueType
inXandY(
const Stencil& S)
1923 return crossdifference(S.template getValue< 1, 1, 0>(), S.template getValue< 1,-1, 0>(),
1924 S.template getValue<-1, 1, 0>(), S.template getValue<-1,-1, 0>() );
1927 template<
typename Stencil>
1928 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
1930 return crossdifference(S.template getValue< 1, 0, 1>(), S.template getValue< 1, 0,-1>(),
1931 S.template getValue<-1, 0, 1>(), S.template getValue<-1, 0,-1>() );
1934 template<
typename Stencil>
1935 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
1937 return crossdifference(S.template getValue< 0, 1, 1>(), S.template getValue< 0, 1,-1>(),
1938 S.template getValue< 0,-1, 1>(), S.template getValue< 0,-1,-1>() );
1948 template <
typename ValueType>
1949 static ValueType
difference(
const ValueType& xp2,
const ValueType& xp1,
const ValueType& xp0,
1950 const ValueType& xm1,
const ValueType& xm2) {
1951 return ValueType(-1./12.)*(xp2 + xm2) + ValueType(4./3.)*(xp1 + xm1) -ValueType(2.5)*xp0;
1954 template <
typename ValueType>
1956 const ValueType& xp2ym1,
const ValueType& xp2ym2,
1957 const ValueType& xp1yp2,
const ValueType& xp1yp1,
1958 const ValueType& xp1ym1,
const ValueType& xp1ym2,
1959 const ValueType& xm2yp2,
const ValueType& xm2yp1,
1960 const ValueType& xm2ym1,
const ValueType& xm2ym2,
1961 const ValueType& xm1yp2,
const ValueType& xm1yp1,
1962 const ValueType& xm1ym1,
const ValueType& xm1ym2 ) {
1964 ValueType(2./3.0)*(xp1yp1 - xm1yp1 - xp1ym1 + xm1ym1)-
1965 ValueType(1./12.)*(xp2yp1 - xm2yp1 - xp2ym1 + xm2ym1);
1967 ValueType(2./3.0)*(xp1yp2 - xm1yp2 - xp1ym2 + xm1ym2)-
1968 ValueType(1./12.)*(xp2yp2 - xm2yp2 - xp2ym2 + xm2ym2);
1970 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
1976 template<
typename Accessor>
1977 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
1982 grid.getValue(ijk.
offsetBy(-1,0,0)), grid.getValue(ijk.
offsetBy(-2, 0, 0)));
1985 template<
typename Accessor>
1986 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
1991 grid.getValue(ijk.
offsetBy(0,-1,0)), grid.getValue(ijk.
offsetBy(0,-2, 0)));
1994 template<
typename Accessor>
1995 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
2004 template<
typename Accessor>
2005 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
2007 using ValueType =
typename Accessor::ValueType;
2008 typename Accessor::ValueType tmp1 =
2011 typename Accessor::ValueType tmp2 =
2014 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
2017 template<
typename Accessor>
2018 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
2020 using ValueType =
typename Accessor::ValueType;
2021 typename Accessor::ValueType tmp1 =
2024 typename Accessor::ValueType tmp2 =
2027 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
2030 template<
typename Accessor>
2031 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
2033 using ValueType =
typename Accessor::ValueType;
2034 typename Accessor::ValueType tmp1 =
2037 typename Accessor::ValueType tmp2 =
2040 return ValueType(2./3.)*tmp1 - ValueType(1./12.)*tmp2;
2045 template<
typename Stencil>
2046 static typename Stencil::ValueType
inX(
const Stencil& S)
2048 return difference(S.template getValue< 2, 0, 0>(), S.template getValue< 1, 0, 0>(),
2049 S.template getValue< 0, 0, 0>(),
2050 S.template getValue<-1, 0, 0>(), S.template getValue<-2, 0, 0>() );
2053 template<
typename Stencil>
2054 static typename Stencil::ValueType
inY(
const Stencil& S)
2056 return difference(S.template getValue< 0, 2, 0>(), S.template getValue< 0, 1, 0>(),
2057 S.template getValue< 0, 0, 0>(),
2058 S.template getValue< 0,-1, 0>(), S.template getValue< 0,-2, 0>() );
2061 template<
typename Stencil>
2062 static typename Stencil::ValueType
inZ(
const Stencil& S)
2064 return difference(S.template getValue< 0, 0, 2>(), S.template getValue< 0, 0, 1>(),
2065 S.template getValue< 0, 0, 0>(),
2066 S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0,-2>() );
2070 template<
typename Stencil>
2071 static typename Stencil::ValueType
inXandY(
const Stencil& S)
2073 return crossdifference(
2074 S.template getValue< 2, 2, 0>(), S.template getValue< 2, 1, 0>(),
2075 S.template getValue< 2,-1, 0>(), S.template getValue< 2,-2, 0>(),
2076 S.template getValue< 1, 2, 0>(), S.template getValue< 1, 1, 0>(),
2077 S.template getValue< 1,-1, 0>(), S.template getValue< 1,-2, 0>(),
2078 S.template getValue<-2, 2, 0>(), S.template getValue<-2, 1, 0>(),
2079 S.template getValue<-2,-1, 0>(), S.template getValue<-2,-2, 0>(),
2080 S.template getValue<-1, 2, 0>(), S.template getValue<-1, 1, 0>(),
2081 S.template getValue<-1,-1, 0>(), S.template getValue<-1,-2, 0>() );
2084 template<
typename Stencil>
2085 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
2087 return crossdifference(
2088 S.template getValue< 2, 0, 2>(), S.template getValue< 2, 0, 1>(),
2089 S.template getValue< 2, 0,-1>(), S.template getValue< 2, 0,-2>(),
2090 S.template getValue< 1, 0, 2>(), S.template getValue< 1, 0, 1>(),
2091 S.template getValue< 1, 0,-1>(), S.template getValue< 1, 0,-2>(),
2092 S.template getValue<-2, 0, 2>(), S.template getValue<-2, 0, 1>(),
2093 S.template getValue<-2, 0,-1>(), S.template getValue<-2, 0,-2>(),
2094 S.template getValue<-1, 0, 2>(), S.template getValue<-1, 0, 1>(),
2095 S.template getValue<-1, 0,-1>(), S.template getValue<-1, 0,-2>() );
2098 template<
typename Stencil>
2099 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
2101 return crossdifference(
2102 S.template getValue< 0, 2, 2>(), S.template getValue< 0, 2, 1>(),
2103 S.template getValue< 0, 2,-1>(), S.template getValue< 0, 2,-2>(),
2104 S.template getValue< 0, 1, 2>(), S.template getValue< 0, 1, 1>(),
2105 S.template getValue< 0, 1,-1>(), S.template getValue< 0, 1,-2>(),
2106 S.template getValue< 0,-2, 2>(), S.template getValue< 0,-2, 1>(),
2107 S.template getValue< 0,-2,-1>(), S.template getValue< 0,-2,-2>(),
2108 S.template getValue< 0,-1, 2>(), S.template getValue< 0,-1, 1>(),
2109 S.template getValue< 0,-1,-1>(), S.template getValue< 0,-1,-2>() );
2118 template <
typename ValueType>
2119 static ValueType
difference(
const ValueType& xp3,
const ValueType& xp2,
const ValueType& xp1,
2120 const ValueType& xp0,
2121 const ValueType& xm1,
const ValueType& xm2,
const ValueType& xm3)
2123 return ValueType(1./90.)*(xp3 + xm3) - ValueType(3./20.)*(xp2 + xm2)
2124 + ValueType(1.5)*(xp1 + xm1) - ValueType(49./18.)*xp0;
2127 template <
typename ValueType>
2129 const ValueType& xp1ym1,
const ValueType& xm1ym1,
2130 const ValueType& xp2yp1,
const ValueType& xm2yp1,
2131 const ValueType& xp2ym1,
const ValueType& xm2ym1,
2132 const ValueType& xp3yp1,
const ValueType& xm3yp1,
2133 const ValueType& xp3ym1,
const ValueType& xm3ym1,
2134 const ValueType& xp1yp2,
const ValueType& xm1yp2,
2135 const ValueType& xp1ym2,
const ValueType& xm1ym2,
2136 const ValueType& xp2yp2,
const ValueType& xm2yp2,
2137 const ValueType& xp2ym2,
const ValueType& xm2ym2,
2138 const ValueType& xp3yp2,
const ValueType& xm3yp2,
2139 const ValueType& xp3ym2,
const ValueType& xm3ym2,
2140 const ValueType& xp1yp3,
const ValueType& xm1yp3,
2141 const ValueType& xp1ym3,
const ValueType& xm1ym3,
2142 const ValueType& xp2yp3,
const ValueType& xm2yp3,
2143 const ValueType& xp2ym3,
const ValueType& xm2ym3,
2144 const ValueType& xp3yp3,
const ValueType& xm3yp3,
2145 const ValueType& xp3ym3,
const ValueType& xm3ym3 )
2148 ValueType(0.7500)*(xp1yp1 - xm1yp1 - xp1ym1 + xm1ym1) -
2149 ValueType(0.1500)*(xp2yp1 - xm2yp1 - xp2ym1 + xm2ym1) +
2150 ValueType(1./60.)*(xp3yp1 - xm3yp1 - xp3ym1 + xm3ym1);
2153 ValueType(0.7500)*(xp1yp2 - xm1yp2 - xp1ym2 + xm1ym2) -
2154 ValueType(0.1500)*(xp2yp2 - xm2yp2 - xp2ym2 + xm2ym2) +
2155 ValueType(1./60.)*(xp3yp2 - xm3yp2 - xp3ym2 + xm3ym2);
2158 ValueType(0.7500)*(xp1yp3 - xm1yp3 - xp1ym3 + xm1ym3) -
2159 ValueType(0.1500)*(xp2yp3 - xm2yp3 - xp2ym3 + xm2ym3) +
2160 ValueType(1./60.)*(xp3yp3 - xm3yp3 - xp3ym3 + xm3ym3);
2162 return ValueType(0.75)*tmp1 - ValueType(0.15)*tmp2 + ValueType(1./60)*tmp3;
2167 template<
typename Accessor>
2168 static typename Accessor::ValueType
inX(
const Accessor& grid,
const Coord& ijk)
2171 grid.getValue(ijk.
offsetBy( 3, 0, 0)), grid.getValue(ijk.
offsetBy( 2, 0, 0)),
2172 grid.getValue(ijk.
offsetBy( 1, 0, 0)), grid.getValue(ijk),
2173 grid.getValue(ijk.
offsetBy(-1, 0, 0)), grid.getValue(ijk.
offsetBy(-2, 0, 0)),
2174 grid.getValue(ijk.
offsetBy(-3, 0, 0)) );
2177 template<
typename Accessor>
2178 static typename Accessor::ValueType
inY(
const Accessor& grid,
const Coord& ijk)
2181 grid.getValue(ijk.
offsetBy( 0, 3, 0)), grid.getValue(ijk.
offsetBy( 0, 2, 0)),
2182 grid.getValue(ijk.
offsetBy( 0, 1, 0)), grid.getValue(ijk),
2183 grid.getValue(ijk.
offsetBy( 0,-1, 0)), grid.getValue(ijk.
offsetBy( 0,-2, 0)),
2184 grid.getValue(ijk.
offsetBy( 0,-3, 0)) );
2187 template<
typename Accessor>
2188 static typename Accessor::ValueType
inZ(
const Accessor& grid,
const Coord& ijk)
2192 grid.getValue(ijk.
offsetBy( 0, 0, 3)), grid.getValue(ijk.
offsetBy( 0, 0, 2)),
2193 grid.getValue(ijk.
offsetBy( 0, 0, 1)), grid.getValue(ijk),
2194 grid.getValue(ijk.
offsetBy( 0, 0,-1)), grid.getValue(ijk.
offsetBy( 0, 0,-2)),
2195 grid.getValue(ijk.
offsetBy( 0, 0,-3)) );
2198 template<
typename Accessor>
2199 static typename Accessor::ValueType
inXandY(
const Accessor& grid,
const Coord& ijk)
2201 using ValueT =
typename Accessor::ValueType;
2211 return ValueT(0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3);
2214 template<
typename Accessor>
2215 static typename Accessor::ValueType
inXandZ(
const Accessor& grid,
const Coord& ijk)
2217 using ValueT =
typename Accessor::ValueType;
2227 return ValueT(0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3);
2230 template<
typename Accessor>
2231 static typename Accessor::ValueType
inYandZ(
const Accessor& grid,
const Coord& ijk)
2233 using ValueT =
typename Accessor::ValueType;
2243 return ValueT(0.75*tmp1 - 0.15*tmp2 + 1./60*tmp3);
2248 template<
typename Stencil>
2249 static typename Stencil::ValueType
inX(
const Stencil& S)
2251 return difference( S.template getValue< 3, 0, 0>(), S.template getValue< 2, 0, 0>(),
2252 S.template getValue< 1, 0, 0>(), S.template getValue< 0, 0, 0>(),
2253 S.template getValue<-1, 0, 0>(), S.template getValue<-2, 0, 0>(),
2254 S.template getValue<-3, 0, 0>() );
2257 template<
typename Stencil>
2258 static typename Stencil::ValueType
inY(
const Stencil& S)
2260 return difference( S.template getValue< 0, 3, 0>(), S.template getValue< 0, 2, 0>(),
2261 S.template getValue< 0, 1, 0>(), S.template getValue< 0, 0, 0>(),
2262 S.template getValue< 0,-1, 0>(), S.template getValue< 0,-2, 0>(),
2263 S.template getValue< 0,-3, 0>() );
2267 template<
typename Stencil>
2268 static typename Stencil::ValueType
inZ(
const Stencil& S)
2270 return difference( S.template getValue< 0, 0, 3>(), S.template getValue< 0, 0, 2>(),
2271 S.template getValue< 0, 0, 1>(), S.template getValue< 0, 0, 0>(),
2272 S.template getValue< 0, 0,-1>(), S.template getValue< 0, 0,-2>(),
2273 S.template getValue< 0, 0,-3>() );
2276 template<
typename Stencil>
2277 static typename Stencil::ValueType
inXandY(
const Stencil& S)
2279 return crossdifference( S.template getValue< 1, 1, 0>(), S.template getValue<-1, 1, 0>(),
2280 S.template getValue< 1,-1, 0>(), S.template getValue<-1,-1, 0>(),
2281 S.template getValue< 2, 1, 0>(), S.template getValue<-2, 1, 0>(),
2282 S.template getValue< 2,-1, 0>(), S.template getValue<-2,-1, 0>(),
2283 S.template getValue< 3, 1, 0>(), S.template getValue<-3, 1, 0>(),
2284 S.template getValue< 3,-1, 0>(), S.template getValue<-3,-1, 0>(),
2285 S.template getValue< 1, 2, 0>(), S.template getValue<-1, 2, 0>(),
2286 S.template getValue< 1,-2, 0>(), S.template getValue<-1,-2, 0>(),
2287 S.template getValue< 2, 2, 0>(), S.template getValue<-2, 2, 0>(),
2288 S.template getValue< 2,-2, 0>(), S.template getValue<-2,-2, 0>(),
2289 S.template getValue< 3, 2, 0>(), S.template getValue<-3, 2, 0>(),
2290 S.template getValue< 3,-2, 0>(), S.template getValue<-3,-2, 0>(),
2291 S.template getValue< 1, 3, 0>(), S.template getValue<-1, 3, 0>(),
2292 S.template getValue< 1,-3, 0>(), S.template getValue<-1,-3, 0>(),
2293 S.template getValue< 2, 3, 0>(), S.template getValue<-2, 3, 0>(),
2294 S.template getValue< 2,-3, 0>(), S.template getValue<-2,-3, 0>(),
2295 S.template getValue< 3, 3, 0>(), S.template getValue<-3, 3, 0>(),
2296 S.template getValue< 3,-3, 0>(), S.template getValue<-3,-3, 0>() );
2299 template<
typename Stencil>
2300 static typename Stencil::ValueType
inXandZ(
const Stencil& S)
2302 return crossdifference( S.template getValue< 1, 0, 1>(), S.template getValue<-1, 0, 1>(),
2303 S.template getValue< 1, 0,-1>(), S.template getValue<-1, 0,-1>(),
2304 S.template getValue< 2, 0, 1>(), S.template getValue<-2, 0, 1>(),
2305 S.template getValue< 2, 0,-1>(), S.template getValue<-2, 0,-1>(),
2306 S.template getValue< 3, 0, 1>(), S.template getValue<-3, 0, 1>(),
2307 S.template getValue< 3, 0,-1>(), S.template getValue<-3, 0,-1>(),
2308 S.template getValue< 1, 0, 2>(), S.template getValue<-1, 0, 2>(),
2309 S.template getValue< 1, 0,-2>(), S.template getValue<-1, 0,-2>(),
2310 S.template getValue< 2, 0, 2>(), S.template getValue<-2, 0, 2>(),
2311 S.template getValue< 2, 0,-2>(), S.template getValue<-2, 0,-2>(),
2312 S.template getValue< 3, 0, 2>(), S.template getValue<-3, 0, 2>(),
2313 S.template getValue< 3, 0,-2>(), S.template getValue<-3, 0,-2>(),
2314 S.template getValue< 1, 0, 3>(), S.template getValue<-1, 0, 3>(),
2315 S.template getValue< 1, 0,-3>(), S.template getValue<-1, 0,-3>(),
2316 S.template getValue< 2, 0, 3>(), S.template getValue<-2, 0, 3>(),
2317 S.template getValue< 2, 0,-3>(), S.template getValue<-2, 0,-3>(),
2318 S.template getValue< 3, 0, 3>(), S.template getValue<-3, 0, 3>(),
2319 S.template getValue< 3, 0,-3>(), S.template getValue<-3, 0,-3>() );
2322 template<
typename Stencil>
2323 static typename Stencil::ValueType
inYandZ(
const Stencil& S)
2325 return crossdifference( S.template getValue< 0, 1, 1>(), S.template getValue< 0,-1, 1>(),
2326 S.template getValue< 0, 1,-1>(), S.template getValue< 0,-1,-1>(),
2327 S.template getValue< 0, 2, 1>(), S.template getValue< 0,-2, 1>(),
2328 S.template getValue< 0, 2,-1>(), S.template getValue< 0,-2,-1>(),
2329 S.template getValue< 0, 3, 1>(), S.template getValue< 0,-3, 1>(),
2330 S.template getValue< 0, 3,-1>(), S.template getValue< 0,-3,-1>(),
2331 S.template getValue< 0, 1, 2>(), S.template getValue< 0,-1, 2>(),
2332 S.template getValue< 0, 1,-2>(), S.template getValue< 0,-1,-2>(),
2333 S.template getValue< 0, 2, 2>(), S.template getValue< 0,-2, 2>(),
2334 S.template getValue< 0, 2,-2>(), S.template getValue< 0,-2,-2>(),
2335 S.template getValue< 0, 3, 2>(), S.template getValue< 0,-3, 2>(),
2336 S.template getValue< 0, 3,-2>(), S.template getValue< 0,-3,-2>(),
2337 S.template getValue< 0, 1, 3>(), S.template getValue< 0,-1, 3>(),
2338 S.template getValue< 0, 1,-3>(), S.template getValue< 0,-1,-3>(),
2339 S.template getValue< 0, 2, 3>(), S.template getValue< 0,-2, 3>(),
2340 S.template getValue< 0, 2,-3>(), S.template getValue< 0,-2,-3>(),
2341 S.template getValue< 0, 3, 3>(), S.template getValue< 0,-3, 3>(),
2342 S.template getValue< 0, 3,-3>(), S.template getValue< 0,-3,-3>() );
2351 #endif // OPENVDB_MATH_FINITEDIFFERENCE_HAS_BEEN_INCLUDED static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:2258
Definition: FiniteDifference.h:77
Definition: FiniteDifference.h:72
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1543
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1075
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1344
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:570
Definition: FiniteDifference.h:69
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:739
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1688
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1375
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:898
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xm1, const ValueType &xm2, const ValueType &xm3)
Definition: FiniteDifference.h:652
ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, float scale2=0.01f)
Implementation of nominally fifth-order finite-difference WENO.
Definition: FiniteDifference.h:331
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1587
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:1928
std::string dsSchemeToMenuName(DScheme dss)
Definition: FiniteDifference.h:147
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:477
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:508
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:493
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1494
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2188
Definition: FiniteDifference.h:268
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:2323
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:827
DScheme stringToDScheme(const std::string &s)
Definition: FiniteDifference.h:105
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1464
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1750
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1276
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:541
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:2046
Definition: FiniteDifference.h:184
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:991
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:1935
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1899
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1761
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1024
TemporalIntegrationScheme stringToTemporalIntegrationScheme(const std::string &s)
Definition: FiniteDifference.h:284
static ValueType difference(const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:732
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:907
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:662
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:860
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:1921
std::string dsSchemeToString(DScheme dss)
Definition: FiniteDifference.h:81
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1670
Definition: FiniteDifference.h:64
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1133
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1601
const Type & Min(const Type &a, const Type &b)
Return the minimum of two values.
Definition: Math.h:610
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1418
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1679
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1856
Definition: FiniteDifference.h:1511
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:851
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:2277
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1247
std::string temporalIntegrationSchemeToMenuName(TemporalIntegrationScheme tis)
Definition: FiniteDifference.h:304
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1713
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1523
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1881
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0, const ValueType &xp1, const ValueType &xp2)
Definition: FiniteDifference.h:1305
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:799
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1615
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:983
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:764
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1986
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1889
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:1955
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:819
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:591
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:533
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:2268
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1995
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:2062
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2215
Definition: FiniteDifference.h:197
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:51
Definition: FiniteDifference.h:198
Definition: FiniteDifference.h:262
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:1039
Definition: FiniteDifference.h:67
Definition: FiniteDifference.h:193
static Stencil::ValueType inYandZ(const Stencil &S)
Definition: FiniteDifference.h:2099
static ValueType difference(const ValueType &xm2, const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:975
Definition: FiniteDifference.h:61
TemporalIntegrationScheme
Temporal integration schemes.
Definition: FiniteDifference.h:261
Definition: FiniteDifference.h:196
Definition: FiniteDifference.h:201
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1647
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1314
DDScheme
Different discrete schemes used in the second derivatives.
Definition: FiniteDifference.h:177
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1008
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1864
static ValueType difference(const ValueType &xp1, const ValueType &xm1)
Definition: FiniteDifference.h:471
Real GodunovsNormSqrd(bool isOutside, const Vec3< Real > &gradient_m, const Vec3< Real > &gradient_p)
Definition: FiniteDifference.h:379
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1360
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1329
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1949
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:559
Definition: FiniteDifference.h:74
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:770
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1537
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:502
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:2054
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1516
Definition: FiniteDifference.h:180
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1148
Definition: FiniteDifference.h:1789
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2231
std::string biasedGradientSchemeToMenuName(BiasedGradientScheme bgs)
Definition: FiniteDifference.h:242
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1093
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1065
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1770
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1287
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:583
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1697
static Stencil::ValueType::value_type inX(const Stencil &S, int n)
Definition: FiniteDifference.h:1640
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:942
static ValueType difference(const ValueType &xm3, const ValueType &xm2, const ValueType &xm1, const ValueType &xm0, const ValueType &xp1, const ValueType &xp2)
Definition: FiniteDifference.h:1410
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1549
Definition: FiniteDifference.h:65
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1263
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1479
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1740
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2005
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2199
Definition: FiniteDifference.h:265
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:790
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:2128
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1118
Definition: Exceptions.h:40
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1529
std::string biasedGradientSchemeToString(BiasedGradientScheme bgs)
Definition: FiniteDifference.h:204
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:514
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:2085
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:878
static ValueType difference(const ValueType &xm1, const ValueType &xm0)
Definition: FiniteDifference.h:923
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1108
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:751
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1872
Definition: FiniteDifference.h:70
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:599
Definition: FiniteDifference.h:60
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2178
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1216
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1178
const Type & Max(const Type &a, const Type &b)
Return the maximum of two values.
Definition: Math.h:549
Definition: FiniteDifference.h:66
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1977
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1906
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1056
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:936
Definition: FiniteDifference.h:443
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2031
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1631
Definition: FiniteDifference.h:181
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:2119
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1390
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:962
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:671
Definition: FiniteDifference.h:263
Definition: FiniteDifference.h:179
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:758
static ValueType difference(const ValueType &xp2, const ValueType &xp1, const ValueType &xp0)
Definition: FiniteDifference.h:782
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:930
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1084
Definition: FiniteDifference.h:178
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:549
Definition: FiniteDifference.h:195
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:869
static ValueType difference(const ValueType &xp1, const ValueType &xm1)
Definition: FiniteDifference.h:526
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:2249
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:628
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2168
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:745
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1232
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:608
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:1016
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1705
Definition: FiniteDifference.h:73
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1571
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1448
static ValueType difference(const ValueType &xp1, const ValueType &xp0, const ValueType &xm1)
Definition: FiniteDifference.h:1835
Definition: FiniteDifference.h:62
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1849
BiasedGradientScheme stringToBiasedGradientScheme(const std::string &s)
Definition: FiniteDifference.h:219
static Stencil::ValueType::value_type inY(const Stencil &S, int n)
Definition: FiniteDifference.h:1594
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:637
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:950
std::string temporalIntegrationSchemeToString(TemporalIntegrationScheme tis)
Definition: FiniteDifference.h:271
Definition: FiniteDifference.h:63
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:835
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:701
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1730
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:564
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1654
BiasedGradientScheme
Biased Gradients are limited to non-centered differences.
Definition: FiniteDifference.h:192
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:999
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1047
static Stencil::ValueType::value_type inZ(const Stencil &S, int n)
Definition: FiniteDifference.h:1779
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:680
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:690
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1190
Definition: FiniteDifference.h:68
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:485
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:713
Definition: FiniteDifference.h:194
Definition: FiniteDifference.h:71
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:889
static Stencil::ValueType inXandZ(const Stencil &S)
Definition: FiniteDifference.h:2300
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1579
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1563
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:2018
static Stencil::ValueType inZ(const Stencil &S)
Definition: FiniteDifference.h:1913
static ValueType crossdifference(const ValueType &xpyp, const ValueType &xpym, const ValueType &xmyp, const ValueType &xmym)
Definition: FiniteDifference.h:1841
static Stencil::ValueType inY(const Stencil &S)
Definition: FiniteDifference.h:956
double Real
Definition: Types.h:67
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:1433
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
Definition: FiniteDifference.h:808
static ValueType difference(const ValueType &xp3, const ValueType &xp2, const ValueType &xp1, const ValueType &xp0, const ValueType &xm1, const ValueType &xm2)
Definition: FiniteDifference.h:1208
static Stencil::ValueType inXandY(const Stencil &S)
Definition: FiniteDifference.h:2071
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:1164
static Stencil::ValueType inX(const Stencil &S)
Definition: FiniteDifference.h:619
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition: FiniteDifference.h:1623
Definition: FiniteDifference.h:264
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:118
Type Pow2(Type x)
Return x2.
Definition: Math.h:502