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>
42 template<
typename StencilType>
51 template<
typename OpType>
53 template<
typename AccessorType>
54 static inline double result(
const AccessorType& grid,
const Coord& ijk) {
58 template<
typename StencilType>
65 template<
typename OpType,
typename MapT>
67 template<
typename AccessorType>
68 static inline double result(
const MapT& map,
const AccessorType& grid,
const Coord& ijk) {
72 template<
typename StencilType>
73 static inline double result(
const MapT& map,
const StencilType&
stencil) {
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>
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_) {}
284 v1(valueAt(ijk.offsetBy(-2, 0, 0)) - valueAt(ijk.offsetBy(-3, 0, 0)),
285 valueAt(ijk.offsetBy( 0,-2, 0)) - valueAt(ijk.offsetBy( 0,-3, 0)),
286 valueAt(ijk.offsetBy( 0, 0,-2)) - valueAt(ijk.offsetBy( 0, 0,-3)), 0),
287 v2(valueAt(ijk.offsetBy(-1, 0, 0)) - valueAt(ijk.offsetBy(-2, 0, 0)),
288 valueAt(ijk.offsetBy( 0,-1, 0)) - valueAt(ijk.offsetBy( 0,-2, 0)),
289 valueAt(ijk.offsetBy( 0, 0,-1)) - valueAt(ijk.offsetBy( 0, 0,-2)), 0),
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),
296 v5(valueAt(ijk.offsetBy( 2, 0, 0)) - valueAt(ijk.offsetBy( 1, 0, 0)),
297 valueAt(ijk.offsetBy( 0, 2, 0)) - valueAt(ijk.offsetBy( 0, 1, 0)),
298 valueAt(ijk.offsetBy( 0, 0, 2)) - valueAt(ijk.offsetBy( 0, 0, 1)), 0),
299 v6(valueAt(ijk.offsetBy( 3, 0, 0)) - valueAt(ijk.offsetBy( 2, 0, 0)),
300 valueAt(ijk.offsetBy( 0, 3, 0)) - valueAt(ijk.offsetBy( 0, 2, 0)),
301 valueAt(ijk.offsetBy( 0, 0, 3)) - valueAt(ijk.offsetBy( 0, 0, 2)), 0),
309 template<
typename StencilT>
310 static typename StencilT::ValueType
result(
const StencilT&
s)
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)) +
368 grid.getValue(ijk.offsetBy(0,0,1)) + grid.getValue(ijk.offsetBy(0, 0,-1))
369 - 6*grid.getValue(ijk);
373 template<
typename StencilT>
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>
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>
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>
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>
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>
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
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
652 result(
const TranslationMap&,
const Accessor& grid,
const Coord& ijk)
658 template<
typename StencilT>
659 static typename internal::ReturnValue<StencilT>::Vec3Type
672 template<
typename Accessor>
673 static typename internal::ReturnValue<Accessor>::Vec3Type
674 result(
const UniformScaleMap& map,
const Accessor& grid,
const Coord& ijk)
676 using ValueType =
typename internal::ReturnValue<Accessor>::ValueType;
677 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
680 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
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;
693 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
694 return iGradient * inv2dx;
704 template<
typename Accessor>
705 static typename internal::ReturnValue<Accessor>::Vec3Type
706 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
708 using ValueType =
typename internal::ReturnValue<Accessor>::ValueType;
709 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
712 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
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;
725 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
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()));
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
881 using ValueType =
typename StencilT::ValueType;
891 template<BiasedGradientScheme GradScheme>
895 template<
typename Accessor>
896 static typename Accessor::ValueType
897 result(
const UniformScaleMap& map,
const Accessor& grid,
const Coord& ijk)
899 using ValueType =
typename Accessor::ValueType;
901 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
906 template<
typename StencilT>
907 static typename StencilT::ValueType
910 using ValueType =
typename StencilT::ValueType;
912 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
918 template<BiasedGradientScheme GradScheme>
922 template<
typename Accessor>
923 static typename Accessor::ValueType
924 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
926 using ValueType =
typename Accessor::ValueType;
928 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
933 template<
typename StencilT>
934 static typename StencilT::ValueType
937 using ValueType =
typename StencilT::ValueType;
939 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
948 template<
typename MapType, DScheme DiffScheme>
953 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
958 for (
int i=0; i < 3; i++) {
962 div += ValueType(map.applyIJT(vec, ijk.asVec3d())[i]);
974 for (
int i=0; i < 3; i++) {
978 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
986 template<DScheme DiffScheme>
991 result(
const TranslationMap&,
const Accessor& grid,
const Coord& ijk)
1014 template<DScheme DiffScheme>
1019 result(
const UniformScaleMap& map,
const Accessor& grid,
const Coord& ijk)
1026 ValueType invdx = ValueType(map.getInvScale()[0]);
1039 ValueType invdx = ValueType(map.getInvScale()[0]);
1046 template<DScheme DiffScheme>
1051 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
1058 ValueType invdx = ValueType(map.getInvScale()[0]);
1071 ValueType invdx = ValueType(map.getInvScale()[0]);
1083 result(
const UniformScaleMap& map,
const Accessor& grid,
const Coord& ijk)
1089 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
1090 return div * inv2dx;
1101 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
1102 return div * inv2dx;
1113 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
1120 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
1121 return div * inv2dx;
1133 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
1134 return div * inv2dx;
1140 template<DScheme DiffScheme>
1149 ValueType
div = ValueType(
1173 template<DScheme DiffScheme>
1182 ValueType
div = ValueType(
1215 ValueType
div = ValueType(
1228 ValueType
div = ValueType(
1247 ValueType
div = ValueType(
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
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>
1317 struct Curl<UniformScaleMap, DiffScheme>
1320 template<
typename Accessor>
static typename Accessor::ValueType
1321 result(
const UniformScaleMap& map,
const Accessor& grid,
const Coord& ijk)
1323 using Vec3Type =
typename Accessor::ValueType;
1329 template<
typename StencilT>
static typename StencilT::ValueType
1332 using Vec3Type =
typename StencilT::ValueType;
1339 template<DScheme DiffScheme>
1340 struct Curl<UniformScaleTranslateMap, DiffScheme>
1343 template<
typename Accessor>
static typename Accessor::ValueType
1344 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
1346 using Vec3Type =
typename Accessor::ValueType;
1353 template<
typename StencilT>
static typename StencilT::ValueType
1356 using Vec3Type =
typename StencilT::ValueType;
1368 template<
typename Accessor>
static typename Accessor::ValueType
1369 result(
const UniformScaleMap& map,
const Accessor& grid,
const Coord& ijk)
1371 using Vec3Type =
typename Accessor::ValueType;
1378 template<
typename StencilT>
static typename StencilT::ValueType
1381 using Vec3Type =
typename StencilT::ValueType;
1393 template<
typename Accessor>
static typename Accessor::ValueType
1394 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
1396 using Vec3Type =
typename Accessor::ValueType;
1403 template<
typename StencilT>
static typename StencilT::ValueType
1406 using Vec3Type =
typename StencilT::ValueType;
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>
1499 static typename Accessor::ValueType
result(
const TranslationMap&,
1500 const Accessor& grid,
const Coord& ijk)
1506 template<
typename StencilT>
1507 static typename StencilT::ValueType
result(
const TranslationMap&,
const StencilT&
stencil)
1515 template<DDScheme DiffScheme>
1519 template<
typename Accessor>
1520 static typename Accessor::ValueType
result(
const UnitaryMap&,
1521 const Accessor& grid,
const Coord& ijk)
1527 template<
typename StencilT>
1528 static typename StencilT::ValueType
result(
const UnitaryMap&,
const StencilT&
stencil)
1535 template<DDScheme DiffScheme>
1539 template<
typename Accessor>
static typename Accessor::ValueType
1540 result(
const UniformScaleMap& map,
const Accessor& grid,
const Coord& ijk)
1542 using ValueType =
typename Accessor::ValueType;
1543 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
1548 template<
typename StencilT>
static typename StencilT::ValueType
1551 using ValueType =
typename StencilT::ValueType;
1552 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
1558 template<DDScheme DiffScheme>
1562 template<
typename Accessor>
static typename Accessor::ValueType
1563 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
1565 using ValueType =
typename Accessor::ValueType;
1566 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
1571 template<
typename StencilT>
static typename StencilT::ValueType
1574 using ValueType =
typename StencilT::ValueType;
1575 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
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);
1693 using ValueType =
typename StencilT::ValueType;
1697 ValueType d = stencil.template getValue<0, 0, 0>();
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);
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)));
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>
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
1905 using ValueType =
typename StencilT::ValueType;
1907 return compute(map, stencil, alpha, beta) ?
1911 template<
typename StencilT>
1914 using ValueType =
typename StencilT::ValueType;
1916 return compute(map, stencil, alpha, beta) ?
1922 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1926 template<
typename Accessor>
1927 static typename Accessor::ValueType
result(
const TranslationMap&,
1928 const Accessor& grid,
const Coord& ijk)
1930 using ValueType =
typename Accessor::ValueType;
1932 ValueType
alpha, beta;
1937 template<
typename Accessor>
1938 static typename Accessor::ValueType
normGrad(
const TranslationMap&,
1939 const Accessor& grid,
const Coord& ijk)
1941 using ValueType =
typename Accessor::ValueType;
1943 ValueType
alpha, beta;
1949 template<
typename StencilT>
1950 static typename StencilT::ValueType
result(
const TranslationMap&,
const StencilT&
stencil)
1952 using ValueType =
typename StencilT::ValueType;
1954 ValueType
alpha, beta;
1959 template<
typename StencilT>
1960 static typename StencilT::ValueType
normGrad(
const TranslationMap&,
const StencilT&
stencil)
1962 using ValueType =
typename StencilT::ValueType;
1964 ValueType
alpha, beta;
1971 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1975 template<
typename Accessor>
1976 static typename Accessor::ValueType
result(
const UniformScaleMap& map,
1977 const Accessor& grid,
const Coord& ijk)
1979 using ValueType =
typename Accessor::ValueType;
1981 ValueType
alpha, beta;
1983 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
1984 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1989 template<
typename Accessor>
1990 static typename Accessor::ValueType
normGrad(
const UniformScaleMap& map,
1991 const Accessor& grid,
const Coord& ijk)
1993 using ValueType =
typename Accessor::ValueType;
1995 ValueType
alpha, beta;
1997 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
1998 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2004 template<
typename StencilT>
2005 static typename StencilT::ValueType
result(
const UniformScaleMap& map,
const StencilT&
stencil)
2007 using ValueType =
typename StencilT::ValueType;
2009 ValueType
alpha, beta;
2011 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
2012 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2017 template<
typename StencilT>
2018 static typename StencilT::ValueType
normGrad(
const UniformScaleMap& map,
const StencilT&
stencil)
2020 using ValueType =
typename StencilT::ValueType;
2022 ValueType
alpha, beta;
2024 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
2025 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2032 template<DDScheme DiffScheme2, DScheme DiffScheme1>
2036 template<
typename Accessor>
static typename Accessor::ValueType
2037 result(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
2039 using ValueType =
typename Accessor::ValueType;
2041 ValueType
alpha, beta;
2043 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
2044 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2049 template<
typename Accessor>
static typename Accessor::ValueType
2050 normGrad(
const UniformScaleTranslateMap& map,
const Accessor& grid,
const Coord& ijk)
2052 using ValueType =
typename Accessor::ValueType;
2054 ValueType
alpha, beta;
2056 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
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;
2070 ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
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;
2083 ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
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 bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Random access version.
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
GenericMap(MapBase::Ptr map)
GA_API const UT_StringHolder div
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType normGrad(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Adapter for vector-valued world-space operators to return the vector magnitude.
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
static StencilT::ValueType normGrad(const UniformScaleTranslateMap &map, const StencilT &stencil)
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const StencilT &stencil)
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
GenericMap(MapBase::ConstPtr map)
Type Pow2(Type x)
Return x2.
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
static StencilT::ValueType result(const StencilT &stencil)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
double determinant(const Vec3d &in) const
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType normGrad(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
ResultType result(const StencilType &stencil)
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
vfloat4 sqrt(const vfloat4 &a)
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
GenericMap(const GridType &g)
Curl operator defined in index space using various first derivative schemes.
#define OPENVDB_USE_VERSION_NAMESPACE
Adapter for vector-valued index-space operators to return the vector magnitude.
SharedPtr< const MapBase > ConstPtr
Vec3d applyMap(const Vec3d &in) const
static double result(const MapT &map, const StencilType &stencil)
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Laplacian defined in index space, using various center-difference stencils.
Mat3d applyIJC(const Mat3d &m) const
Signed (x, y, z) 32-bit integer coordinates.
static double result(const StencilType &stencil)
Tolerance for floating-point comparison.
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Vec3d applyInverseMap(const Vec3d &in) const
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...
Compute the closest-point transform to a level set.
Vec3d applyIJT(const Vec3d &in) const
DScheme
Different discrete schemes used in the first derivatives.
GLuint GLenum GLenum transform
static StencilT::ValueType result(const StencilT &stencil)
const Vec3d & getInvScale() const
Return 1/(scale)
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
static double result(const AccessorType &grid, const Coord &ijk)
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
double determinant() const
GLfloat GLfloat GLfloat v2
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Stencil access version.
Compute the mean curvature.
static StencilT::ValueType result(const StencilT &stencil)
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Type Pow3(Type x)
Return x3.
static StencilT::ValueType normGrad(const UniformScaleMap &map, const StencilT &stencil)
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
GLfloat GLfloat GLfloat GLfloat v3
Center difference gradient operators, defined with respect to the range-space of the map...
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
GLuint GLsizei GLsizei * length
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
GenericMap(const Transform &t)
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Biased gradient operators, defined with respect to the range-space of the map.
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
GA_API const UT_StringHolder up
Compute the mean curvature in index space.
ResultType result(const AccessorType &grid, const Coord &ijk)
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Random access version.
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Compute the closest-point transform to a level set.
GLsizei const GLfloat * value
Defines various finite difference stencils by means of the "curiously recurring template pattern" on ...
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Vec3d voxelSize(const Vec3d &v) const
MapAdapter(const MapType &m)
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
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.
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Stencil access version.
const Vec3d & getInvScale() const
Return 1/(scale)
static StencilT::ValueType result(const StencilT &stencil)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Gradient operators defined in index space of various orders.
GLint GLfloat GLint stencil
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Divergence operator defined in index space using various first derivative schemes.
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
static StencilT::ValueType::value_type result(const StencilT &stencil)
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
GLfloat GLfloat GLfloat alpha
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Abstract base class for maps.
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk, const Vec3< typename Accessor::ValueType > &V)
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Real GodunovsNormSqrd(bool isOutside, Real dP_xm, Real dP_xp, Real dP_ym, Real dP_yp, Real dP_zm, Real dP_zp)
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
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.
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)