33 #ifndef OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 34 #define OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 48 template<
typename Vec3T>
struct is_vec3d {
static const bool value =
false; };
51 template<
typename T>
struct is_double {
static const bool value =
false; };
52 template<>
struct is_double<double> {
static const bool value =
true; };
60 template<
typename MapType,
typename OpType,
typename ResultType>
64 template<
typename AccessorType>
66 result(
const AccessorType& grid,
const Coord& ijk) {
return OpType::result(map, grid, ijk); }
68 template<
typename StencilType>
70 result(
const StencilType& stencil) {
return OpType::result(map, stencil); }
77 template<
typename OpType>
79 template<
typename AccessorType>
80 static inline double result(
const AccessorType& grid,
const Coord& ijk) {
81 return double(OpType::result(grid, ijk).length());
84 template<
typename StencilType>
85 static inline double result(
const StencilType& stencil) {
86 return double(OpType::result(stencil).length());
91 template<
typename OpType,
typename MapT>
93 template<
typename AccessorType>
94 static inline double result(
const MapT& map,
const AccessorType& grid,
const Coord& ijk) {
95 return double(OpType::result(map, grid, ijk).length());
98 template<
typename StencilType>
99 static inline double result(
const MapT& map,
const StencilType& stencil) {
100 return double(OpType::result(map, stencil).length());
120 template<DScheme DiffScheme>
128 using ValueType =
typename Accessor::ValueType;
139 using ValueType =
typename StencilT::ValueType;
151 template<BiasedGradientScheme bgs>
156 template<
typename Gr
idType,
bool IsSafe = true>
167 template<
typename Gr
idType,
bool IsSafe = true>
178 template<
typename Gr
idType,
bool IsSafe = true>
188 template<
typename Gr
idType,
bool IsSafe = true>
198 template<
typename Gr
idType,
bool IsSafe = true>
208 template<
typename Gr
idType,
bool IsSafe = true>
218 template<BiasedGradientScheme GradScheme,
typename Vec3Bias>
225 template<
typename Accessor>
229 using ValueType =
typename Accessor::ValueType;
238 template<
typename StencilT>
240 result(
const StencilT& stencil,
const Vec3Bias& V)
242 using ValueType =
typename StencilT::ValueType;
252 template<BiasedGradientScheme GradScheme>
260 template<
typename Accessor>
261 static typename Accessor::ValueType
264 using ValueType =
typename Accessor::ValueType;
273 template<
typename StencilT>
274 static typename StencilT::ValueType
277 using ValueType =
typename StencilT::ValueType;
286 #ifdef DWA_OPENVDB // for SIMD - note will do the computations in float 291 template<
typename Accessor>
292 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk)
297 GetValue(
const Accessor& acc_): acc(acc_) {}
299 inline simd::Float4::value_type operator()(
const Coord& ijk_) {
300 return static_cast<simd::Float4::value_type
>(acc.getValue(ijk_));
313 v3(valueAt(ijk ) - valueAt(ijk.
offsetBy(-1, 0, 0)),
314 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0,-1, 0)),
315 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0, 0,-1)), 0),
316 v4(valueAt(ijk.
offsetBy( 1, 0, 0)) - valueAt(ijk ),
317 valueAt(ijk.
offsetBy( 0, 1, 0)) - valueAt(ijk ),
318 valueAt(ijk.
offsetBy( 0, 0, 1)) - valueAt(ijk ), 0),
332 template<
typename StencilT>
333 static typename StencilT::ValueType result(
const StencilT& s)
335 using F4Val = simd::Float4::value_type;
339 v1(F4Val(s.template getValue<-2, 0, 0>()) - F4Val(s.template getValue<-3, 0, 0>()),
340 F4Val(s.template getValue< 0,-2, 0>()) - F4Val(s.template getValue< 0,-3, 0>()),
341 F4Val(s.template getValue< 0, 0,-2>()) - F4Val(s.template getValue< 0, 0,-3>()), 0),
342 v2(F4Val(s.template getValue<-1, 0, 0>()) - F4Val(s.template getValue<-2, 0, 0>()),
343 F4Val(s.template getValue< 0,-1, 0>()) - F4Val(s.template getValue< 0,-2, 0>()),
344 F4Val(s.template getValue< 0, 0,-1>()) - F4Val(s.template getValue< 0, 0,-2>()), 0),
345 v3(F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue<-1, 0, 0>()),
346 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0,-1, 0>()),
347 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0, 0,-1>()), 0),
348 v4(F4Val(s.template getValue< 1, 0, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
349 F4Val(s.template getValue< 0, 1, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
350 F4Val(s.template getValue< 0, 0, 1>()) - F4Val(s.template getValue< 0, 0, 0>()), 0),
351 v5(F4Val(s.template getValue< 2, 0, 0>()) - F4Val(s.template getValue< 1, 0, 0>()),
352 F4Val(s.template getValue< 0, 2, 0>()) - F4Val(s.template getValue< 0, 1, 0>()),
353 F4Val(s.template getValue< 0, 0, 2>()) - F4Val(s.template getValue< 0, 0, 1>()), 0),
354 v6(F4Val(s.template getValue< 3, 0, 0>()) - F4Val(s.template getValue< 2, 0, 0>()),
355 F4Val(s.template getValue< 0, 3, 0>()) - F4Val(s.template getValue< 0, 2, 0>()),
356 F4Val(s.template getValue< 0, 0, 3>()) - F4Val(s.template getValue< 0, 0, 2>()), 0),
363 #endif //DWA_OPENVDB // for SIMD - note will do the computations in float 368 template<DDScheme DiffScheme>
373 template<
typename Accessor>
374 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk);
377 template<
typename StencilT>
378 static typename StencilT::ValueType result(
const StencilT& stencil);
386 template<
typename Accessor>
387 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
389 return grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
390 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy(0, -1, 0)) +
392 - 6*grid.getValue(ijk);
396 template<
typename StencilT>
397 static typename StencilT::ValueType
result(
const StencilT& stencil)
399 return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
400 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
401 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
402 - 6*stencil.template getValue< 0, 0, 0>();
410 template<
typename Accessor>
411 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
413 using ValueT =
typename Accessor::ValueType;
414 return static_cast<ValueT
>(
416 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
417 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
418 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
420 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
421 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
422 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
423 - 7.5*grid.getValue(ijk));
427 template<
typename StencilT>
428 static typename StencilT::ValueType
result(
const StencilT& stencil)
430 using ValueT =
typename StencilT::ValueType;
431 return static_cast<ValueT
>(
433 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
434 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
435 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
437 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
438 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
439 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
440 - 7.5*stencil.template getValue< 0, 0, 0>());
448 template<
typename Accessor>
449 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
451 using ValueT =
typename Accessor::ValueType;
452 return static_cast<ValueT
>(
454 grid.getValue(ijk.
offsetBy(3,0,0)) + grid.getValue(ijk.
offsetBy(-3, 0, 0)) +
455 grid.getValue(ijk.
offsetBy(0,3,0)) + grid.getValue(ijk.
offsetBy( 0,-3, 0)) +
456 grid.getValue(ijk.
offsetBy(0,0,3)) + grid.getValue(ijk.
offsetBy( 0, 0,-3)) )
458 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
459 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
460 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
462 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
463 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
464 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
465 - (3*49/18.)*grid.getValue(ijk));
469 template<
typename StencilT>
470 static typename StencilT::ValueType
result(
const StencilT& stencil)
472 using ValueT =
typename StencilT::ValueType;
473 return static_cast<ValueT
>(
475 stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
476 stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
477 stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
479 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
480 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
481 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
483 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
484 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
485 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
486 - (3*49/18.)*stencil.template getValue< 0, 0, 0>());
493 template<DScheme DiffScheme>
498 template<
typename Accessor>
static typename Accessor::ValueType::value_type
507 template<
typename StencilT>
static typename StencilT::ValueType::value_type
519 template<DScheme DiffScheme>
524 template<
typename Accessor>
525 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
527 using Vec3Type =
typename Accessor::ValueType;
537 template<
typename StencilT>
538 static typename StencilT::ValueType
result(
const StencilT& stencil)
540 using Vec3Type =
typename StencilT::ValueType;
553 template<DDScheme DiffScheme2, DScheme DiffScheme1>
561 template<
typename Accessor>
563 typename Accessor::ValueType& alpha,
564 typename Accessor::ValueType& beta)
566 using ValueType =
typename Accessor::ValueType;
572 const ValueType Dx2 = Dx*Dx;
573 const ValueType Dy2 = Dy*Dy;
574 const ValueType Dz2 = Dz*Dz;
575 const ValueType normGrad = Dx2 + Dy2 + Dz2;
590 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
591 beta = ValueType(std::sqrt(
double(normGrad)));
599 template<
typename StencilT>
600 static bool result(
const StencilT& stencil,
601 typename StencilT::ValueType& alpha,
602 typename StencilT::ValueType& beta)
604 using ValueType =
typename StencilT::ValueType;
609 const ValueType Dx2 = Dx*Dx;
610 const ValueType Dy2 = Dy*Dy;
611 const ValueType Dz2 = Dz*Dz;
612 const ValueType normGrad = Dx2 + Dy2 + Dz2;
627 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
628 beta = ValueType(std::sqrt(
double(normGrad)));
638 template<
typename MapType, DScheme DiffScheme>
645 template<
typename Accessor>
647 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
652 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
656 template<
typename StencilT>
658 result(
const MapType& map,
const StencilT& stencil)
663 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
669 template<DScheme DiffScheme>
673 template<
typename Accessor>
681 template<
typename StencilT>
695 template<
typename Accessor>
704 return iGradient * inv2dx;
708 template<
typename StencilT>
717 return iGradient * inv2dx;
727 template<
typename Accessor>
736 return iGradient * inv2dx;
740 template<
typename StencilT>
749 return iGradient * inv2dx;
759 template<
typename Accessor>
773 template<
typename StencilT>
793 template<
typename Accessor>
807 template<
typename StencilT>
824 template<
typename MapType, BiasedGradientScheme GradScheme>
831 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
834 using ValueType =
typename Accessor::ValueType;
838 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
843 result(
const MapType& map,
const StencilT& stencil,
846 using ValueType =
typename StencilT::ValueType;
850 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
859 template<
typename MapType, BiasedGradientScheme GradScheme>
867 template<
typename Accessor>
868 static typename Accessor::ValueType
869 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
871 using ValueType =
typename Accessor::ValueType;
880 template<
typename StencilT>
881 static typename StencilT::ValueType
882 result(
const MapType& map,
const StencilT& stencil)
884 using ValueType =
typename StencilT::ValueType;
894 template<BiasedGradientScheme GradScheme>
898 template<
typename Accessor>
899 static typename Accessor::ValueType
902 using ValueType =
typename Accessor::ValueType;
909 template<
typename StencilT>
910 static typename StencilT::ValueType
913 using ValueType =
typename StencilT::ValueType;
921 template<BiasedGradientScheme GradScheme>
925 template<
typename Accessor>
926 static typename Accessor::ValueType
929 using ValueType =
typename Accessor::ValueType;
936 template<
typename StencilT>
937 static typename StencilT::ValueType
940 using ValueType =
typename StencilT::ValueType;
949 template<
typename MapType, DScheme DiffScheme>
955 template<
typename Accessor>
static typename Accessor::ValueType::value_type
956 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
958 using ValueType =
typename Accessor::ValueType::value_type;
961 for (
int i=0; i < 3; i++) {
965 div += ValueType(map.applyIJT(vec, ijk.
asVec3d())[i]);
971 template<
typename StencilT>
static typename StencilT::ValueType::value_type
972 result(
const MapType& map,
const StencilT& stencil)
974 using ValueType =
typename StencilT::ValueType::value_type;
977 for (
int i=0; i < 3; i++) {
981 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
989 template<DScheme DiffScheme>
993 template<
typename Accessor>
static typename Accessor::ValueType::value_type
996 using ValueType =
typename Accessor::ValueType::value_type;
1004 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1007 using ValueType =
typename StencilT::ValueType::value_type;
1017 template<DScheme DiffScheme>
1021 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1024 using ValueType =
typename Accessor::ValueType::value_type;
1029 ValueType invdx = ValueType(map.
getInvScale()[0]);
1034 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1037 using ValueType =
typename StencilT::ValueType::value_type;
1042 ValueType invdx = ValueType(map.
getInvScale()[0]);
1049 template<DScheme DiffScheme>
1053 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1056 using ValueType =
typename Accessor::ValueType::value_type;
1061 ValueType invdx = ValueType(map.
getInvScale()[0]);
1066 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1069 using ValueType =
typename StencilT::ValueType::value_type;
1074 ValueType invdx = ValueType(map.
getInvScale()[0]);
1085 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1088 using ValueType =
typename Accessor::ValueType::value_type;
1093 return div * inv2dx;
1097 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1100 using ValueType =
typename StencilT::ValueType::value_type;
1105 return div * inv2dx;
1115 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1118 using ValueType =
typename Accessor::ValueType::value_type;
1124 return div * inv2dx;
1128 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1131 using ValueType =
typename StencilT::ValueType::value_type;
1137 return div * inv2dx;
1143 template<DScheme DiffScheme>
1147 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1150 using ValueType =
typename Accessor::ValueType::value_type;
1152 ValueType div = ValueType(
1160 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1163 using ValueType =
typename StencilT::ValueType::value_type;
1176 template<DScheme DiffScheme>
1180 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1183 using ValueType =
typename Accessor::ValueType::value_type;
1185 ValueType div = ValueType(
1193 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1196 using ValueType =
typename StencilT::ValueType::value_type;
1213 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1216 using ValueType =
typename Accessor::ValueType::value_type;
1218 ValueType div = ValueType(
1226 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1229 using ValueType =
typename StencilT::ValueType::value_type;
1231 ValueType div = ValueType(
1245 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1248 using ValueType =
typename Accessor::ValueType::value_type;
1250 ValueType div = ValueType(
1258 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1261 using ValueType =
typename StencilT::ValueType::value_type;
1263 ValueType div = ValueType(
1274 template<
typename MapType, DScheme DiffScheme>
1280 template<
typename Accessor>
static typename Accessor::ValueType
1283 using Vec3Type =
typename Accessor::ValueType;
1285 for (
int i = 0; i < 3; i++) {
1291 mat[i] = Vec3Type(map.applyIJT(vec, ijk.
asVec3d()));
1293 return Vec3Type(mat[2][1] - mat[1][2],
1294 mat[0][2] - mat[2][0],
1295 mat[1][0] - mat[0][1]);
1299 template<
typename StencilT>
static typename StencilT::ValueType
1300 result(
const MapType& map,
const StencilT& stencil)
1302 using Vec3Type =
typename StencilT::ValueType;
1304 for (
int i = 0; i < 3; i++) {
1310 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1312 return Vec3Type(mat[2][1] - mat[1][2],
1313 mat[0][2] - mat[2][0],
1314 mat[1][0] - mat[0][1]);
1319 template<DScheme DiffScheme>
1323 template<
typename Accessor>
static typename Accessor::ValueType
1326 using Vec3Type =
typename Accessor::ValueType;
1327 using ValueType =
typename Vec3Type::value_type;
1332 template<
typename StencilT>
static typename StencilT::ValueType
1335 using Vec3Type =
typename StencilT::ValueType;
1336 using ValueType =
typename Vec3Type::value_type;
1342 template<DScheme DiffScheme>
1346 template<
typename Accessor>
static typename Accessor::ValueType
1349 using Vec3Type =
typename Accessor::ValueType;
1350 using ValueType =
typename Vec3Type::value_type;
1356 template<
typename StencilT>
static typename StencilT::ValueType
1359 using Vec3Type =
typename StencilT::ValueType;
1360 using ValueType =
typename Vec3Type::value_type;
1371 template<
typename Accessor>
static typename Accessor::ValueType
1374 using Vec3Type =
typename Accessor::ValueType;
1375 using ValueType =
typename Vec3Type::value_type;
1381 template<
typename StencilT>
static typename StencilT::ValueType
1384 using Vec3Type =
typename StencilT::ValueType;
1385 using ValueType =
typename Vec3Type::value_type;
1396 template<
typename Accessor>
static typename Accessor::ValueType
1399 using Vec3Type =
typename Accessor::ValueType;
1400 using ValueType =
typename Vec3Type::value_type;
1406 template<
typename StencilT>
static typename StencilT::ValueType
1409 using Vec3Type =
typename StencilT::ValueType;
1410 using ValueType =
typename Vec3Type::value_type;
1419 template<
typename MapType, DDScheme DiffScheme>
1425 template<
typename Accessor>
1426 static typename Accessor::ValueType
result(
const MapType& map,
1427 const Accessor& grid,
const Coord& ijk)
1429 using ValueType =
typename Accessor::ValueType;
1440 Mat3d d2_is(iddx, iddxy, iddxz,
1442 iddxz, iddyz, iddz);
1446 d2_rs = map.applyIJC(d2_is);
1453 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1457 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1461 template<
typename StencilT>
1462 static typename StencilT::ValueType
result(
const MapType& map,
const StencilT& stencil)
1464 using ValueType =
typename StencilT::ValueType;
1475 Mat3d d2_is(iddx, iddxy, iddxz,
1477 iddxz, iddyz, iddz);
1481 d2_rs = map.applyIJC(d2_is);
1488 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1492 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1497 template<DDScheme DiffScheme>
1501 template<
typename Accessor>
1503 const Accessor& grid,
const Coord& ijk)
1509 template<
typename StencilT>
1518 template<DDScheme DiffScheme>
1522 template<
typename Accessor>
1524 const Accessor& grid,
const Coord& ijk)
1530 template<
typename StencilT>
1538 template<DDScheme DiffScheme>
1542 template<
typename Accessor>
static typename Accessor::ValueType
1545 using ValueType =
typename Accessor::ValueType;
1551 template<
typename StencilT>
static typename StencilT::ValueType
1554 using ValueType =
typename StencilT::ValueType;
1561 template<DDScheme DiffScheme>
1565 template<
typename Accessor>
static typename Accessor::ValueType
1568 using ValueType =
typename Accessor::ValueType;
1574 template<
typename StencilT>
static typename StencilT::ValueType
1577 using ValueType =
typename StencilT::ValueType;
1584 template<DDScheme DiffScheme>
1588 template<
typename Accessor>
static typename Accessor::ValueType
1591 using ValueType =
typename Accessor::ValueType;
1599 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1603 template<
typename StencilT>
static typename StencilT::ValueType
1606 using ValueType =
typename StencilT::ValueType;
1614 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1619 template<DDScheme DiffScheme>
1623 template<
typename Accessor>
static typename Accessor::ValueType
1626 using ValueType =
typename Accessor::ValueType;
1633 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1637 template<
typename StencilT>
static typename StencilT::ValueType
1640 using ValueType =
typename StencilT::ValueType;
1647 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1655 template<
typename MapType, DScheme DiffScheme>
1662 using ValueType =
typename Accessor::ValueType;
1666 ValueType d = grid.getValue(ijk);
1671 Vec3d result = ijk.
asVec3d() - map.applyInverseMap(vectorFromSurface);
1672 return Vec3Type(result);
1675 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1676 return Vec3Type(result);
1682 result(
const MapType& map,
const StencilT& stencil)
1684 using ValueType =
typename StencilT::ValueType;
1688 ValueType d = stencil.template getValue<0, 0, 0>();
1693 Vec3d result = stencil.getCenterCoord().asVec3d()
1694 - map.applyInverseMap(vectorFromSurface);
1695 return Vec3Type(result);
1697 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1698 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1699 return Vec3Type(result);
1708 template<
typename MapType, DScheme DiffScheme>
1715 using ValueType =
typename Accessor::ValueType;
1718 ValueType d = grid.getValue(ijk);
1721 Vec3Type vectorFromSurface =
1723 Vec3d result = map.applyMap(ijk.
asVec3d()) - vectorFromSurface;
1725 return Vec3Type(result);
1730 result(
const MapType& map,
const StencilT& stencil)
1732 using ValueType =
typename StencilT::ValueType;
1735 ValueType d = stencil.template getValue<0, 0, 0>();
1738 Vec3Type vectorFromSurface =
1740 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1742 return Vec3Type(result);
1750 template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1757 template<
typename Accessor>
1758 static bool compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1759 double& alpha,
double& beta)
1761 using ValueType =
typename Accessor::ValueType;
1768 d1_ws = map.applyIJT(d1_is);
1770 d1_ws = map.applyIJT(d1_is, ijk.
asVec3d());
1772 const double Dx2 = d1_ws(0)*d1_ws(0);
1773 const double Dy2 = d1_ws(1)*d1_ws(1);
1774 const double Dz2 = d1_ws(2)*d1_ws(2);
1775 const double normGrad = Dx2 + Dy2 + Dz2;
1791 Mat3d d2_is(iddx, iddxy, iddxz,
1793 iddxz, iddyz, iddz);
1798 d2_ws = map.applyIJC(d2_is);
1800 d2_ws = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1804 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1805 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1806 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1807 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1808 beta = std::sqrt(normGrad);
1812 template<
typename Accessor>
1813 static typename Accessor::ValueType
result(
const MapType& map,
1814 const Accessor& grid,
const Coord& ijk)
1816 using ValueType =
typename Accessor::ValueType;
1818 return compute(map, grid, ijk, alpha, beta) ?
1822 template<
typename Accessor>
1823 static typename Accessor::ValueType
normGrad(
const MapType& map,
1824 const Accessor& grid,
const Coord& ijk)
1826 using ValueType =
typename Accessor::ValueType;
1828 return compute(map, grid, ijk, alpha, beta) ?
1836 template<
typename StencilT>
1837 static bool compute(
const MapType& map,
const StencilT& stencil,
1838 double& alpha,
double& beta)
1840 using ValueType =
typename StencilT::ValueType;
1847 d1_ws = map.applyIJT(d1_is);
1849 d1_ws = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1851 const double Dx2 = d1_ws(0)*d1_ws(0);
1852 const double Dy2 = d1_ws(1)*d1_ws(1);
1853 const double Dz2 = d1_ws(2)*d1_ws(2);
1854 const double normGrad = Dx2 + Dy2 + Dz2;
1870 Mat3d d2_is(iddx, iddxy, iddxz,
1872 iddxz, iddyz, iddz);
1877 d2_ws = map.applyIJC(d2_is);
1879 d2_ws = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1883 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1884 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1885 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1886 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1887 beta = std::sqrt(normGrad);
1891 template<
typename StencilT>
1892 static typename StencilT::ValueType
1893 result(
const MapType& map,
const StencilT stencil)
1895 using ValueType =
typename StencilT::ValueType;
1897 return compute(map, stencil, alpha, beta) ?
1901 template<
typename StencilT>
1902 static typename StencilT::ValueType
normGrad(
const MapType& map,
const StencilT stencil)
1904 using ValueType =
typename StencilT::ValueType;
1906 return compute(map, stencil, alpha, beta) ?
1912 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1916 template<
typename Accessor>
1918 const Accessor& grid,
const Coord& ijk)
1920 using ValueType =
typename Accessor::ValueType;
1922 ValueType alpha, beta;
1927 template<
typename Accessor>
1929 const Accessor& grid,
const Coord& ijk)
1931 using ValueType =
typename Accessor::ValueType;
1933 ValueType alpha, beta;
1939 template<
typename StencilT>
1942 using ValueType =
typename StencilT::ValueType;
1944 ValueType alpha, beta;
1949 template<
typename StencilT>
1952 using ValueType =
typename StencilT::ValueType;
1954 ValueType alpha, beta;
1961 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1965 template<
typename Accessor>
1967 const Accessor& grid,
const Coord& ijk)
1969 using ValueType =
typename Accessor::ValueType;
1971 ValueType alpha, beta;
1974 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1979 template<
typename Accessor>
1981 const Accessor& grid,
const Coord& ijk)
1983 using ValueType =
typename Accessor::ValueType;
1985 ValueType alpha, beta;
1988 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
1994 template<
typename StencilT>
1997 using ValueType =
typename StencilT::ValueType;
1999 ValueType alpha, beta;
2002 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2007 template<
typename StencilT>
2010 using ValueType =
typename StencilT::ValueType;
2012 ValueType alpha, beta;
2015 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2022 template<DDScheme DiffScheme2, DScheme DiffScheme1>
2026 template<
typename Accessor>
static typename Accessor::ValueType
2029 using ValueType =
typename Accessor::ValueType;
2031 ValueType alpha, beta;
2034 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2039 template<
typename Accessor>
static typename Accessor::ValueType
2042 using ValueType =
typename Accessor::ValueType;
2044 ValueType alpha, beta;
2047 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2053 template<
typename StencilT>
static typename StencilT::ValueType
2056 using ValueType =
typename StencilT::ValueType;
2058 ValueType alpha, beta;
2061 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2066 template<
typename StencilT>
static typename StencilT::ValueType
2069 using ValueType =
typename StencilT::ValueType;
2071 ValueType alpha, beta;
2074 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2088 template<
typename Gr
idType>
2103 {
return mMap->applyIJC(m,v,pos); }
2119 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition: Operators.h:1277
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:823
ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, float scale2=0.01f)
Implementation of nominally fifth-order finite-difference WENO.
Definition: FiniteDifference.h:331
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:869
ResultType result(const StencilType &stencil)
Definition: Operators.h:70
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:262
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:499
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1354
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition: Operators.h:219
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition: Operators.h:137
Definition: FiniteDifference.h:179
GenericMap(const Transform &t)
Definition: Operators.h:2091
Compute the mean curvature.
Definition: Operators.h:1751
Definition: FiniteDifference.h:464
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1300
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1589
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1181
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
random access version
Definition: Operators.h:562
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:387
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:831
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:470
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:956
double determinant() const
Definition: Operators.h:2105
static double result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:80
Definition: FiniteDifference.h:70
Vec3d asVec3d() const
Definition: Coord.h:167
Definition: FiniteDifference.h:65
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1426
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:775
Definition: FiniteDifference.h:62
Compute the closest-point transform to a level set.
Definition: Operators.h:1656
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1462
Compute the mean curvature in index space.
Definition: Operators.h:555
Curl operator defined in index space using various first derivative schemes.
Definition: Operators.h:521
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:972
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
Definition: Operators.h:1422
~GenericMap()
Definition: Operators.h:2094
Mat3d applyIJC(const Mat3d &m) const
Definition: Operators.h:2101
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:682
Gradient operators defined in index space of various orders.
Definition: Operators.h:122
Definition: Operators.h:157
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1358
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition: Operators.h:92
Definition: Operators.h:152
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Definition: Operators.h:61
Biased gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:827
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:48
Definition: FiniteDifference.h:195
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:882
Vec3d applyInverseMap(const Vec3d &in) const
Definition: Operators.h:2097
Definition: FiniteDifference.h:1532
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:647
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1356
Definition: Stencils.h:243
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1917
Definition: FiniteDifference.h:1810
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:397
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1502
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:819
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1523
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:809
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:538
Definition: Operators.h:109
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition: Operators.h:2102
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition: Operators.h:508
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
Definition: Maps.h:1631
Definition: FiniteDifference.h:74
Center difference gradient operators, defined with respect to the range-space of the map...
Definition: Operators.h:642
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1813
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition: Operators.h:78
GenericMap(const GridType &g)
Definition: Operators.h:2089
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1604
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1940
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:353
double determinant(const Vec3d &in) const
Definition: Operators.h:2106
A specialized linear transform that performs a translation.
Definition: Maps.h:998
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1638
Definition: Stencils.h:536
Vec3d voxelSize(const Vec3d &v) const
Definition: Operators.h:2109
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1181
#define OPENVDB_VERSION_NAME
Definition: version.h:43
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1730
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1624
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
stencil access version
Definition: Operators.h:1837
Vec3d voxelSize() const
Definition: Operators.h:2108
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:449
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1259
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition: Operators.h:227
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1823
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1510
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1227
Vec3d applyIJT(const Vec3d &in) const
Definition: Operators.h:2099
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:795
Type Pow3(Type x)
Return .
Definition: Math.h:518
Definition: Exceptions.h:39
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:683
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
stencil access version
Definition: Operators.h:600
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:525
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:275
Definition: FiniteDifference.h:194
const MapType map
Definition: Operators.h:72
Definition: FiniteDifference.h:196
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition: Operators.h:1531
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1281
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:94
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:952
typename T::ValueType ValueType
Definition: Operators.h:110
Definition: FiniteDifference.h:66
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:495
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition: Operators.h:1893
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1682
Compute the closest-point transform to a level set.
Definition: Operators.h:1709
Definition: FiniteDifference.h:69
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Definition: Operators.h:2085
Definition: FiniteDifference.h:181
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1214
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1194
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1660
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
random access version
Definition: Operators.h:1758
Definition: FiniteDifference.h:198
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:821
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:994
Abstract base class for maps.
Definition: Maps.h:158
SharedPtr< const MapBase > ConstPtr
Definition: Maps.h:162
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1005
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1713
Map traits.
Definition: Maps.h:79
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:115
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:675
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition: Operators.h:2100
Definition: FiniteDifference.h:71
Vec3d applyMap(const Vec3d &in) const
Definition: Operators.h:2096
Defines various finite difference stencils by means of the "curiously recurring template pattern" on ...
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:761
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1928
Definition: Operators.h:860
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition: Operators.h:843
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:126
static double result(const MapT &map, const StencilType &stencil)
Definition: Operators.h:99
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:428
Definition: Operators.h:51
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1148
GenericMap(MapBase::Ptr map)
Definition: Operators.h:2092
Definition: FiniteDifference.h:67
Definition: FiniteDifference.h:180
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:66
Definition: FiniteDifference.h:197
Definition: Operators.h:253
Definition: Stencils.h:806
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1950
Definition: FiniteDifference.h:73
Definition: FiniteDifference.h:68
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:658
GenericMap(MapBase::ConstPtr map)
Definition: Operators.h:2093
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:141
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1161
MapAdapter(const MapType &m)
Definition: Operators.h:62
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:411
Laplacian defined in index space, using various center-difference stencils.
Definition: Operators.h:370
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1246
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition: Operators.h:1902
Definition: Operators.h:48
Type Pow2(Type x)
Return .
Definition: Math.h:514
Definition: FiniteDifference.h:72
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition: Operators.h:240
SharedPtr< MapBase > Ptr
Definition: Maps.h:161
Tolerance for floating-point comparison.
Definition: Math.h:125
static double result(const StencilType &stencil)
Definition: Operators.h:85