6#ifndef OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
7#define OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
22template<
typename Vec3T>
struct is_vec3d {
static const bool value =
false; };
34template<
typename MapType,
typename OpType,
typename ResultType>
38 template<
typename AccessorType>
40 result(
const AccessorType& grid,
const Coord& ijk) {
return OpType::result(
map, grid, ijk); }
42 template<
typename StencilType>
44 result(
const StencilType& stencil) {
return OpType::result(
map, stencil); }
51template<
typename OpType>
53 template<
typename AccessorType>
54 static inline double result(
const AccessorType& grid,
const Coord& ijk) {
55 return double(OpType::result(grid, ijk).length());
58 template<
typename StencilType>
59 static inline double result(
const StencilType& stencil) {
60 return double(OpType::result(stencil).length());
65template<
typename OpType,
typename MapT>
67 template<
typename AccessorType>
68 static inline double result(
const MapT& map,
const AccessorType& grid,
const Coord& ijk) {
69 return double(OpType::result(map, grid, ijk).length());
72 template<
typename StencilType>
73 static inline double result(
const MapT& map,
const StencilType& stencil) {
74 return double(OpType::result(map, stencil).length());
85 using ValueType =
typename T::ValueType;
98template<DScheme DiffScheme>
105 using ValueType =
typename Accessor::ValueType;
116 using ValueType =
typename StencilT::ValueType;
128template<BiasedGradientScheme bgs>
133 template<
typename Gr
idType,
bool IsSafe = true>
144 template<
typename Gr
idType,
bool IsSafe = true>
155 template<
typename Gr
idType,
bool IsSafe = true>
165 template<
typename Gr
idType,
bool IsSafe = true>
175 template<
typename Gr
idType,
bool IsSafe = true>
185 template<
typename Gr
idType,
bool IsSafe = true>
195template<BiasedGradientScheme GradScheme,
typename Vec3Bias>
202 template<
typename Accessor>
206 using ValueType =
typename Accessor::ValueType;
215 template<
typename StencilT>
217 result(
const StencilT& stencil,
const Vec3Bias& V)
219 using ValueType =
typename StencilT::ValueType;
229template<BiasedGradientScheme GradScheme>
237 template<
typename Accessor>
238 static typename Accessor::ValueType
241 using ValueType =
typename Accessor::ValueType;
250 template<
typename StencilT>
251 static typename StencilT::ValueType
254 using ValueType =
typename StencilT::ValueType;
265struct ISGradientNormSqrd<HJWENO5_BIAS>
268 template<
typename Accessor>
269 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk)
274 GetValue(
const Accessor& acc_): acc(acc_) {}
276 inline simd::Float4::value_type operator()(
const Coord& ijk_) {
277 return static_cast<simd::Float4::value_type
>(acc.getValue(ijk_));
290 v3(valueAt(ijk ) - valueAt(ijk.
offsetBy(-1, 0, 0)),
291 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0,-1, 0)),
292 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0, 0,-1)), 0),
293 v4(valueAt(ijk.
offsetBy( 1, 0, 0)) - valueAt(ijk ),
294 valueAt(ijk.
offsetBy( 0, 1, 0)) - valueAt(ijk ),
295 valueAt(ijk.
offsetBy( 0, 0, 1)) - valueAt(ijk ), 0),
302 down = math::WENO5(v1, v2, v3, v4, v5),
303 up = math::WENO5(v6, v5, v4, v3, v2);
305 return math::GodunovsNormSqrd(grid.getValue(ijk)>0, down, up);
309 template<
typename StencilT>
310 static typename StencilT::ValueType result(
const StencilT& s)
312 using F4Val = simd::Float4::value_type;
316 v1(F4Val(s.template getValue<-2, 0, 0>()) - F4Val(s.template getValue<-3, 0, 0>()),
317 F4Val(s.template getValue< 0,-2, 0>()) - F4Val(s.template getValue< 0,-3, 0>()),
318 F4Val(s.template getValue< 0, 0,-2>()) - F4Val(s.template getValue< 0, 0,-3>()), 0),
319 v2(F4Val(s.template getValue<-1, 0, 0>()) - F4Val(s.template getValue<-2, 0, 0>()),
320 F4Val(s.template getValue< 0,-1, 0>()) - F4Val(s.template getValue< 0,-2, 0>()),
321 F4Val(s.template getValue< 0, 0,-1>()) - F4Val(s.template getValue< 0, 0,-2>()), 0),
322 v3(F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue<-1, 0, 0>()),
323 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0,-1, 0>()),
324 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0, 0,-1>()), 0),
325 v4(F4Val(s.template getValue< 1, 0, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
326 F4Val(s.template getValue< 0, 1, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
327 F4Val(s.template getValue< 0, 0, 1>()) - F4Val(s.template getValue< 0, 0, 0>()), 0),
328 v5(F4Val(s.template getValue< 2, 0, 0>()) - F4Val(s.template getValue< 1, 0, 0>()),
329 F4Val(s.template getValue< 0, 2, 0>()) - F4Val(s.template getValue< 0, 1, 0>()),
330 F4Val(s.template getValue< 0, 0, 2>()) - F4Val(s.template getValue< 0, 0, 1>()), 0),
331 v6(F4Val(s.template getValue< 3, 0, 0>()) - F4Val(s.template getValue< 2, 0, 0>()),
332 F4Val(s.template getValue< 0, 3, 0>()) - F4Val(s.template getValue< 0, 2, 0>()),
333 F4Val(s.template getValue< 0, 0, 3>()) - F4Val(s.template getValue< 0, 0, 2>()), 0),
334 down = math::WENO5(v1, v2, v3, v4, v5),
335 up = math::WENO5(v6, v5, v4, v3, v2);
337 return math::GodunovsNormSqrd(s.template getValue<0, 0, 0>()>0, down, up);
346template<DDScheme DiffScheme>
350 template<
typename Accessor>
351 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk);
354 template<
typename StencilT>
355 static typename StencilT::ValueType
result(
const StencilT& stencil);
363 template<
typename Accessor>
364 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
366 return grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
367 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy(0, -1, 0)) +
369 - 6*grid.getValue(ijk);
373 template<
typename StencilT>
374 static typename StencilT::ValueType
result(
const StencilT& stencil)
376 return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
377 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
378 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
379 - 6*stencil.template getValue< 0, 0, 0>();
387 template<
typename Accessor>
388 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
390 using ValueT =
typename Accessor::ValueType;
391 return static_cast<ValueT
>(
393 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
394 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
395 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
397 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
398 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
399 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
400 - 7.5*grid.getValue(ijk));
404 template<
typename StencilT>
405 static typename StencilT::ValueType
result(
const StencilT& stencil)
407 using ValueT =
typename StencilT::ValueType;
408 return static_cast<ValueT
>(
410 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
411 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
412 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
414 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
415 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
416 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
417 - 7.5*stencil.template getValue< 0, 0, 0>());
425 template<
typename Accessor>
426 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
428 using ValueT =
typename Accessor::ValueType;
429 return static_cast<ValueT
>(
431 grid.getValue(ijk.
offsetBy(3,0,0)) + grid.getValue(ijk.
offsetBy(-3, 0, 0)) +
432 grid.getValue(ijk.
offsetBy(0,3,0)) + grid.getValue(ijk.
offsetBy( 0,-3, 0)) +
433 grid.getValue(ijk.
offsetBy(0,0,3)) + grid.getValue(ijk.
offsetBy( 0, 0,-3)) )
435 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
436 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
437 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
439 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
440 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
441 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
442 - (3*49/18.)*grid.getValue(ijk));
446 template<
typename StencilT>
447 static typename StencilT::ValueType
result(
const StencilT& stencil)
449 using ValueT =
typename StencilT::ValueType;
450 return static_cast<ValueT
>(
452 stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
453 stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
454 stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
456 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
457 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
458 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
460 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
461 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
462 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
463 - (3*49/18.)*stencil.template getValue< 0, 0, 0>());
471template<DScheme DiffScheme>
475 template<
typename Accessor>
static typename Accessor::ValueType::value_type
484 template<
typename StencilT>
static typename StencilT::ValueType::value_type
497template<DScheme DiffScheme>
501 template<
typename Accessor>
502 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
504 using Vec3Type =
typename Accessor::ValueType;
514 template<
typename StencilT>
515 static typename StencilT::ValueType
result(
const StencilT& stencil)
517 using Vec3Type =
typename StencilT::ValueType;
531template<DDScheme DiffScheme2, DScheme DiffScheme1>
538 template<
typename Accessor>
540 typename Accessor::ValueType& alpha,
541 typename Accessor::ValueType& beta)
543 using ValueType =
typename Accessor::ValueType;
549 const ValueType Dx2 = Dx*Dx;
550 const ValueType Dy2 = Dy*Dy;
551 const ValueType Dz2 = Dz*Dz;
552 const ValueType normGrad = Dx2 + Dy2 + Dz2;
567 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
568 beta = ValueType(std::sqrt(
double(normGrad)));
576 template<
typename StencilT>
577 static bool result(
const StencilT& stencil,
578 typename StencilT::ValueType& alpha,
579 typename StencilT::ValueType& beta)
581 using ValueType =
typename StencilT::ValueType;
586 const ValueType Dx2 = Dx*Dx;
587 const ValueType Dy2 = Dy*Dy;
588 const ValueType Dz2 = Dz*Dz;
589 const ValueType normGrad = Dx2 + Dy2 + Dz2;
604 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
605 beta = ValueType(std::sqrt(
double(normGrad)));
618template<
typename MapType, DScheme DiffScheme>
622 template<
typename Accessor>
623 static typename internal::ReturnValue<Accessor>::Vec3Type
624 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
626 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
629 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
633 template<
typename StencilT>
634 static typename internal::ReturnValue<StencilT>::Vec3Type
635 result(
const MapType& map,
const StencilT& stencil)
637 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
640 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
646template<DScheme DiffScheme>
650 template<
typename Accessor>
651 static typename internal::ReturnValue<Accessor>::Vec3Type
658 template<
typename StencilT>
659 static typename internal::ReturnValue<StencilT>::Vec3Type
672 template<
typename Accessor>
673 static typename internal::ReturnValue<Accessor>::Vec3Type
676 using ValueType =
typename internal::ReturnValue<Accessor>::ValueType;
677 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
681 return iGradient * inv2dx;
685 template<
typename StencilT>
686 static typename internal::ReturnValue<StencilT>::Vec3Type
689 using ValueType =
typename internal::ReturnValue<StencilT>::ValueType;
690 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
694 return iGradient * inv2dx;
704 template<
typename Accessor>
705 static typename internal::ReturnValue<Accessor>::Vec3Type
708 using ValueType =
typename internal::ReturnValue<Accessor>::ValueType;
709 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
713 return iGradient * inv2dx;
717 template<
typename StencilT>
718 static typename internal::ReturnValue<StencilT>::Vec3Type
721 using ValueType =
typename internal::ReturnValue<StencilT>::ValueType;
722 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
726 return iGradient * inv2dx;
736 template<
typename Accessor>
737 static typename internal::ReturnValue<Accessor>::Vec3Type
740 using ValueType =
typename internal::ReturnValue<Accessor>::ValueType;
741 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
749 return Vec3Type(ValueType(gradient0),
750 ValueType(gradient1),
751 ValueType(gradient2));
755 template<
typename StencilT>
756 static typename internal::ReturnValue<StencilT>::Vec3Type
759 using ValueType =
typename internal::ReturnValue<StencilT>::ValueType;
760 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
768 return Vec3Type(ValueType(gradient0),
769 ValueType(gradient1),
770 ValueType(gradient2));
780 template<
typename Accessor>
781 static typename internal::ReturnValue<Accessor>::Vec3Type
784 using ValueType =
typename internal::ReturnValue<Accessor>::ValueType;
785 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
793 return Vec3Type(ValueType(gradient0),
794 ValueType(gradient1),
795 ValueType(gradient2));
799 template<
typename StencilT>
800 static typename internal::ReturnValue<StencilT>::Vec3Type
803 using ValueType =
typename internal::ReturnValue<StencilT>::ValueType;
804 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
812 return Vec3Type(ValueType(gradient0),
813 ValueType(gradient1),
814 ValueType(gradient2));
823template<
typename MapType, BiasedGradientScheme GradScheme>
828 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
831 using ValueType =
typename Accessor::ValueType;
835 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
840 result(
const MapType& map,
const StencilT& stencil,
843 using ValueType =
typename StencilT::ValueType;
847 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
856template<
typename MapType, BiasedGradientScheme GradScheme>
864 template<
typename Accessor>
865 static typename Accessor::ValueType
866 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
868 using ValueType =
typename Accessor::ValueType;
877 template<
typename StencilT>
878 static typename StencilT::ValueType
879 result(
const MapType& map,
const StencilT& stencil)
881 using ValueType =
typename StencilT::ValueType;
891template<BiasedGradientScheme GradScheme>
895 template<
typename Accessor>
896 static typename Accessor::ValueType
899 using ValueType =
typename Accessor::ValueType;
906 template<
typename StencilT>
907 static typename StencilT::ValueType
910 using ValueType =
typename StencilT::ValueType;
918template<BiasedGradientScheme GradScheme>
922 template<
typename Accessor>
923 static typename Accessor::ValueType
926 using ValueType =
typename Accessor::ValueType;
933 template<
typename StencilT>
934 static typename StencilT::ValueType
937 using ValueType =
typename StencilT::ValueType;
948template<
typename MapType, DScheme DiffScheme>
952 template<
typename Accessor>
static typename Accessor::ValueType::value_type
953 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
955 using ValueType =
typename Accessor::ValueType::value_type;
958 for (
int i=0; i < 3; i++) {
962 div += ValueType(map.applyIJT(vec, ijk.
asVec3d())[i]);
968 template<
typename StencilT>
static typename StencilT::ValueType::value_type
969 result(
const MapType& map,
const StencilT& stencil)
971 using ValueType =
typename StencilT::ValueType::value_type;
974 for (
int i=0; i < 3; i++) {
978 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
986template<DScheme DiffScheme>
990 template<
typename Accessor>
static typename Accessor::ValueType::value_type
993 using ValueType =
typename Accessor::ValueType::value_type;
1001 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1004 using ValueType =
typename StencilT::ValueType::value_type;
1014template<DScheme DiffScheme>
1018 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1021 using ValueType =
typename Accessor::ValueType::value_type;
1026 ValueType invdx = ValueType(map.
getInvScale()[0]);
1031 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1034 using ValueType =
typename StencilT::ValueType::value_type;
1039 ValueType invdx = ValueType(map.
getInvScale()[0]);
1046template<DScheme DiffScheme>
1050 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1053 using ValueType =
typename Accessor::ValueType::value_type;
1058 ValueType invdx = ValueType(map.
getInvScale()[0]);
1063 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1066 using ValueType =
typename StencilT::ValueType::value_type;
1071 ValueType invdx = ValueType(map.
getInvScale()[0]);
1082 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1085 using ValueType =
typename Accessor::ValueType::value_type;
1090 return div * inv2dx;
1094 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1097 using ValueType =
typename StencilT::ValueType::value_type;
1102 return div * inv2dx;
1112 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1115 using ValueType =
typename Accessor::ValueType::value_type;
1121 return div * inv2dx;
1125 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1128 using ValueType =
typename StencilT::ValueType::value_type;
1134 return div * inv2dx;
1140template<DScheme DiffScheme>
1144 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1147 using ValueType =
typename Accessor::ValueType::value_type;
1149 ValueType div = ValueType(
1157 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1160 using ValueType =
typename StencilT::ValueType::value_type;
1173template<DScheme DiffScheme>
1177 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1180 using ValueType =
typename Accessor::ValueType::value_type;
1182 ValueType div = ValueType(
1190 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1193 using ValueType =
typename StencilT::ValueType::value_type;
1210 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1213 using ValueType =
typename Accessor::ValueType::value_type;
1215 ValueType div = ValueType(
1223 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1226 using ValueType =
typename StencilT::ValueType::value_type;
1228 ValueType div = ValueType(
1242 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1245 using ValueType =
typename Accessor::ValueType::value_type;
1247 ValueType div = ValueType(
1255 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1258 using ValueType =
typename StencilT::ValueType::value_type;
1260 ValueType div = ValueType(
1273template<
typename MapType, DScheme DiffScheme>
1277 template<
typename Accessor>
static typename Accessor::ValueType
1280 using Vec3Type =
typename Accessor::ValueType;
1282 for (
int i = 0; i < 3; i++) {
1288 mat[i] = Vec3Type(map.applyIJT(vec, ijk.
asVec3d()));
1290 return Vec3Type(mat[2][1] - mat[1][2],
1291 mat[0][2] - mat[2][0],
1292 mat[1][0] - mat[0][1]);
1296 template<
typename StencilT>
static typename StencilT::ValueType
1297 result(
const MapType& map,
const StencilT& stencil)
1299 using Vec3Type =
typename StencilT::ValueType;
1301 for (
int i = 0; i < 3; i++) {
1307 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1309 return Vec3Type(mat[2][1] - mat[1][2],
1310 mat[0][2] - mat[2][0],
1311 mat[1][0] - mat[0][1]);
1316template<DScheme DiffScheme>
1320 template<
typename Accessor>
static typename Accessor::ValueType
1323 using Vec3Type =
typename Accessor::ValueType;
1324 using ValueType =
typename Vec3Type::value_type;
1329 template<
typename StencilT>
static typename StencilT::ValueType
1332 using Vec3Type =
typename StencilT::ValueType;
1333 using ValueType =
typename Vec3Type::value_type;
1339template<DScheme DiffScheme>
1343 template<
typename Accessor>
static typename Accessor::ValueType
1346 using Vec3Type =
typename Accessor::ValueType;
1347 using ValueType =
typename Vec3Type::value_type;
1353 template<
typename StencilT>
static typename StencilT::ValueType
1356 using Vec3Type =
typename StencilT::ValueType;
1357 using ValueType =
typename Vec3Type::value_type;
1368 template<
typename Accessor>
static typename Accessor::ValueType
1371 using Vec3Type =
typename Accessor::ValueType;
1372 using ValueType =
typename Vec3Type::value_type;
1378 template<
typename StencilT>
static typename StencilT::ValueType
1381 using Vec3Type =
typename StencilT::ValueType;
1382 using ValueType =
typename Vec3Type::value_type;
1393 template<
typename Accessor>
static typename Accessor::ValueType
1396 using Vec3Type =
typename Accessor::ValueType;
1397 using ValueType =
typename Vec3Type::value_type;
1403 template<
typename StencilT>
static typename StencilT::ValueType
1406 using Vec3Type =
typename StencilT::ValueType;
1407 using ValueType =
typename Vec3Type::value_type;
1418template<
typename MapType, DDScheme DiffScheme>
1422 template<
typename Accessor>
1423 static typename Accessor::ValueType
result(
const MapType& map,
1424 const Accessor& grid,
const Coord& ijk)
1426 using ValueType =
typename Accessor::ValueType;
1437 Mat3d d2_is(iddx, iddxy, iddxz,
1439 iddxz, iddyz, iddz);
1443 d2_rs = map.applyIJC(d2_is);
1450 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1454 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1458 template<
typename StencilT>
1459 static typename StencilT::ValueType
result(
const MapType& map,
const StencilT& stencil)
1461 using ValueType =
typename StencilT::ValueType;
1472 Mat3d d2_is(iddx, iddxy, iddxz,
1474 iddxz, iddyz, iddz);
1478 d2_rs = map.applyIJC(d2_is);
1485 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1489 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1494template<DDScheme DiffScheme>
1498 template<
typename Accessor>
1500 const Accessor& grid,
const Coord& ijk)
1506 template<
typename StencilT>
1515template<DDScheme DiffScheme>
1519 template<
typename Accessor>
1521 const Accessor& grid,
const Coord& ijk)
1527 template<
typename StencilT>
1535template<DDScheme DiffScheme>
1539 template<
typename Accessor>
static typename Accessor::ValueType
1542 using ValueType =
typename Accessor::ValueType;
1548 template<
typename StencilT>
static typename StencilT::ValueType
1551 using ValueType =
typename StencilT::ValueType;
1558template<DDScheme DiffScheme>
1562 template<
typename Accessor>
static typename Accessor::ValueType
1565 using ValueType =
typename Accessor::ValueType;
1571 template<
typename StencilT>
static typename StencilT::ValueType
1574 using ValueType =
typename StencilT::ValueType;
1581template<DDScheme DiffScheme>
1585 template<
typename Accessor>
static typename Accessor::ValueType
1588 using ValueType =
typename Accessor::ValueType;
1597 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1603 template<
typename StencilT>
static typename StencilT::ValueType
1606 using ValueType =
typename StencilT::ValueType;
1615 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1622template<DDScheme DiffScheme>
1626 template<
typename Accessor>
static typename Accessor::ValueType
1629 using ValueType =
typename Accessor::ValueType;
1637 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1643 template<
typename StencilT>
static typename StencilT::ValueType
1646 using ValueType =
typename StencilT::ValueType;
1654 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1664template<
typename MapType, DScheme DiffScheme>
1671 using ValueType =
typename Accessor::ValueType;
1675 ValueType d = grid.getValue(ijk);
1684 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1691 result(
const MapType& map,
const StencilT& stencil)
1693 using ValueType =
typename StencilT::ValueType;
1697 ValueType d = stencil.template getValue<0, 0, 0>();
1703 - map.applyInverseMap(vectorFromSurface);
1706 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1707 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1717template<
typename MapType, DScheme DiffScheme>
1724 using ValueType =
typename Accessor::ValueType;
1727 ValueType d = grid.getValue(ijk);
1730 Vec3Type vectorFromSurface =
1739 result(
const MapType& map,
const StencilT& stencil)
1741 using ValueType =
typename StencilT::ValueType;
1744 ValueType d = stencil.template getValue<0, 0, 0>();
1747 Vec3Type vectorFromSurface =
1749 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1760template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1767 template<
typename Accessor>
1768 static bool compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1769 double& alpha,
double& beta)
1771 using ValueType =
typename Accessor::ValueType;
1778 d1_ws = map.applyIJT(d1_is);
1780 d1_ws = map.applyIJT(d1_is, ijk.
asVec3d());
1782 const double Dx2 = d1_ws(0)*d1_ws(0);
1783 const double Dy2 = d1_ws(1)*d1_ws(1);
1784 const double Dz2 = d1_ws(2)*d1_ws(2);
1785 const double normGrad = Dx2 + Dy2 + Dz2;
1801 Mat3d d2_is(iddx, iddxy, iddxz,
1803 iddxz, iddyz, iddz);
1808 d2_ws = map.applyIJC(d2_is);
1810 d2_ws = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1814 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1815 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1816 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1817 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1822 template<
typename Accessor>
1823 static typename Accessor::ValueType
result(
const MapType& map,
1824 const Accessor& grid,
const Coord& ijk)
1826 using ValueType =
typename Accessor::ValueType;
1828 return compute(map, grid, ijk, alpha, beta) ?
1832 template<
typename Accessor>
1833 static typename Accessor::ValueType
normGrad(
const MapType& map,
1834 const Accessor& grid,
const Coord& ijk)
1836 using ValueType =
typename Accessor::ValueType;
1838 return compute(map, grid, ijk, alpha, beta) ?
1846 template<
typename StencilT>
1847 static bool compute(
const MapType& map,
const StencilT& stencil,
1848 double& alpha,
double& beta)
1850 using ValueType =
typename StencilT::ValueType;
1857 d1_ws = map.applyIJT(d1_is);
1859 d1_ws = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1861 const double Dx2 = d1_ws(0)*d1_ws(0);
1862 const double Dy2 = d1_ws(1)*d1_ws(1);
1863 const double Dz2 = d1_ws(2)*d1_ws(2);
1864 const double normGrad = Dx2 + Dy2 + Dz2;
1880 Mat3d d2_is(iddx, iddxy, iddxz,
1882 iddxz, iddyz, iddz);
1887 d2_ws = map.applyIJC(d2_is);
1889 d2_ws = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1893 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1894 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1895 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1896 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1901 template<
typename StencilT>
1902 static typename StencilT::ValueType
1903 result(
const MapType& map,
const StencilT stencil)
1905 using ValueType =
typename StencilT::ValueType;
1907 return compute(map, stencil, alpha, beta) ?
1911 template<
typename StencilT>
1912 static typename StencilT::ValueType
normGrad(
const MapType& map,
const StencilT stencil)
1914 using ValueType =
typename StencilT::ValueType;
1916 return compute(map, stencil, alpha, beta) ?
1922template<DDScheme DiffScheme2, DScheme DiffScheme1>
1926 template<
typename Accessor>
1928 const Accessor& grid,
const Coord& ijk)
1930 using ValueType =
typename Accessor::ValueType;
1932 ValueType alpha, beta;
1937 template<
typename Accessor>
1939 const Accessor& grid,
const Coord& ijk)
1941 using ValueType =
typename Accessor::ValueType;
1943 ValueType alpha, beta;
1949 template<
typename StencilT>
1952 using ValueType =
typename StencilT::ValueType;
1954 ValueType alpha, beta;
1959 template<
typename StencilT>
1962 using ValueType =
typename StencilT::ValueType;
1964 ValueType alpha, beta;
1971template<DDScheme DiffScheme2, DScheme DiffScheme1>
1975 template<
typename Accessor>
1977 const Accessor& grid,
const Coord& ijk)
1979 using ValueType =
typename Accessor::ValueType;
1981 ValueType alpha, beta;
1984 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1989 template<
typename Accessor>
1991 const Accessor& grid,
const Coord& ijk)
1993 using ValueType =
typename Accessor::ValueType;
1995 ValueType alpha, beta;
1998 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2004 template<
typename StencilT>
2007 using ValueType =
typename StencilT::ValueType;
2009 ValueType alpha, beta;
2012 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2017 template<
typename StencilT>
2020 using ValueType =
typename StencilT::ValueType;
2022 ValueType alpha, beta;
2025 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2032template<DDScheme DiffScheme2, DScheme DiffScheme1>
2036 template<
typename Accessor>
static typename Accessor::ValueType
2039 using ValueType =
typename Accessor::ValueType;
2041 ValueType alpha, beta;
2044 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2049 template<
typename Accessor>
static typename Accessor::ValueType
2052 using ValueType =
typename Accessor::ValueType;
2054 ValueType alpha, beta;
2057 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2063 template<
typename StencilT>
static typename StencilT::ValueType
2066 using ValueType =
typename StencilT::ValueType;
2068 ValueType alpha, beta;
2071 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2076 template<
typename StencilT>
static typename StencilT::ValueType
2079 using ValueType =
typename StencilT::ValueType;
2081 ValueType alpha, beta;
2084 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2098 template<
typename Gr
idType>
2113 {
return mMap->applyIJC(m,v,pos); }
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:26
Vec3d asVec3d() const
Definition Coord.h:144
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition Coord.h:92
double determinant(const Vec3d &in) const
Definition Operators.h:2116
Vec3d voxelSize() const
Definition Operators.h:2118
GenericMap(const GridType &g)
Definition Operators.h:2099
double determinant() const
Definition Operators.h:2115
Vec3d applyMap(const Vec3d &in) const
Definition Operators.h:2106
GenericMap(MapBase::ConstPtr map)
Definition Operators.h:2103
Vec3d applyInverseMap(const Vec3d &in) const
Definition Operators.h:2107
GenericMap(const Transform &t)
Definition Operators.h:2101
Mat3d applyIJC(const Mat3d &m) const
Definition Operators.h:2111
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition Operators.h:2110
Vec3d voxelSize(const Vec3d &v) const
Definition Operators.h:2119
Vec3d applyIJT(const Vec3d &in) const
Definition Operators.h:2109
GenericMap(MapBase::Ptr map)
Definition Operators.h:2102
~GenericMap()
Definition Operators.h:2104
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition Operators.h:2112
Abstract base class for maps.
Definition Maps.h:135
SharedPtr< MapBase > Ptr
Definition Maps.h:137
SharedPtr< const MapBase > ConstPtr
Definition Maps.h:138
Definition Stencils.h:822
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition Maps.h:656
const Vec3d & getInvScale() const
Return 1/(scale)
Definition Maps.h:802
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition Maps.h:800
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition Maps.h:798
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition Maps.h:1163
const Vec3d & getInvScale() const
Return 1/(scale)
Definition Maps.h:1347
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition Maps.h:1345
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition Maps.h:1343
Definition Stencils.h:247
Definition Stencils.h:552
A specialized linear transform that performs a translation.
Definition Maps.h:978
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection.
Definition Maps.h:1621
Mat3< double > Mat3d
Definition Mat3.h:834
Real GodunovsNormSqrd(bool isOutside, Real dP_xm, Real dP_xp, Real dP_ym, Real dP_yp, Real dP_zm, Real dP_zp)
Definition FiniteDifference.h:325
DScheme
Different discrete schemes used in the first derivatives.
Definition FiniteDifference.h:31
@ FD_2ND
Definition FiniteDifference.h:38
@ BD_3RD
Definition FiniteDifference.h:42
@ FD_HJWENO5
Definition FiniteDifference.h:45
@ FD_WENO5
Definition FiniteDifference.h:43
@ BD_2ND
Definition FiniteDifference.h:41
@ FD_1ST
Definition FiniteDifference.h:37
@ BD_HJWENO5
Definition FiniteDifference.h:46
@ CD_2ND
Definition FiniteDifference.h:34
@ BD_WENO5
Definition FiniteDifference.h:44
@ BD_1ST
Definition FiniteDifference.h:40
@ FD_3RD
Definition FiniteDifference.h:39
@ CD_SIXTH
Definition FiniteDifference.h:153
@ CD_FOURTH
Definition FiniteDifference.h:152
@ CD_SECOND
Definition FiniteDifference.h:151
Vec3< double > Vec3d
Definition Vec3.h:665
@ FIRST_BIAS
Definition FiniteDifference.h:166
@ THIRD_BIAS
Definition FiniteDifference.h:168
@ WENO5_BIAS
Definition FiniteDifference.h:169
@ SECOND_BIAS
Definition FiniteDifference.h:167
@ HJWENO5_BIAS
Definition FiniteDifference.h:170
Type Pow3(Type x)
Return x3.
Definition Math.h:552
Type Pow2(Type x)
Return x2.
Definition Math.h:548
SharedPtr< T > ConstPtrCast(const SharedPtr< U > &ptr)
Return a new shared pointer that points to the same object as the given pointer but with possibly dif...
Definition Types.h:126
Definition Exceptions.h:13
Defines various finite difference stencils by means of the "curiously recurring template pattern" on ...
Definition Operators.h:134
SevenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:135
Definition Operators.h:145
SevenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:146
static const DScheme FD
Definition Operators.h:141
static const DScheme BD
Definition Operators.h:142
Definition Operators.h:186
NineteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:187
static const DScheme FD
Definition Operators.h:182
static const DScheme BD
Definition Operators.h:183
Definition Operators.h:156
ThirteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:157
static const DScheme FD
Definition Operators.h:152
static const DScheme BD
Definition Operators.h:153
Definition Operators.h:166
NineteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:167
static const DScheme FD
Definition Operators.h:162
static const DScheme BD
Definition Operators.h:163
Definition Operators.h:176
NineteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:177
static const DScheme FD
Definition Operators.h:172
static const DScheme BD
Definition Operators.h:173
Definition Operators.h:129
static const DScheme FD
Definition Operators.h:130
static const DScheme BD
Definition Operators.h:131
Compute the closest-point transform to a level set.
Definition Operators.h:1719
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1739
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1722
Compute the closest-point transform to a level set.
Definition Operators.h:1666
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1691
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1669
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition Operators.h:1275
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1297
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1278
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition FiniteDifference.h:1504
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition FiniteDifference.h:1491
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition FiniteDifference.h:1498
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1211
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:1224
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1145
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:1158
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1256
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1243
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1191
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1178
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1002
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:991
Compute the divergence of a vector-valued grid using differencing of various orders,...
Definition Operators.h:950
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:953
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition Operators.h:969
Biased gradient operators, defined with respect to the range-space of the map.
Definition Operators.h:825
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk, const Vec3< typename Accessor::ValueType > &V)
Definition Operators.h:828
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition Operators.h:840
Definition Operators.h:858
static const DScheme FD
Definition Operators.h:859
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition Operators.h:879
static const DScheme BD
Definition Operators.h:860
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:866
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:757
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:738
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:801
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:782
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:652
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:660
Center difference gradient operators, defined with respect to the range-space of the map.
Definition Operators.h:620
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:624
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition Operators.h:635
Curl operator defined in index space using various first derivative schemes.
Definition Operators.h:499
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:515
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:502
Divergence operator defined in index space using various first derivative schemes.
Definition Operators.h:473
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:476
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition Operators.h:485
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition Operators.h:197
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition Operators.h:204
static const DScheme FD
Definition Operators.h:198
static const DScheme BD
Definition Operators.h:199
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition Operators.h:217
Definition Operators.h:231
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:252
static const DScheme FD
Definition Operators.h:232
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:239
static const DScheme BD
Definition Operators.h:233
Gradient operators defined in index space of various orders.
Definition Operators.h:100
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:103
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition Operators.h:114
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:405
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:388
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:374
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:364
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:447
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:426
Laplacian defined in index space, using various center-difference stencils.
Definition Operators.h:348
static StencilT::ValueType result(const StencilT &stencil)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Compute the mean curvature in index space.
Definition Operators.h:533
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Random access version.
Definition Operators.h:539
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Stencil access version.
Definition Operators.h:577
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition Operators.h:52
static double result(const AccessorType &grid, const Coord &ijk)
Definition Operators.h:54
static double result(const StencilType &stencil)
Definition Operators.h:59
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1586
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:1604
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1627
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1644
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1499
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1507
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1520
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition Operators.h:1528
Compute the Laplacian at a given location in a grid using finite differencing of various orders....
Definition Operators.h:1420
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1459
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1423
ResultType result(const StencilType &stencil)
Definition Operators.h:44
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition Operators.h:40
const MapType map
Definition Operators.h:46
MapAdapter(const MapType &m)
Definition Operators.h:36
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1927
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1950
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1960
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1938
Compute the mean curvature.
Definition Operators.h:1762
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition Operators.h:1912
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Random access version.
Definition Operators.h:1768
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1833
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Stencil access version.
Definition Operators.h:1847
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition Operators.h:1903
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1823
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition Operators.h:66
static double result(const MapT &map, const StencilType &stencil)
Definition Operators.h:73
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition Operators.h:68
static T value()
Definition Math.h:148
static const bool value
Definition Operators.h:26
Definition Operators.h:25
static const bool value
Definition Operators.h:25
static const bool value
Definition Maps.h:55
static const bool value
Definition Operators.h:23
Definition Operators.h:22
static const bool value
Definition Operators.h:22
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:218