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 typedef typename Accessor::ValueType ValueType;
139 typedef typename StencilT::ValueType ValueType;
151 template<BiasedGradientScheme bgs>
156 template<
typename Gr
idType>
167 template<
typename Gr
idType>
178 template<
typename Gr
idType>
188 template<
typename Gr
idType>
198 template<
typename Gr
idType>
208 template<
typename Gr
idType>
218 template<BiasedGradientScheme GradScheme,
typename Vec3Bias>
228 typedef typename Accessor::ValueType ValueType;
238 result(
const StencilT& stencil,
const Vec3Bias& V)
240 typedef typename StencilT::ValueType ValueType;
250 template<BiasedGradientScheme GradScheme>
258 template<
typename Accessor>
259 static typename Accessor::ValueType
262 typedef typename Accessor::ValueType ValueType;
271 template<
typename StencilT>
272 static typename StencilT::ValueType
275 typedef typename StencilT::ValueType ValueType;
284 #ifdef DWA_OPENVDB // for SIMD - note will do the computations in float
289 template<
typename Accessor>
290 static typename Accessor::ValueType
291 result(
const Accessor& grid,
const Coord& ijk)
293 typedef typename Accessor::ValueType ValueType;
298 v1(grid.getValue(ijk.offsetBy(-2, 0, 0)) - grid.getValue(ijk.offsetBy(-3, 0, 0)),
299 grid.getValue(ijk.offsetBy( 0,-2, 0)) - grid.getValue(ijk.offsetBy( 0,-3, 0)),
300 grid.getValue(ijk.offsetBy( 0, 0,-2)) - grid.getValue(ijk.offsetBy( 0, 0,-3)), 0),
301 v2(grid.getValue(ijk.offsetBy(-1, 0, 0)) - grid.getValue(ijk.offsetBy(-2, 0, 0)),
302 grid.getValue(ijk.offsetBy( 0,-1, 0)) - grid.getValue(ijk.offsetBy( 0,-2, 0)),
303 grid.getValue(ijk.offsetBy( 0, 0,-1)) - grid.getValue(ijk.offsetBy( 0, 0,-2)), 0),
304 v3(grid.getValue(ijk ) - grid.getValue(ijk.offsetBy(-1, 0, 0)),
305 grid.getValue(ijk ) - grid.getValue(ijk.offsetBy( 0,-1, 0)),
306 grid.getValue(ijk ) - grid.getValue(ijk.offsetBy( 0, 0,-1)), 0),
307 v4(grid.getValue(ijk.offsetBy( 1, 0, 0)) - grid.getValue(ijk ),
308 grid.getValue(ijk.offsetBy( 0, 1, 0)) - grid.getValue(ijk ),
309 grid.getValue(ijk.offsetBy( 0, 0, 1)) - grid.getValue(ijk ), 0),
310 v5(grid.getValue(ijk.offsetBy( 2, 0, 0)) - grid.getValue(ijk.offsetBy( 1, 0, 0)),
311 grid.getValue(ijk.offsetBy( 0, 2, 0)) - grid.getValue(ijk.offsetBy( 0, 1, 0)),
312 grid.getValue(ijk.offsetBy( 0, 0, 2)) - grid.getValue(ijk.offsetBy( 0, 0, 1)), 0),
313 v6(grid.getValue(ijk.offsetBy( 3, 0, 0)) - grid.getValue(ijk.offsetBy( 2, 0, 0)),
314 grid.getValue(ijk.offsetBy( 0, 3, 0)) - grid.getValue(ijk.offsetBy( 0, 2, 0)),
315 grid.getValue(ijk.offsetBy( 0, 0, 3)) - grid.getValue(ijk.offsetBy( 0, 0, 2)), 0),
323 template<
typename StencilT>
324 static typename StencilT::ValueType
325 result(
const StencilT& s)
327 typedef typename StencilT::ValueType ValueType;
332 v1(s.template getValue<-2, 0, 0>() - s.template getValue<-3, 0, 0>(),
333 s.template getValue< 0,-2, 0>() - s.template getValue< 0,-3, 0>(),
334 s.template getValue< 0, 0,-2>() - s.template getValue< 0, 0,-3>(), 0),
335 v2(s.template getValue<-1, 0, 0>() - s.template getValue<-2, 0, 0>(),
336 s.template getValue< 0,-1, 0>() - s.template getValue< 0,-2, 0>(),
337 s.template getValue< 0, 0,-1>() - s.template getValue< 0, 0,-2>(), 0),
338 v3(s.template getValue< 0, 0, 0>() - s.template getValue<-1, 0, 0>(),
339 s.template getValue< 0, 0, 0>() - s.template getValue< 0,-1, 0>(),
340 s.template getValue< 0, 0, 0>() - s.template getValue< 0, 0,-1>(), 0),
341 v4(s.template getValue< 1, 0, 0>() - s.template getValue< 0, 0, 0>(),
342 s.template getValue< 0, 1, 0>() - s.template getValue< 0, 0, 0>(),
343 s.template getValue< 0, 0, 1>() - s.template getValue< 0, 0, 0>(), 0),
344 v5(s.template getValue< 2, 0, 0>() - s.template getValue< 1, 0, 0>(),
345 s.template getValue< 0, 2, 0>() - s.template getValue< 0, 1, 0>(),
346 s.template getValue< 0, 0, 2>() - s.template getValue< 0, 0, 1>(), 0),
347 v6(s.template getValue< 3, 0, 0>() - s.template getValue< 2, 0, 0>(),
348 s.template getValue< 0, 3, 0>() - s.template getValue< 0, 2, 0>(),
349 s.template getValue< 0, 0, 3>() - s.template getValue< 0, 0, 2>(), 0),
356 #endif //DWA_OPENVDB // for SIMD - note will do the computations in float
361 template<DDScheme DiffScheme>
366 template<
typename Accessor>
367 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk);
370 template<
typename StencilT>
371 static typename StencilT::ValueType result(
const StencilT& stencil);
379 template<
typename Accessor>
380 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
382 return grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
383 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy(0, -1, 0)) +
385 - 6*grid.getValue(ijk);
389 template<
typename StencilT>
390 static typename StencilT::ValueType
result(
const StencilT& stencil)
392 return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
393 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
394 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
395 - 6*stencil.template getValue< 0, 0, 0>();
403 template<
typename Accessor>
404 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
407 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
408 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
409 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
411 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
412 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
413 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
414 - 7.5*grid.getValue(ijk);
418 template<
typename StencilT>
419 static typename StencilT::ValueType
result(
const StencilT& stencil)
422 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
423 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
424 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
426 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
427 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
428 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
429 - 7.5*stencil.template getValue< 0, 0, 0>();
437 template<
typename Accessor>
438 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
441 grid.getValue(ijk.
offsetBy(3,0,0)) + grid.getValue(ijk.
offsetBy(-3, 0, 0)) +
442 grid.getValue(ijk.
offsetBy(0,3,0)) + grid.getValue(ijk.
offsetBy( 0,-3, 0)) +
443 grid.getValue(ijk.
offsetBy(0,0,3)) + grid.getValue(ijk.
offsetBy( 0, 0,-3)) )
445 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
446 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
447 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
449 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
450 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
451 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
452 - (3*49/18.)*grid.getValue(ijk);
456 template<
typename StencilT>
457 static typename StencilT::ValueType
result(
const StencilT& stencil)
460 stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
461 stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
462 stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
464 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
465 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
466 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
468 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
469 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
470 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
471 - (3*49/18.)*stencil.template getValue< 0, 0, 0>();
478 template<DScheme DiffScheme>
483 template<
typename Accessor>
static typename Accessor::ValueType::value_type
492 template<
typename StencilT>
static typename StencilT::ValueType::value_type
504 template<DScheme DiffScheme>
509 template<
typename Accessor>
510 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
512 typedef typename Accessor::ValueType Vec3Type;
522 template<
typename StencilT>
523 static typename StencilT::ValueType
result(
const StencilT& stencil)
525 typedef typename StencilT::ValueType Vec3Type;
538 template<DDScheme DiffScheme2, DScheme DiffScheme1>
543 template<
typename Accessor>
545 typename Accessor::ValueType& alpha,
546 typename Accessor::ValueType& beta)
548 typedef typename Accessor::ValueType ValueType;
554 ValueType Dx2 = Dx*Dx;
555 ValueType Dy2 = Dy*Dy;
556 ValueType Dz2 = Dz*Dz;
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(Dx2 + Dy2 + Dz2)));
572 template<
typename StencilT>
573 static void result(
const StencilT& stencil,
574 typename StencilT::ValueType& alpha,
575 typename StencilT::ValueType& beta)
577 typedef typename StencilT::ValueType ValueType;
582 ValueType Dx2 = Dx*Dx;
583 ValueType Dy2 = Dy*Dy;
584 ValueType Dz2 = Dz*Dz;
595 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
596 beta = ValueType(std::sqrt(
double(Dx2 + Dy2 + Dz2)));
605 template<
typename MapType, DScheme DiffScheme>
612 template<
typename Accessor>
614 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
619 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
623 template<
typename StencilT>
625 result(
const MapType& map,
const StencilT& stencil)
630 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
636 template<DScheme DiffScheme>
640 template<
typename Accessor>
648 template<
typename StencilT>
662 template<
typename Accessor>
671 return iGradient * inv2dx;
675 template<
typename StencilT>
684 return iGradient * inv2dx;
694 template<
typename Accessor>
703 return iGradient * inv2dx;
707 template<
typename StencilT>
716 return iGradient * inv2dx;
726 template<
typename Accessor>
740 template<
typename StencilT>
760 template<
typename Accessor>
774 template<
typename StencilT>
791 template<
typename MapType, BiasedGradientScheme GradScheme>
798 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
801 typedef typename Accessor::ValueType ValueType;
805 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
810 result(
const MapType& map,
const StencilT& stencil,
813 typedef typename StencilT::ValueType ValueType;
817 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
826 template<
typename MapType, BiasedGradientScheme GradScheme>
834 template<
typename Accessor>
835 static typename Accessor::ValueType
836 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
838 typedef typename Accessor::ValueType ValueType;
847 template<
typename StencilT>
848 static typename StencilT::ValueType
849 result(
const MapType& map,
const StencilT& stencil)
851 typedef typename StencilT::ValueType ValueType;
861 template<BiasedGradientScheme GradScheme>
865 template<
typename Accessor>
866 static typename Accessor::ValueType
869 typedef typename Accessor::ValueType ValueType;
876 template<
typename StencilT>
877 static typename StencilT::ValueType
880 typedef typename StencilT::ValueType ValueType;
888 template<BiasedGradientScheme GradScheme>
892 template<
typename Accessor>
893 static typename Accessor::ValueType
896 typedef typename Accessor::ValueType ValueType;
903 template<
typename StencilT>
904 static typename StencilT::ValueType
907 typedef typename StencilT::ValueType ValueType;
916 template<
typename MapType, DScheme DiffScheme>
922 template<
typename Accessor>
static typename Accessor::ValueType::value_type
923 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
925 typedef typename Accessor::ValueType Vec3Type;
926 typedef typename Accessor::ValueType::value_type ValueType;
929 for (
int i=0; i < 3; i++) {
933 div += ValueType(map.applyIJT(vec, ijk.
asVec3d())[i]);
939 template<
typename StencilT>
static typename StencilT::ValueType::value_type
940 result(
const MapType& map,
const StencilT& stencil)
942 typedef typename StencilT::ValueType Vec3Type;
943 typedef typename StencilT::ValueType::value_type ValueType;
946 for (
int i=0; i < 3; i++) {
950 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
958 template<DScheme DiffScheme>
962 template<
typename Accessor>
static typename Accessor::ValueType::value_type
965 typedef typename Accessor::ValueType Vec3Type;
966 typedef typename Accessor::ValueType::value_type ValueType;
974 template<
typename StencilT>
static typename StencilT::ValueType::value_type
977 typedef typename StencilT::ValueType Vec3Type;
978 typedef typename StencilT::ValueType::value_type ValueType;
988 template<DScheme DiffScheme>
992 template<
typename Accessor>
static typename Accessor::ValueType::value_type
995 typedef typename Accessor::ValueType Vec3Type;
996 typedef typename Accessor::ValueType::value_type ValueType;
1001 ValueType invdx = ValueType(map.
getInvScale()[0]);
1006 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1009 typedef typename StencilT::ValueType Vec3Type;
1010 typedef typename StencilT::ValueType::value_type ValueType;
1015 ValueType invdx = ValueType(map.
getInvScale()[0]);
1022 template<DScheme DiffScheme>
1026 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1029 typedef typename Accessor::ValueType Vec3Type;
1030 typedef typename Accessor::ValueType::value_type ValueType;
1035 ValueType invdx = ValueType(map.
getInvScale()[0]);
1040 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1043 typedef typename StencilT::ValueType Vec3Type;
1044 typedef typename StencilT::ValueType::value_type ValueType;
1049 ValueType invdx = ValueType(map.
getInvScale()[0]);
1060 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1063 typedef typename Accessor::ValueType Vec3Type;
1064 typedef typename Accessor::ValueType::value_type ValueType;
1069 return div * inv2dx;
1073 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1076 typedef typename StencilT::ValueType Vec3Type;
1077 typedef typename StencilT::ValueType::value_type ValueType;
1082 return div * inv2dx;
1092 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1095 typedef typename Accessor::ValueType Vec3Type;
1096 typedef typename Accessor::ValueType::value_type ValueType;
1102 return div * inv2dx;
1106 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1109 typedef typename StencilT::ValueType Vec3Type;
1110 typedef typename StencilT::ValueType::value_type ValueType;
1116 return div * inv2dx;
1122 template<DScheme DiffScheme>
1126 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1129 typedef typename Accessor::ValueType Vec3Type;
1130 typedef typename Accessor::ValueType::value_type ValueType;
1132 ValueType div = ValueType(
1140 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1143 typedef typename StencilT::ValueType Vec3Type;
1144 typedef typename StencilT::ValueType::value_type ValueType;
1157 template<DScheme DiffScheme>
1161 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1164 typedef typename Accessor::ValueType Vec3Type;
1165 typedef typename Accessor::ValueType::value_type ValueType;
1167 ValueType div = ValueType(
1175 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1178 typedef typename StencilT::ValueType Vec3Type;
1179 typedef typename StencilT::ValueType::value_type ValueType;
1196 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1199 typedef typename Accessor::ValueType Vec3Type;
1200 typedef typename Accessor::ValueType::value_type ValueType;
1202 ValueType div = ValueType(
1210 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1213 typedef typename StencilT::ValueType Vec3Type;
1214 typedef typename StencilT::ValueType::value_type ValueType;
1216 ValueType div = ValueType(
1230 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1233 typedef typename Accessor::ValueType Vec3Type;
1234 typedef typename Accessor::ValueType::value_type ValueType;
1236 ValueType div = ValueType(
1244 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1247 typedef typename StencilT::ValueType Vec3Type;
1248 typedef typename StencilT::ValueType::value_type ValueType;
1250 ValueType div = ValueType(
1261 template<
typename MapType, DScheme DiffScheme>
1267 template<
typename Accessor>
static typename Accessor::ValueType
1270 typedef typename Accessor::ValueType Vec3Type;
1272 for (
int i = 0; i < 3; i++) {
1278 mat[i] = Vec3Type(map.applyIJT(vec, ijk.
asVec3d()));
1280 return Vec3Type(mat[2][1] - mat[1][2],
1281 mat[0][2] - mat[2][0],
1282 mat[1][0] - mat[0][1]);
1286 template<
typename StencilT>
static typename StencilT::ValueType
1287 result(
const MapType& map,
const StencilT& stencil)
1289 typedef typename StencilT::ValueType Vec3Type;
1291 for (
int i = 0; i < 3; i++) {
1297 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1299 return Vec3Type(mat[2][1] - mat[1][2],
1300 mat[0][2] - mat[2][0],
1301 mat[1][0] - mat[0][1]);
1306 template<DScheme DiffScheme>
1310 template<
typename Accessor>
static typename Accessor::ValueType
1313 typedef typename Accessor::ValueType Vec3Type;
1314 typedef typename Vec3Type::value_type ValueType;
1319 template<
typename StencilT>
static typename StencilT::ValueType
1322 typedef typename StencilT::ValueType Vec3Type;
1323 typedef typename Vec3Type::value_type ValueType;
1329 template<DScheme DiffScheme>
1333 template<
typename Accessor>
static typename Accessor::ValueType
1336 typedef typename Accessor::ValueType Vec3Type;
1337 typedef typename Vec3Type::value_type ValueType;
1343 template<
typename StencilT>
static typename StencilT::ValueType
1346 typedef typename StencilT::ValueType Vec3Type;
1347 typedef typename Vec3Type::value_type ValueType;
1358 template<
typename Accessor>
static typename Accessor::ValueType
1361 typedef typename Accessor::ValueType Vec3Type;
1362 typedef typename Vec3Type::value_type ValueType;
1368 template<
typename StencilT>
static typename StencilT::ValueType
1371 typedef typename StencilT::ValueType Vec3Type;
1372 typedef typename Vec3Type::value_type ValueType;
1383 template<
typename Accessor>
static typename Accessor::ValueType
1386 typedef typename Accessor::ValueType Vec3Type;
1387 typedef typename Vec3Type::value_type ValueType;
1393 template<
typename StencilT>
static typename StencilT::ValueType
1396 typedef typename StencilT::ValueType Vec3Type;
1397 typedef typename Vec3Type::value_type ValueType;
1406 template<
typename MapType, DDScheme DiffScheme>
1412 template<
typename Accessor>
1413 static typename Accessor::ValueType
result(
const MapType& map,
1414 const Accessor& grid,
const Coord& ijk)
1416 typedef typename Accessor::ValueType ValueType;
1427 Mat3d d2_is(iddx, iddxy, iddxz,
1429 iddxz, iddyz, iddz);
1433 d2_rs = map.applyIJC(d2_is);
1440 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1444 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1448 template<
typename StencilT>
1449 static typename StencilT::ValueType
result(
const MapType& map,
const StencilT& stencil)
1451 typedef typename StencilT::ValueType ValueType;
1462 Mat3d d2_is(iddx, iddxy, iddxz,
1464 iddxz, iddyz, iddz);
1468 d2_rs = map.applyIJC(d2_is);
1475 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1479 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1484 template<DDScheme DiffScheme>
1488 template<
typename Accessor>
1490 const Accessor& grid,
const Coord& ijk)
1496 template<
typename StencilT>
1505 template<DDScheme DiffScheme>
1509 template<
typename Accessor>
1511 const Accessor& grid,
const Coord& ijk)
1517 template<
typename StencilT>
1525 template<DDScheme DiffScheme>
1529 template<
typename Accessor>
static typename Accessor::ValueType
1532 typedef typename Accessor::ValueType ValueType;
1538 template<
typename StencilT>
static typename StencilT::ValueType
1541 typedef typename StencilT::ValueType ValueType;
1548 template<DDScheme DiffScheme>
1552 template<
typename Accessor>
static typename Accessor::ValueType
1555 typedef typename Accessor::ValueType ValueType;
1561 template<
typename StencilT>
static typename StencilT::ValueType
1564 typedef typename StencilT::ValueType ValueType;
1571 template<DDScheme DiffScheme>
1575 template<
typename Accessor>
static typename Accessor::ValueType
1578 typedef typename Accessor::ValueType ValueType;
1586 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1590 template<
typename StencilT>
static typename StencilT::ValueType
1593 typedef typename StencilT::ValueType ValueType;
1601 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1606 template<DDScheme DiffScheme>
1610 template<
typename Accessor>
static typename Accessor::ValueType
1613 typedef typename Accessor::ValueType ValueType;
1620 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1624 template<
typename StencilT>
static typename StencilT::ValueType
1627 typedef typename StencilT::ValueType ValueType;
1634 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1642 template<
typename MapType, DScheme DiffScheme>
1649 typedef typename Accessor::ValueType ValueType;
1653 ValueType d = grid.getValue(ijk);
1658 Vec3d result = ijk.
asVec3d() - map.applyInverseMap(vectorFromSurface);
1659 return Vec3Type(result);
1662 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1663 return Vec3Type(result);
1669 result(
const MapType& map,
const StencilT& stencil)
1671 typedef typename StencilT::ValueType ValueType;
1675 ValueType d = stencil.template getValue<0, 0, 0>();
1680 Vec3d result = stencil.getCenterCoord().asVec3d()
1681 - map.applyInverseMap(vectorFromSurface);
1682 return Vec3Type(result);
1684 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1685 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1686 return Vec3Type(result);
1695 template<
typename MapType, DScheme DiffScheme>
1702 typedef typename Accessor::ValueType ValueType;
1705 ValueType d = grid.getValue(ijk);
1708 Vec3Type vectorFromSurface =
1710 Vec3d result = map.applyMap(ijk.
asVec3d()) - vectorFromSurface;
1712 return Vec3Type(result);
1717 result(
const MapType& map,
const StencilT& stencil)
1719 typedef typename StencilT::ValueType ValueType;
1722 ValueType d = stencil.template getValue<0, 0, 0>();
1725 Vec3Type vectorFromSurface =
1727 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1729 return Vec3Type(result);
1737 template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1741 template<
typename Accessor>
1742 static void compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1743 double& alpha,
double& beta)
1745 typedef typename Accessor::ValueType ValueType;
1763 Mat3d d2_is(iddx, iddxy, iddxz,
1765 iddxz, iddyz, iddz);
1771 d2_rs = map.applyIJC(d2_is);
1772 d1_rs = map.applyIJT(d1_is);
1774 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1775 d1_rs = map.applyIJT(d1_is, ijk.
asVec3d());
1779 double Dx2 = d1_rs(0)*d1_rs(0);
1780 double Dy2 = d1_rs(1)*d1_rs(1);
1781 double Dz2 = d1_rs(2)*d1_rs(2);
1784 alpha = (Dx2*(d2_rs(1,1)+d2_rs(2,2))+Dy2*(d2_rs(0,0)+d2_rs(2,2))
1785 +Dz2*(d2_rs(0,0)+d2_rs(1,1))
1786 -2*(d1_rs(0)*(d1_rs(1)*d2_rs(0,1)+d1_rs(2)*d2_rs(0,2))
1787 +d1_rs(1)*d1_rs(2)*d2_rs(1,2)));
1788 beta = std::sqrt(Dx2 + Dy2 + Dz2);
1791 template<
typename Accessor>
1792 static typename Accessor::ValueType
result(
const MapType& map,
1793 const Accessor& grid,
const Coord& ijk)
1795 typedef typename Accessor::ValueType ValueType;
1797 compute(map, grid, ijk, alpha, beta);
1799 return ValueType(alpha/(2. *
math::Pow3(beta)));
1802 template<
typename Accessor>
1803 static typename Accessor::ValueType
normGrad(
const MapType& map,
1804 const Accessor& grid,
const Coord& ijk)
1806 typedef typename Accessor::ValueType ValueType;
1808 compute(map, grid, ijk, alpha, beta);
1810 return ValueType(alpha/(2. *
math::Pow2(beta)));
1814 template<
typename StencilT>
1815 static void compute(
const MapType& map,
const StencilT& stencil,
double& alpha,
double& beta)
1817 typedef typename StencilT::ValueType ValueType;
1835 Mat3d d2_is(iddx, iddxy, iddxz,
1837 iddxz, iddyz, iddz);
1843 d2_rs = map.applyIJC(d2_is);
1844 d1_rs = map.applyIJT(d1_is);
1846 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1847 d1_rs = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1851 double Dx2 = d1_rs(0)*d1_rs(0);
1852 double Dy2 = d1_rs(1)*d1_rs(1);
1853 double Dz2 = d1_rs(2)*d1_rs(2);
1856 alpha = (Dx2*(d2_rs(1,1)+d2_rs(2,2))+Dy2*(d2_rs(0,0)+d2_rs(2,2))
1857 +Dz2*(d2_rs(0,0)+d2_rs(1,1))
1858 -2*(d1_rs(0)*(d1_rs(1)*d2_rs(0,1)+d1_rs(2)*d2_rs(0,2))
1859 +d1_rs(1)*d1_rs(2)*d2_rs(1,2)));
1860 beta = std::sqrt(Dx2 + Dy2 + Dz2);
1863 template<
typename StencilT>
1864 static typename StencilT::ValueType
1865 result(
const MapType& map,
const StencilT stencil)
1867 typedef typename StencilT::ValueType ValueType;
1869 compute(map, stencil, alpha, beta);
1870 return ValueType(alpha/(2*
math::Pow3(beta)));
1873 template<
typename StencilT>
1874 static typename StencilT::ValueType
normGrad(
const MapType& map,
const StencilT stencil)
1876 typedef typename StencilT::ValueType ValueType;
1878 compute(map, stencil, alpha, beta);
1880 return ValueType(alpha/(2*
math::Pow2(beta)));
1885 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1889 template<
typename Accessor>
1891 const Accessor& grid,
const Coord& ijk)
1893 typedef typename Accessor::ValueType ValueType;
1895 ValueType alpha, beta;
1898 return ValueType(alpha /(2*
math::Pow3(beta)));
1901 template<
typename Accessor>
1903 const Accessor& grid,
const Coord& ijk)
1905 typedef typename Accessor::ValueType ValueType;
1907 ValueType alpha, beta;
1910 return ValueType(alpha/(2*
math::Pow2(beta)));
1914 template<
typename StencilT>
1917 typedef typename StencilT::ValueType ValueType;
1919 ValueType alpha, beta;
1922 return ValueType(alpha /(2*
math::Pow3(beta)));
1925 template<
typename StencilT>
1928 typedef typename StencilT::ValueType ValueType;
1930 ValueType alpha, beta;
1933 return ValueType(alpha/(2*
math::Pow2(beta)));
1938 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1942 template<
typename Accessor>
1944 const Accessor& grid,
const Coord& ijk)
1946 typedef typename Accessor::ValueType ValueType;
1948 ValueType alpha, beta;
1952 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1955 template<
typename Accessor>
1957 const Accessor& grid,
const Coord& ijk)
1959 typedef typename Accessor::ValueType ValueType;
1961 ValueType alpha, beta;
1965 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
1969 template<
typename StencilT>
1972 typedef typename StencilT::ValueType ValueType;
1974 ValueType alpha, beta;
1978 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1981 template<
typename StencilT>
1984 typedef typename StencilT::ValueType ValueType;
1986 ValueType alpha, beta;
1990 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
1995 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1999 template<
typename Accessor>
static typename Accessor::ValueType
2002 typedef typename Accessor::ValueType ValueType;
2004 ValueType alpha, beta;
2008 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2011 template<
typename Accessor>
static typename Accessor::ValueType
2014 typedef typename Accessor::ValueType ValueType;
2016 ValueType alpha, beta;
2020 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2024 template<
typename StencilT>
static typename StencilT::ValueType
2027 typedef typename StencilT::ValueType ValueType;
2029 ValueType alpha, beta;
2033 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2036 template<
typename StencilT>
static typename StencilT::ValueType
2039 typedef typename StencilT::ValueType ValueType;
2041 ValueType alpha, beta;
2045 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2057 template<
typename Gr
idType>
2072 {
return mMap->applyIJC(m,v,pos); }
2088 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
Real GudonovsNormSqrd(bool isOutside, Real dP_xm, Real dP_xp, Real dP_ym, Real dP_yp, Real dP_zm, Real dP_zp)
Definition: FiniteDifference.h:351
boost::shared_ptr< const MapBase > ConstPtr
Definition: Maps.h:162
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1890
Definition: FiniteDifference.h:196
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:94
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:404
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1926
math::Vec3< ValueType > Vec3Type
Definition: Operators.h:111
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1341
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:975
const MapT & mMap
Definition: GridOperators.h:384
Definition: FiniteDifference.h:68
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1449
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition: Operators.h:1874
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:923
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1197
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1902
T::ValueType ValueType
Definition: Operators.h:110
GenericMap(MapBase::ConstPtr map)
Definition: Operators.h:2062
Compute the mean curvature.
Definition: Operators.h:1738
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition: Operators.h:238
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:438
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:742
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:380
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition: Operators.h:2069
Definition: FiniteDifference.h:62
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1413
double determinant() const
Definition: Operators.h:2074
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1176
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1576
~GenericMap()
Definition: Operators.h:2063
Vec3d applyIJT(const Vec3d &in) const
Definition: Operators.h:2068
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1343
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1489
Type Pow2(Type x)
Return .
Definition: Math.h:467
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:419
Vec3d applyMap(const Vec3d &in) const
Definition: Operators.h:2065
Definition: Stencils.h:519
Definition: FiniteDifference.h:179
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:813
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:776
Mat3d applyIJC(const Mat3d &m) const
Definition: Operators.h:2070
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1611
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
Definition: Operators.h:1409
Vec3d voxelSize() const
Definition: Operators.h:2077
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
Definition: FiniteDifference.h:198
const MapType map
Definition: Operators.h:72
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1625
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition: Operators.h:92
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:523
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition: Operators.h:810
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition: Operators.h:1518
Definition: Operators.h:251
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:126
Definition: FiniteDifference.h:70
static void result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Definition: Operators.h:573
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1162
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:919
MapAdapter(const MapType &m)
Definition: Operators.h:62
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1700
Definition: Operators.h:109
Definition: FiniteDifference.h:71
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:457
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:66
Vec3d asVec3d() const
Definition: Coord.h:136
Definition: FiniteDifference.h:1474
#define OPENVDB_VERSION_NAME
Definition: version.h:45
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:510
static void compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Definition: Operators.h:1742
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:47
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1127
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:484
Vec3d voxelSize(const Vec3d &v) const
Definition: Operators.h:2078
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:390
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition: Operators.h:219
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:762
Definition: FiniteDifference.h:181
Definition: FiniteDifference.h:67
static double result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:80
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition: Operators.h:493
Definition: Operators.h:51
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:728
Compute the closest-point transform to a level set.
Definition: Operators.h:1696
static void compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Definition: Operators.h:1815
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:798
Definition: FiniteDifference.h:439
Definition: FiniteDifference.h:65
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:849
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1591
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1792
Vec3d applyInverseMap(const Vec3d &in) const
Definition: Operators.h:2066
Definition: Operators.h:157
Compute the closest-point transform to a level set.
Definition: Operators.h:1643
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:480
ResultType result(const StencilType &stencil)
Definition: Operators.h:70
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
Definition: Maps.h:1619
Definition: FiniteDifference.h:72
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1647
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1245
Definition: Operators.h:48
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:625
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition: Operators.h:1264
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:200
Map traits.
Definition: Maps.h:79
double determinant(const Vec3d &in) const
Definition: Operators.h:2075
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1173
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1915
Definition: FiniteDifference.h:73
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:650
Compute the mean curvature in index space.
Definition: Operators.h:540
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:940
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Definition: Operators.h:2054
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition: Operators.h:137
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1231
Curl operator defined in index space using various first derivative schemes.
Definition: Operators.h:506
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:190
Definition: FiniteDifference.h:180
ThirteenPointStencil< GridType > StencilType
Definition: Operators.h:180
Definition: Operators.h:152
Definition: FiniteDifference.h:1720
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition: Operators.h:226
Definition: FiniteDifference.h:74
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1510
ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, float scale2=0.01)
implimentation of nonimally fith-order finite-difference WENO. This function returns the numerical fl...
Definition: FiniteDifference.h:331
Definition: Stencils.h:785
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1803
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:836
GenericMap(const GridType &g)
Definition: Operators.h:2058
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1669
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1497
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:684
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1345
Biased gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:794
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:210
Definition: FiniteDifference.h:66
Type Pow3(Type x)
Return .
Definition: Math.h:471
Gradient operators defined in index space of various orders.
Definition: Operators.h:122
Definition: FiniteDifference.h:195
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:815
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1717
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:260
static double result(const MapT &map, const StencilType &stencil)
Definition: Operators.h:99
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Definition: Operators.h:61
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:102
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition: Operators.h:2071
GenericMap(MapBase::Ptr map)
Definition: Operators.h:2061
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:817
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1287
static double result(const StencilType &stencil)
Definition: Operators.h:85
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1211
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:642
static void result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Definition: Operators.h:544
Definition: Operators.h:827
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:273
Abstract base class for maps.
Definition: Maps.h:158
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1268
boost::shared_ptr< MapBase > Ptr
Definition: Maps.h:161
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:614
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition: Operators.h:1865
Laplacian defined in index space, using various center-difference stencils.
Definition: Operators.h:363
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition: Operators.h:78
Center difference gradient operators, defined with respect to the range-space of the map...
Definition: Operators.h:609
SevenPointStencil< GridType > StencilType
Definition: Operators.h:158
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1141
Definition: FiniteDifference.h:197
Definition: FiniteDifference.h:69
Definition: FiniteDifference.h:194
SevenPointStencil< GridType > StencilType
Definition: Operators.h:169
GenericMap(const Transform &t)
Definition: Operators.h:2060
Definition: Stencils.h:234
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:963
A specialized linear transform that performs a translation.
Definition: Maps.h:998