33 #ifndef OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 34 #define OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 49 template<
typename Vec3T>
struct is_vec3d {
static const bool value =
false; };
52 template<
typename T>
struct is_double {
static const bool value =
false; };
53 template<>
struct is_double<double> {
static const bool value =
true; };
61 template<
typename MapType,
typename OpType,
typename ResultType>
65 template<
typename AccessorType>
67 result(
const AccessorType& grid,
const Coord& ijk) {
return OpType::result(map, grid, ijk); }
69 template<
typename StencilType>
71 result(
const StencilType& stencil) {
return OpType::result(map, stencil); }
78 template<
typename OpType>
80 template<
typename AccessorType>
81 static inline double result(
const AccessorType& grid,
const Coord& ijk) {
82 return double(OpType::result(grid, ijk).length());
85 template<
typename StencilType>
86 static inline double result(
const StencilType& stencil) {
87 return double(OpType::result(stencil).length());
92 template<
typename OpType,
typename MapT>
94 template<
typename AccessorType>
95 static inline double result(
const MapT& map,
const AccessorType& grid,
const Coord& ijk) {
96 return double(OpType::result(map, grid, ijk).length());
99 template<
typename StencilType>
100 static inline double result(
const MapT& map,
const StencilType& stencil) {
101 return double(OpType::result(map, stencil).length());
121 template<DScheme DiffScheme>
129 using ValueType =
typename Accessor::ValueType;
140 using ValueType =
typename StencilT::ValueType;
152 template<BiasedGradientScheme bgs>
157 template<
typename Gr
idType,
bool IsSafe = true>
168 template<
typename Gr
idType,
bool IsSafe = true>
179 template<
typename Gr
idType,
bool IsSafe = true>
189 template<
typename Gr
idType,
bool IsSafe = true>
199 template<
typename Gr
idType,
bool IsSafe = true>
209 template<
typename Gr
idType,
bool IsSafe = true>
219 template<BiasedGradientScheme GradScheme,
typename Vec3Bias>
226 template<
typename Accessor>
230 using ValueType =
typename Accessor::ValueType;
239 template<
typename StencilT>
241 result(
const StencilT& stencil,
const Vec3Bias& V)
243 using ValueType =
typename StencilT::ValueType;
253 template<BiasedGradientScheme GradScheme>
261 template<
typename Accessor>
262 static typename Accessor::ValueType
265 using ValueType =
typename Accessor::ValueType;
274 template<
typename StencilT>
275 static typename StencilT::ValueType
278 using ValueType =
typename StencilT::ValueType;
287 #ifdef DWA_OPENVDB // for SIMD - note will do the computations in float 292 template<
typename Accessor>
293 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk)
298 GetValue(
const Accessor& acc_): acc(acc_) {}
300 inline simd::Float4::value_type operator()(
const Coord& ijk_) {
301 return static_cast<simd::Float4::value_type>(acc.getValue(ijk_));
314 v3(valueAt(ijk ) - valueAt(ijk.
offsetBy(-1, 0, 0)),
315 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0,-1, 0)),
316 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0, 0,-1)), 0),
317 v4(valueAt(ijk.
offsetBy( 1, 0, 0)) - valueAt(ijk ),
318 valueAt(ijk.
offsetBy( 0, 1, 0)) - valueAt(ijk ),
319 valueAt(ijk.
offsetBy( 0, 0, 1)) - valueAt(ijk ), 0),
333 template<
typename StencilT>
334 static typename StencilT::ValueType result(
const StencilT& s)
336 using F4Val = simd::Float4::value_type;
340 v1(F4Val(s.template getValue<-2, 0, 0>()) - F4Val(s.template getValue<-3, 0, 0>()),
341 F4Val(s.template getValue< 0,-2, 0>()) - F4Val(s.template getValue< 0,-3, 0>()),
342 F4Val(s.template getValue< 0, 0,-2>()) - F4Val(s.template getValue< 0, 0,-3>()), 0),
343 v2(F4Val(s.template getValue<-1, 0, 0>()) - F4Val(s.template getValue<-2, 0, 0>()),
344 F4Val(s.template getValue< 0,-1, 0>()) - F4Val(s.template getValue< 0,-2, 0>()),
345 F4Val(s.template getValue< 0, 0,-1>()) - F4Val(s.template getValue< 0, 0,-2>()), 0),
346 v3(F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue<-1, 0, 0>()),
347 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0,-1, 0>()),
348 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0, 0,-1>()), 0),
349 v4(F4Val(s.template getValue< 1, 0, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
350 F4Val(s.template getValue< 0, 1, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
351 F4Val(s.template getValue< 0, 0, 1>()) - F4Val(s.template getValue< 0, 0, 0>()), 0),
352 v5(F4Val(s.template getValue< 2, 0, 0>()) - F4Val(s.template getValue< 1, 0, 0>()),
353 F4Val(s.template getValue< 0, 2, 0>()) - F4Val(s.template getValue< 0, 1, 0>()),
354 F4Val(s.template getValue< 0, 0, 2>()) - F4Val(s.template getValue< 0, 0, 1>()), 0),
355 v6(F4Val(s.template getValue< 3, 0, 0>()) - F4Val(s.template getValue< 2, 0, 0>()),
356 F4Val(s.template getValue< 0, 3, 0>()) - F4Val(s.template getValue< 0, 2, 0>()),
357 F4Val(s.template getValue< 0, 0, 3>()) - F4Val(s.template getValue< 0, 0, 2>()), 0),
364 #endif //DWA_OPENVDB // for SIMD - note will do the computations in float 369 template<DDScheme DiffScheme>
374 template<
typename Accessor>
375 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk);
378 template<
typename StencilT>
379 static typename StencilT::ValueType result(
const StencilT& stencil);
387 template<
typename Accessor>
388 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
390 return grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
391 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy(0, -1, 0)) +
393 - 6*grid.getValue(ijk);
397 template<
typename StencilT>
398 static typename StencilT::ValueType
result(
const StencilT& stencil)
400 return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
401 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
402 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
403 - 6*stencil.template getValue< 0, 0, 0>();
411 template<
typename Accessor>
412 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
414 using ValueT =
typename Accessor::ValueType;
415 return static_cast<ValueT>(
417 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
418 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
419 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
421 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
422 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
423 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
424 - 7.5*grid.getValue(ijk));
428 template<
typename StencilT>
429 static typename StencilT::ValueType
result(
const StencilT& stencil)
431 using ValueT =
typename StencilT::ValueType;
432 return static_cast<ValueT>(
434 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
435 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
436 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
438 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
439 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
440 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
441 - 7.5*stencil.template getValue< 0, 0, 0>());
449 template<
typename Accessor>
450 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
452 using ValueT =
typename Accessor::ValueType;
453 return static_cast<ValueT>(
455 grid.getValue(ijk.
offsetBy(3,0,0)) + grid.getValue(ijk.
offsetBy(-3, 0, 0)) +
456 grid.getValue(ijk.
offsetBy(0,3,0)) + grid.getValue(ijk.
offsetBy( 0,-3, 0)) +
457 grid.getValue(ijk.
offsetBy(0,0,3)) + grid.getValue(ijk.
offsetBy( 0, 0,-3)) )
459 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
460 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
461 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
463 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
464 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
465 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
466 - (3*49/18.)*grid.getValue(ijk));
470 template<
typename StencilT>
471 static typename StencilT::ValueType
result(
const StencilT& stencil)
473 using ValueT =
typename StencilT::ValueType;
474 return static_cast<ValueT>(
476 stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
477 stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
478 stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
480 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
481 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
482 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
484 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
485 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
486 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
487 - (3*49/18.)*stencil.template getValue< 0, 0, 0>());
494 template<DScheme DiffScheme>
499 template<
typename Accessor>
static typename Accessor::ValueType::value_type
508 template<
typename StencilT>
static typename StencilT::ValueType::value_type
520 template<DScheme DiffScheme>
525 template<
typename Accessor>
526 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
528 using Vec3Type =
typename Accessor::ValueType;
538 template<
typename StencilT>
539 static typename StencilT::ValueType
result(
const StencilT& stencil)
541 using Vec3Type =
typename StencilT::ValueType;
554 template<DDScheme DiffScheme2, DScheme DiffScheme1>
562 template<
typename Accessor>
564 typename Accessor::ValueType& alpha,
565 typename Accessor::ValueType& beta)
567 using ValueType =
typename Accessor::ValueType;
573 const ValueType Dx2 = Dx*Dx;
574 const ValueType Dy2 = Dy*Dy;
575 const ValueType Dz2 = Dz*Dz;
576 const ValueType normGrad = Dx2 + Dy2 + Dz2;
591 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
592 beta = ValueType(std::sqrt(
double(normGrad)));
600 template<
typename StencilT>
601 static bool result(
const StencilT& stencil,
602 typename StencilT::ValueType& alpha,
603 typename StencilT::ValueType& beta)
605 using ValueType =
typename StencilT::ValueType;
610 const ValueType Dx2 = Dx*Dx;
611 const ValueType Dy2 = Dy*Dy;
612 const ValueType Dz2 = Dz*Dz;
613 const ValueType normGrad = Dx2 + Dy2 + Dz2;
628 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
629 beta = ValueType(std::sqrt(
double(normGrad)));
639 template<
typename MapType, DScheme DiffScheme>
646 template<
typename Accessor>
648 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
653 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
657 template<
typename StencilT>
659 result(
const MapType& map,
const StencilT& stencil)
664 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
670 template<DScheme DiffScheme>
674 template<
typename Accessor>
682 template<
typename StencilT>
696 template<
typename Accessor>
705 return iGradient * inv2dx;
709 template<
typename StencilT>
718 return iGradient * inv2dx;
728 template<
typename Accessor>
737 return iGradient * inv2dx;
741 template<
typename StencilT>
750 return iGradient * inv2dx;
760 template<
typename Accessor>
774 template<
typename StencilT>
794 template<
typename Accessor>
808 template<
typename StencilT>
825 template<
typename MapType, BiasedGradientScheme GradScheme>
832 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
835 using ValueType =
typename Accessor::ValueType;
839 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
844 result(
const MapType& map,
const StencilT& stencil,
847 using ValueType =
typename StencilT::ValueType;
851 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
860 template<
typename MapType, BiasedGradientScheme GradScheme>
868 template<
typename Accessor>
869 static typename Accessor::ValueType
870 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
872 using ValueType =
typename Accessor::ValueType;
881 template<
typename StencilT>
882 static typename StencilT::ValueType
883 result(
const MapType& map,
const StencilT& stencil)
885 using ValueType =
typename StencilT::ValueType;
895 template<BiasedGradientScheme GradScheme>
899 template<
typename Accessor>
900 static typename Accessor::ValueType
903 using ValueType =
typename Accessor::ValueType;
910 template<
typename StencilT>
911 static typename StencilT::ValueType
914 using ValueType =
typename StencilT::ValueType;
922 template<BiasedGradientScheme GradScheme>
926 template<
typename Accessor>
927 static typename Accessor::ValueType
930 using ValueType =
typename Accessor::ValueType;
937 template<
typename StencilT>
938 static typename StencilT::ValueType
941 using ValueType =
typename StencilT::ValueType;
950 template<
typename MapType, DScheme DiffScheme>
956 template<
typename Accessor>
static typename Accessor::ValueType::value_type
957 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
959 using ValueType =
typename Accessor::ValueType::value_type;
962 for (
int i=0; i < 3; i++) {
966 div += ValueType(map.applyIJT(vec, ijk.
asVec3d())[i]);
972 template<
typename StencilT>
static typename StencilT::ValueType::value_type
973 result(
const MapType& map,
const StencilT& stencil)
975 using ValueType =
typename StencilT::ValueType::value_type;
978 for (
int i=0; i < 3; i++) {
982 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
990 template<DScheme DiffScheme>
994 template<
typename Accessor>
static typename Accessor::ValueType::value_type
997 using ValueType =
typename Accessor::ValueType::value_type;
1005 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1008 using ValueType =
typename StencilT::ValueType::value_type;
1018 template<DScheme DiffScheme>
1022 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1025 using ValueType =
typename Accessor::ValueType::value_type;
1030 ValueType invdx = ValueType(map.
getInvScale()[0]);
1035 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1038 using ValueType =
typename StencilT::ValueType::value_type;
1043 ValueType invdx = ValueType(map.
getInvScale()[0]);
1050 template<DScheme DiffScheme>
1054 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1057 using ValueType =
typename Accessor::ValueType::value_type;
1062 ValueType invdx = ValueType(map.
getInvScale()[0]);
1067 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1070 using ValueType =
typename StencilT::ValueType::value_type;
1075 ValueType invdx = ValueType(map.
getInvScale()[0]);
1086 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1089 using ValueType =
typename Accessor::ValueType::value_type;
1094 return div * inv2dx;
1098 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1101 using ValueType =
typename StencilT::ValueType::value_type;
1106 return div * inv2dx;
1116 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1119 using ValueType =
typename Accessor::ValueType::value_type;
1125 return div * inv2dx;
1129 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1132 using ValueType =
typename StencilT::ValueType::value_type;
1138 return div * inv2dx;
1144 template<DScheme DiffScheme>
1148 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1151 using ValueType =
typename Accessor::ValueType::value_type;
1153 ValueType div = ValueType(
1161 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1164 using ValueType =
typename StencilT::ValueType::value_type;
1177 template<DScheme DiffScheme>
1181 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1184 using ValueType =
typename Accessor::ValueType::value_type;
1186 ValueType div = ValueType(
1194 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1197 using ValueType =
typename StencilT::ValueType::value_type;
1214 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1217 using ValueType =
typename Accessor::ValueType::value_type;
1219 ValueType div = ValueType(
1227 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1230 using ValueType =
typename StencilT::ValueType::value_type;
1232 ValueType div = ValueType(
1246 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1249 using ValueType =
typename Accessor::ValueType::value_type;
1251 ValueType div = ValueType(
1259 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1262 using ValueType =
typename StencilT::ValueType::value_type;
1264 ValueType div = ValueType(
1275 template<
typename MapType, DScheme DiffScheme>
1281 template<
typename Accessor>
static typename Accessor::ValueType
1284 using Vec3Type =
typename Accessor::ValueType;
1286 for (
int i = 0; i < 3; i++) {
1292 mat[i] = Vec3Type(map.applyIJT(vec, ijk.
asVec3d()));
1294 return Vec3Type(mat[2][1] - mat[1][2],
1295 mat[0][2] - mat[2][0],
1296 mat[1][0] - mat[0][1]);
1300 template<
typename StencilT>
static typename StencilT::ValueType
1301 result(
const MapType& map,
const StencilT& stencil)
1303 using Vec3Type =
typename StencilT::ValueType;
1305 for (
int i = 0; i < 3; i++) {
1311 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1313 return Vec3Type(mat[2][1] - mat[1][2],
1314 mat[0][2] - mat[2][0],
1315 mat[1][0] - mat[0][1]);
1320 template<DScheme DiffScheme>
1324 template<
typename Accessor>
static typename Accessor::ValueType
1327 using Vec3Type =
typename Accessor::ValueType;
1328 using ValueType =
typename Vec3Type::value_type;
1333 template<
typename StencilT>
static typename StencilT::ValueType
1336 using Vec3Type =
typename StencilT::ValueType;
1337 using ValueType =
typename Vec3Type::value_type;
1343 template<DScheme DiffScheme>
1347 template<
typename Accessor>
static typename Accessor::ValueType
1350 using Vec3Type =
typename Accessor::ValueType;
1351 using ValueType =
typename Vec3Type::value_type;
1357 template<
typename StencilT>
static typename StencilT::ValueType
1360 using Vec3Type =
typename StencilT::ValueType;
1361 using ValueType =
typename Vec3Type::value_type;
1372 template<
typename Accessor>
static typename Accessor::ValueType
1375 using Vec3Type =
typename Accessor::ValueType;
1376 using ValueType =
typename Vec3Type::value_type;
1382 template<
typename StencilT>
static typename StencilT::ValueType
1385 using Vec3Type =
typename StencilT::ValueType;
1386 using ValueType =
typename Vec3Type::value_type;
1397 template<
typename Accessor>
static typename Accessor::ValueType
1400 using Vec3Type =
typename Accessor::ValueType;
1401 using ValueType =
typename Vec3Type::value_type;
1407 template<
typename StencilT>
static typename StencilT::ValueType
1410 using Vec3Type =
typename StencilT::ValueType;
1411 using ValueType =
typename Vec3Type::value_type;
1420 template<
typename MapType, DDScheme DiffScheme>
1426 template<
typename Accessor>
1427 static typename Accessor::ValueType
result(
const MapType& map,
1428 const Accessor& grid,
const Coord& ijk)
1430 using ValueType =
typename Accessor::ValueType;
1441 Mat3d d2_is(iddx, iddxy, iddxz,
1443 iddxz, iddyz, iddz);
1447 d2_rs = map.applyIJC(d2_is);
1454 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1458 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1462 template<
typename StencilT>
1463 static typename StencilT::ValueType
result(
const MapType& map,
const StencilT& stencil)
1465 using ValueType =
typename StencilT::ValueType;
1476 Mat3d d2_is(iddx, iddxy, iddxz,
1478 iddxz, iddyz, iddz);
1482 d2_rs = map.applyIJC(d2_is);
1489 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1493 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1498 template<DDScheme DiffScheme>
1502 template<
typename Accessor>
1504 const Accessor& grid,
const Coord& ijk)
1510 template<
typename StencilT>
1519 template<DDScheme DiffScheme>
1523 template<
typename Accessor>
1525 const Accessor& grid,
const Coord& ijk)
1531 template<
typename StencilT>
1539 template<DDScheme DiffScheme>
1543 template<
typename Accessor>
static typename Accessor::ValueType
1546 using ValueType =
typename Accessor::ValueType;
1552 template<
typename StencilT>
static typename StencilT::ValueType
1555 using ValueType =
typename StencilT::ValueType;
1562 template<DDScheme DiffScheme>
1566 template<
typename Accessor>
static typename Accessor::ValueType
1569 using ValueType =
typename Accessor::ValueType;
1575 template<
typename StencilT>
static typename StencilT::ValueType
1578 using ValueType =
typename StencilT::ValueType;
1585 template<DDScheme DiffScheme>
1589 template<
typename Accessor>
static typename Accessor::ValueType
1592 using ValueType =
typename Accessor::ValueType;
1600 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1604 template<
typename StencilT>
static typename StencilT::ValueType
1607 using ValueType =
typename StencilT::ValueType;
1615 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1620 template<DDScheme DiffScheme>
1624 template<
typename Accessor>
static typename Accessor::ValueType
1627 using ValueType =
typename Accessor::ValueType;
1634 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1638 template<
typename StencilT>
static typename StencilT::ValueType
1641 using ValueType =
typename StencilT::ValueType;
1648 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1656 template<
typename MapType, DScheme DiffScheme>
1663 using ValueType =
typename Accessor::ValueType;
1667 ValueType d = grid.getValue(ijk);
1672 Vec3d result = ijk.
asVec3d() - map.applyInverseMap(vectorFromSurface);
1673 return Vec3Type(result);
1676 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1677 return Vec3Type(result);
1683 result(
const MapType& map,
const StencilT& stencil)
1685 using ValueType =
typename StencilT::ValueType;
1689 ValueType d = stencil.template getValue<0, 0, 0>();
1694 Vec3d result = stencil.getCenterCoord().asVec3d()
1695 - map.applyInverseMap(vectorFromSurface);
1696 return Vec3Type(result);
1698 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1699 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1700 return Vec3Type(result);
1709 template<
typename MapType, DScheme DiffScheme>
1716 using ValueType =
typename Accessor::ValueType;
1719 ValueType d = grid.getValue(ijk);
1722 Vec3Type vectorFromSurface =
1724 Vec3d result = map.applyMap(ijk.
asVec3d()) - vectorFromSurface;
1726 return Vec3Type(result);
1731 result(
const MapType& map,
const StencilT& stencil)
1733 using ValueType =
typename StencilT::ValueType;
1736 ValueType d = stencil.template getValue<0, 0, 0>();
1739 Vec3Type vectorFromSurface =
1741 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1743 return Vec3Type(result);
1752 template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1759 template<
typename Accessor>
1760 static bool compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1761 double& alpha,
double& beta)
1763 using ValueType =
typename Accessor::ValueType;
1770 d1_ws = map.applyIJT(d1_is);
1772 d1_ws = map.applyIJT(d1_is, ijk.
asVec3d());
1774 const double Dx2 = d1_ws(0)*d1_ws(0);
1775 const double Dy2 = d1_ws(1)*d1_ws(1);
1776 const double Dz2 = d1_ws(2)*d1_ws(2);
1777 const double normGrad = Dx2 + Dy2 + Dz2;
1793 Mat3d d2_is(iddx, iddxy, iddxz,
1795 iddxz, iddyz, iddz);
1800 d2_ws = map.applyIJC(d2_is);
1802 d2_ws = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1806 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1807 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1808 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1809 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1810 beta = std::sqrt(normGrad);
1814 template<
typename Accessor>
1815 static typename Accessor::ValueType
result(
const MapType& map,
1816 const Accessor& grid,
const Coord& ijk)
1818 using ValueType =
typename Accessor::ValueType;
1820 return compute(map, grid, ijk, alpha, beta) ?
1824 template<
typename Accessor>
1825 static typename Accessor::ValueType
normGrad(
const MapType& map,
1826 const Accessor& grid,
const Coord& ijk)
1828 using ValueType =
typename Accessor::ValueType;
1830 return compute(map, grid, ijk, alpha, beta) ?
1838 template<
typename StencilT>
1839 static bool compute(
const MapType& map,
const StencilT& stencil,
1840 double& alpha,
double& beta)
1842 using ValueType =
typename StencilT::ValueType;
1849 d1_ws = map.applyIJT(d1_is);
1851 d1_ws = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1853 const double Dx2 = d1_ws(0)*d1_ws(0);
1854 const double Dy2 = d1_ws(1)*d1_ws(1);
1855 const double Dz2 = d1_ws(2)*d1_ws(2);
1856 const double normGrad = Dx2 + Dy2 + Dz2;
1872 Mat3d d2_is(iddx, iddxy, iddxz,
1874 iddxz, iddyz, iddz);
1879 d2_ws = map.applyIJC(d2_is);
1881 d2_ws = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1885 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1886 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1887 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1888 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1889 beta = std::sqrt(normGrad);
1893 template<
typename StencilT>
1894 static typename StencilT::ValueType
1895 result(
const MapType& map,
const StencilT stencil)
1897 using ValueType =
typename StencilT::ValueType;
1899 return compute(map, stencil, alpha, beta) ?
1903 template<
typename StencilT>
1904 static typename StencilT::ValueType
normGrad(
const MapType& map,
const StencilT stencil)
1906 using ValueType =
typename StencilT::ValueType;
1908 return compute(map, stencil, alpha, beta) ?
1914 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1918 template<
typename Accessor>
1920 const Accessor& grid,
const Coord& ijk)
1922 using ValueType =
typename Accessor::ValueType;
1924 ValueType alpha, beta;
1929 template<
typename Accessor>
1931 const Accessor& grid,
const Coord& ijk)
1933 using ValueType =
typename Accessor::ValueType;
1935 ValueType alpha, beta;
1941 template<
typename StencilT>
1944 using ValueType =
typename StencilT::ValueType;
1946 ValueType alpha, beta;
1951 template<
typename StencilT>
1954 using ValueType =
typename StencilT::ValueType;
1956 ValueType alpha, beta;
1963 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1967 template<
typename Accessor>
1969 const Accessor& grid,
const Coord& ijk)
1971 using ValueType =
typename Accessor::ValueType;
1973 ValueType alpha, beta;
1976 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1981 template<
typename Accessor>
1983 const Accessor& grid,
const Coord& ijk)
1985 using ValueType =
typename Accessor::ValueType;
1987 ValueType alpha, beta;
1990 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
1996 template<
typename StencilT>
1999 using ValueType =
typename StencilT::ValueType;
2001 ValueType alpha, beta;
2004 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2009 template<
typename StencilT>
2012 using ValueType =
typename StencilT::ValueType;
2014 ValueType alpha, beta;
2017 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2024 template<DDScheme DiffScheme2, DScheme DiffScheme1>
2028 template<
typename Accessor>
static typename Accessor::ValueType
2031 using ValueType =
typename Accessor::ValueType;
2033 ValueType alpha, beta;
2036 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2041 template<
typename Accessor>
static typename Accessor::ValueType
2044 using ValueType =
typename Accessor::ValueType;
2046 ValueType alpha, beta;
2049 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2055 template<
typename StencilT>
static typename StencilT::ValueType
2058 using ValueType =
typename StencilT::ValueType;
2060 ValueType alpha, beta;
2063 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2068 template<
typename StencilT>
static typename StencilT::ValueType
2071 using ValueType =
typename StencilT::ValueType;
2073 ValueType alpha, beta;
2076 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2090 template<
typename Gr
idType>
2105 {
return mMap->applyIJC(m,v,pos); }
2121 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED Vec3d voxelSize() const
Definition: Operators.h:2110
Definition: FiniteDifference.h:72
const MapType map
Definition: Operators.h:73
Definition: FiniteDifference.h:69
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1930
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1825
Definition: Operators.h:52
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:883
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
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition: Operators.h:79
GenericMap(const GridType &g)
Definition: Operators.h:2091
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Random access version.
Definition: Operators.h:563
Definition: Operators.h:49
static double result(const StencilType &stencil)
Definition: Operators.h:86
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:822
Compute the Laplacian at a given location in a grid using finite differencing of various orders....
Definition: Operators.h:1423
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Random access version.
Definition: Operators.h:1760
Definition: Stencils.h:806
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition: Operators.h:1532
Definition: Operators.h:110
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:995
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1942
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1184
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:450
Compute the closest-point transform to a level set.
Definition: Operators.h:1710
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1427
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:659
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1683
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1605
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition: Operators.h:93
Type Pow3(Type x)
Return x3.
Definition: Math.h:506
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
typename T::ValueType ValueType
Definition: Operators.h:111
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:471
Laplacian defined in index space, using various center-difference stencils.
Definition: Operators.h:371
Map traits.
Definition: Maps.h:82
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1162
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:151
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:398
Definition: FiniteDifference.h:1511
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1661
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1182
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:870
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Stencil access version.
Definition: Operators.h:1839
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1625
SharedPtr< MapBase > Ptr
Definition: Maps.h:164
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition: Operators.h:844
A specialized linear transform that performs a translation.
Definition: Maps.h:1001
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1590
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:973
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Definition: Operators.h:62
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:826
Vec3d applyIJT(const Vec3d &in) const
Definition: Operators.h:2101
Definition: FiniteDifference.h:197
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:51
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition: Operators.h:2102
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:496
Definition: FiniteDifference.h:198
Gradient operators defined in index space of various orders.
Definition: Operators.h:123
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Definition: Operators.h:2087
Definition: FiniteDifference.h:67
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1282
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:824
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:388
Definition: FiniteDifference.h:196
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:648
Definition: FiniteDifference.h:74
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:676
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1149
Definition: FiniteDifference.h:180
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:276
~GenericMap()
Definition: Operators.h:2096
Definition: FiniteDifference.h:1789
Biased gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:828
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition: Operators.h:220
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1359
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition: Operators.h:509
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:429
GenericMap(const Transform &t)
Definition: Operators.h:2093
Vec3d asVec3d() const
Definition: Coord.h:170
double determinant() const
Definition: Operators.h:2107
Definition: FiniteDifference.h:65
Definition: Stencils.h:243
Center difference gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:643
GenericMap(MapBase::Ptr map)
Definition: Operators.h:2094
SharedPtr< const MapBase > ConstPtr
Definition: Maps.h:165
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1463
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1511
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1215
Definition: Exceptions.h:40
Vec3d voxelSize(const Vec3d &v) const
Definition: Operators.h:2111
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition: Operators.h:2104
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1357
Compute the closest-point transform to a level set.
Definition: Operators.h:1657
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition: Operators.h:138
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1714
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1952
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:500
Definition: Operators.h:254
Definition: FiniteDifference.h:70
Abstract base class for maps.
Definition: Maps.h:161
Definition: Operators.h:861
Definition: FiniteDifference.h:66
Curl operator defined in index space using various first derivative schemes.
Definition: Operators.h:522
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1731
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:762
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1503
Tolerance for floating-point comparison.
Definition: Math.h:117
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition: Operators.h:1278
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1361
Definition: FiniteDifference.h:443
MapAdapter(const MapType &m)
Definition: Operators.h:63
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:412
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition: Operators.h:1904
Definition: FiniteDifference.h:181
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:67
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:685
Mat3d applyIJC(const Mat3d &m) const
Definition: Operators.h:2103
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1301
Definition: Operators.h:153
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:684
Definition: FiniteDifference.h:179
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:810
Definition: FiniteDifference.h:195
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1639
static double result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:81
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1006
Definition: FiniteDifference.h:73
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1919
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:526
Vec3d applyInverseMap(const Vec3d &in) const
Definition: Operators.h:2099
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition: Operators.h:228
Definition: FiniteDifference.h:62
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:796
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1815
Compute the mean curvature.
Definition: Operators.h:1753
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition: Operators.h:1895
Defines various finite difference stencils by means of the "curiously recurring template pattern" on ...
GenericMap(MapBase::ConstPtr map)
Definition: Operators.h:2095
double determinant(const Vec3d &in) const
Definition: Operators.h:2108
Definition: Operators.h:158
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1228
Definition: Stencils.h:536
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1195
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1524
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Stencil access version.
Definition: Operators.h:601
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:776
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:95
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
Compute the mean curvature in index space.
Definition: Operators.h:556
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition: Operators.h:241
Definition: FiniteDifference.h:68
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1247
ResultType result(const StencilType &stencil)
Definition: Operators.h:71
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:127
Compute the divergence of a vector-valued grid using differencing of various orders,...
Definition: Operators.h:953
Definition: FiniteDifference.h:194
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection.
Definition: Maps.h:1634
Definition: FiniteDifference.h:71
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:832
Vec3d applyMap(const Vec3d &in) const
Definition: Operators.h:2098
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1260
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:957
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:263
static double result(const MapT &map, const StencilType &stencil)
Definition: Operators.h:100
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:539
Type Pow2(Type x)
Return x2.
Definition: Math.h:502
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:118