6 #ifndef OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 7 #define OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 22 template<
typename Vec3T>
struct is_vec3d {
static const bool value =
false; };
34 template<
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); }
51 template<
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());
65 template<
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;
98 template<DScheme DiffScheme>
105 using ValueType =
typename Accessor::ValueType;
116 using ValueType =
typename StencilT::ValueType;
128 template<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>
195 template<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;
229 template<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;
263 #ifdef DWA_OPENVDB // for SIMD - note will do the computations in float 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),
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),
340 #endif //DWA_OPENVDB // for SIMD - note will do the computations in float 346 template<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>());
471 template<DScheme DiffScheme>
475 template<
typename Accessor>
static typename Accessor::ValueType::value_type
484 template<
typename StencilT>
static typename StencilT::ValueType::value_type
497 template<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;
531 template<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)));
618 template<
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()));
646 template<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));
823 template<
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()));
856 template<
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;
891 template<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;
918 template<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;
948 template<
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]);
986 template<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;
1014 template<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]);
1046 template<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;
1140 template<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;
1173 template<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(
1273 template<
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]);
1316 template<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;
1339 template<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;
1418 template<
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));
1494 template<DDScheme DiffScheme>
1498 template<
typename Accessor>
1500 const Accessor& grid,
const Coord& ijk)
1506 template<
typename StencilT>
1515 template<DDScheme DiffScheme>
1519 template<
typename Accessor>
1521 const Accessor& grid,
const Coord& ijk)
1527 template<
typename StencilT>
1535 template<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;
1558 template<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;
1581 template<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];
1622 template<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];
1664 template<
typename MapType, DScheme DiffScheme>
1671 using ValueType =
typename Accessor::ValueType;
1675 ValueType d = grid.getValue(ijk);
1680 Vec3d result = ijk.
asVec3d() - map.applyInverseMap(vectorFromSurface);
1681 return Vec3Type(result);
1684 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1685 return Vec3Type(result);
1691 result(
const MapType& map,
const StencilT& stencil)
1693 using ValueType =
typename StencilT::ValueType;
1697 ValueType d = stencil.template getValue<0, 0, 0>();
1702 Vec3d result = stencil.getCenterCoord().asVec3d()
1703 - map.applyInverseMap(vectorFromSurface);
1704 return Vec3Type(result);
1706 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1707 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1708 return Vec3Type(result);
1717 template<
typename MapType, DScheme DiffScheme>
1724 using ValueType =
typename Accessor::ValueType;
1727 ValueType d = grid.getValue(ijk);
1730 Vec3Type vectorFromSurface =
1732 Vec3d result = map.applyMap(ijk.
asVec3d()) - vectorFromSurface;
1734 return Vec3Type(result);
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;
1751 return Vec3Type(result);
1760 template<
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)));
1818 beta = std::sqrt(normGrad);
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)));
1897 beta = std::sqrt(normGrad);
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) ?
1922 template<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;
1971 template<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)));
2032 template<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); }
2129 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1833
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1256
double determinant() const
Definition: Operators.h:2115
Vec3d applyIJT(const Vec3d &in) const
Definition: Operators.h:2109
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1211
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:812
static double result(const MapT &map, const StencilType &stencil)
Definition: Operators.h:73
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:502
Gradient operators defined in index space of various orders.
Definition: Operators.h:99
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:447
Definition: FiniteDifference.h:152
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition: Operators.h:2112
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Random access version.
Definition: Operators.h:1768
Definition: FiniteDifference.h:153
static double result(const StencilType &stencil)
Definition: Operators.h:59
Compute the divergence of a vector-valued grid using differencing of various orders, the result defined with respect to the range-space of the map.
Definition: Operators.h:949
Definition: FiniteDifference.h:170
const MapType map
Definition: Operators.h:46
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1363
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: FiniteDifference.h:43
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 Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1278
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:326
Definition: FiniteDifference.h:41
Compute the mean curvature.
Definition: Operators.h:1761
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1178
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1938
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1604
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:738
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition: Operators.h:66
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:374
Laplacian defined in index space, using various center-difference stencils.
Definition: Operators.h:347
Vec3d applyInverseMap(const Vec3d &in) const
Definition: Operators.h:2107
Definition: FiniteDifference.h:1487
Definition: FiniteDifference.h:171
SharedPtr< MapBase > Ptr
Definition: Maps.h:137
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1586
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1520
Definition: FiniteDifference.h:167
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1691
Tolerance for floating-point comparison.
Definition: Math.h:147
Definition: Operators.h:25
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Stencil access version.
Definition: Operators.h:1847
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:991
Definition: FiniteDifference.h:46
Biased gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:824
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:24
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:32
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Definition: Operators.h:35
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1950
Vec3d voxelSize(const Vec3d &v) const
Definition: Operators.h:2119
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition: Operators.h:2110
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:669
Definition: Operators.h:134
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Stencil access version.
Definition: Operators.h:577
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:364
Vec3d voxelSize() const
Definition: Operators.h:2118
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:757
Definition: FiniteDifference.h:45
Definition: Operators.h:857
GenericMap(MapBase::ConstPtr map)
Definition: Operators.h:2103
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:426
Definition: Stencils.h:550
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1627
Abstract base class for maps.
Definition: Maps.h:134
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition: Operators.h:840
Definition: FiniteDifference.h:44
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:472
Map traits.
Definition: Maps.h:55
Type Pow3(Type x)
Return x3.
Definition: Math.h:555
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:782
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1158
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:405
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:68
GenericMap(const GridType &g)
Definition: Operators.h:2099
Curl operator defined in index space using various first derivative schemes.
Definition: Operators.h:498
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1459
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition: Operators.h:1528
Definition: Stencils.h:246
Definition: FiniteDifference.h:42
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:969
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1722
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1507
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1145
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:660
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:252
SharedPtr< const MapBase > ConstPtr
Definition: Maps.h:138
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
Definition: Maps.h:1638
Definition: Exceptions.h:13
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1178
Definition: Operators.h:129
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:953
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:879
Compute the closest-point transform to a level set.
Definition: Operators.h:1718
ValueT value
Definition: GridBuilder.h:1287
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:624
Center difference gradient operators, defined with respect to the range-space of the map...
Definition: Operators.h:619
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1927
Definition: FiniteDifference.h:1765
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition: Operators.h:1912
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:304
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
Definition: Operators.h:1419
Definition: FiniteDifference.h:47
MapAdapter(const MapType &m)
Definition: Operators.h:36
Compute the closest-point transform to a level set.
Definition: Operators.h:1665
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1191
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:814
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:476
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1499
Definition: Stencils.h:820
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:388
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:866
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1739
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition: Operators.h:1274
Definition: FiniteDifference.h:40
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
Definition: FiniteDifference.h:39
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:239
GridType
List of types that are currently supported by NanoVDB.
Definition: NanoVDB.h:216
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition: Operators.h:196
Definition: FiniteDifference.h:35
Definition: Operators.h:22
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition: Operators.h:114
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition: Operators.h:52
Vec3d applyMap(const Vec3d &in) const
Definition: Operators.h:2106
Definition: FiniteDifference.h:38
Definition: Operators.h:230
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:91
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:40
static double result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:54
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:103
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:652
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1823
A specialized linear transform that performs a translation.
Definition: Maps.h:993
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1361
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:816
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1644
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1423
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1960
Definition: FiniteDifference.h:168
Definition: FiniteDifference.h:416
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition: Operators.h:485
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1359
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition: Operators.h:1903
Type Pow2(Type x)
Return x2.
Definition: Math.h:551
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:515
Definition: FiniteDifference.h:169
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1243
double determinant(const Vec3d &in) const
Definition: Operators.h:2116
Definition: FiniteDifference.h:154
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1669
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:635
Vec3d asVec3d() const
Definition: Coord.h:143
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1224
Mat3d applyIJC(const Mat3d &m) const
Definition: Operators.h:2111
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1297
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1002
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition: Operators.h:217
GenericMap(const Transform &t)
Definition: Operators.h:2101
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition: Operators.h:204
Compute the mean curvature in index space.
Definition: Operators.h:532
ResultType result(const StencilType &stencil)
Definition: Operators.h:44
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Definition: Operators.h:2095
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:202
~GenericMap()
Definition: Operators.h:2104
GenericMap(MapBase::Ptr map)
Definition: Operators.h:2102
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:801