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()));
823 template<
typename MapType, BiasedGradientScheme GradScheme>
831 template<
typename Accessor>
832 static typename Accessor::ValueType
833 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
835 typedef typename Accessor::ValueType ValueType;
844 template<
typename StencilT>
845 static typename StencilT::ValueType
846 result(
const MapType& map,
const StencilT& stencil)
848 typedef typename StencilT::ValueType ValueType;
858 template<BiasedGradientScheme GradScheme>
862 template<
typename Accessor>
863 static typename Accessor::ValueType
866 typedef typename Accessor::ValueType ValueType;
873 template<
typename StencilT>
874 static typename StencilT::ValueType
877 typedef typename StencilT::ValueType ValueType;
884 template<BiasedGradientScheme GradScheme>
888 template<
typename Accessor>
889 static typename Accessor::ValueType
892 typedef typename Accessor::ValueType ValueType;
899 template<
typename StencilT>
900 static typename StencilT::ValueType
903 typedef typename StencilT::ValueType ValueType;
912 template<
typename MapType, DScheme DiffScheme>
918 template<
typename Accessor>
static typename Accessor::ValueType::value_type
919 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
921 typedef typename Accessor::ValueType Vec3Type;
922 typedef typename Accessor::ValueType::value_type ValueType;
925 for (
int i=0; i < 3; i++) {
929 div += ValueType(map.applyIJT(vec, ijk.
asVec3d())[i]);
935 template<
typename StencilT>
static typename StencilT::ValueType::value_type
936 result(
const MapType& map,
const StencilT& stencil)
938 typedef typename StencilT::ValueType Vec3Type;
939 typedef typename StencilT::ValueType::value_type ValueType;
942 for (
int i=0; i < 3; i++) {
946 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
954 template<DScheme DiffScheme>
958 template<
typename Accessor>
static typename Accessor::ValueType::value_type
961 typedef typename Accessor::ValueType Vec3Type;
962 typedef typename Accessor::ValueType::value_type ValueType;
970 template<
typename StencilT>
static typename StencilT::ValueType::value_type
973 typedef typename StencilT::ValueType Vec3Type;
974 typedef typename StencilT::ValueType::value_type ValueType;
984 template<DScheme DiffScheme>
988 template<
typename Accessor>
static typename Accessor::ValueType::value_type
991 typedef typename Accessor::ValueType Vec3Type;
992 typedef typename Accessor::ValueType::value_type ValueType;
1002 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1005 typedef typename StencilT::ValueType Vec3Type;
1006 typedef typename StencilT::ValueType::value_type ValueType;
1011 ValueType invdx = ValueType(map.
getInvScale()[0]);
1018 template<DScheme DiffScheme>
1022 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1025 typedef typename Accessor::ValueType Vec3Type;
1026 typedef typename Accessor::ValueType::value_type ValueType;
1031 ValueType invdx = ValueType(map.
getInvScale()[0]);
1036 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1039 typedef typename StencilT::ValueType Vec3Type;
1040 typedef typename StencilT::ValueType::value_type ValueType;
1045 ValueType invdx = ValueType(map.
getInvScale()[0]);
1056 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1059 typedef typename Accessor::ValueType Vec3Type;
1060 typedef typename Accessor::ValueType::value_type ValueType;
1065 return div * inv2dx;
1069 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1072 typedef typename StencilT::ValueType Vec3Type;
1073 typedef typename StencilT::ValueType::value_type ValueType;
1078 return div * inv2dx;
1088 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1091 typedef typename Accessor::ValueType Vec3Type;
1092 typedef typename Accessor::ValueType::value_type ValueType;
1098 return div * inv2dx;
1102 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1105 typedef typename StencilT::ValueType Vec3Type;
1106 typedef typename StencilT::ValueType::value_type ValueType;
1112 return div * inv2dx;
1118 template<DScheme DiffScheme>
1122 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1125 typedef typename Accessor::ValueType Vec3Type;
1126 typedef typename Accessor::ValueType::value_type ValueType;
1128 ValueType div = ValueType(
1136 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1139 typedef typename StencilT::ValueType Vec3Type;
1140 typedef typename StencilT::ValueType::value_type ValueType;
1153 template<DScheme DiffScheme>
1157 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1160 typedef typename Accessor::ValueType Vec3Type;
1161 typedef typename Accessor::ValueType::value_type ValueType;
1163 ValueType div = ValueType(
1171 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1174 typedef typename StencilT::ValueType Vec3Type;
1175 typedef typename StencilT::ValueType::value_type ValueType;
1192 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1195 typedef typename Accessor::ValueType Vec3Type;
1196 typedef typename Accessor::ValueType::value_type ValueType;
1198 ValueType div = ValueType(
1206 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1209 typedef typename StencilT::ValueType Vec3Type;
1210 typedef typename StencilT::ValueType::value_type ValueType;
1212 ValueType div = ValueType(
1226 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1229 typedef typename Accessor::ValueType Vec3Type;
1230 typedef typename Accessor::ValueType::value_type ValueType;
1232 ValueType div = ValueType(
1240 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1243 typedef typename StencilT::ValueType Vec3Type;
1244 typedef typename StencilT::ValueType::value_type ValueType;
1246 ValueType div = ValueType(
1257 template<
typename MapType, DScheme DiffScheme>
1263 template<
typename Accessor>
static typename Accessor::ValueType
1266 typedef typename Accessor::ValueType Vec3Type;
1268 for (
int i = 0; i < 3; i++) {
1274 mat[i] = Vec3Type(map.applyIJT(vec, ijk.
asVec3d()));
1276 return Vec3Type(mat[2][1] - mat[1][2],
1277 mat[0][2] - mat[2][0],
1278 mat[1][0] - mat[0][1]);
1282 template<
typename StencilT>
static typename StencilT::ValueType
1283 result(
const MapType& map,
const StencilT& stencil)
1285 typedef typename StencilT::ValueType Vec3Type;
1287 for (
int i = 0; i < 3; i++) {
1293 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1295 return Vec3Type(mat[2][1] - mat[1][2],
1296 mat[0][2] - mat[2][0],
1297 mat[1][0] - mat[0][1]);
1302 template<DScheme DiffScheme>
1306 template<
typename Accessor>
static typename Accessor::ValueType
1309 typedef typename Accessor::ValueType Vec3Type;
1310 typedef typename Vec3Type::value_type ValueType;
1315 template<
typename StencilT>
static typename StencilT::ValueType
1318 typedef typename StencilT::ValueType Vec3Type;
1319 typedef typename Vec3Type::value_type ValueType;
1325 template<DScheme DiffScheme>
1329 template<
typename Accessor>
static typename Accessor::ValueType
1332 typedef typename Accessor::ValueType Vec3Type;
1333 typedef typename Vec3Type::value_type ValueType;
1339 template<
typename StencilT>
static typename StencilT::ValueType
1342 typedef typename StencilT::ValueType Vec3Type;
1343 typedef typename Vec3Type::value_type ValueType;
1353 template<
typename Accessor>
static typename Accessor::ValueType
1356 typedef typename Accessor::ValueType Vec3Type;
1357 typedef typename Vec3Type::value_type ValueType;
1363 template<
typename StencilT>
static typename StencilT::ValueType
1366 typedef typename StencilT::ValueType Vec3Type;
1367 typedef typename Vec3Type::value_type ValueType;
1377 template<
typename Accessor>
static typename Accessor::ValueType
1380 typedef typename Accessor::ValueType Vec3Type;
1381 typedef typename Vec3Type::value_type ValueType;
1387 template<
typename StencilT>
static typename StencilT::ValueType
1390 typedef typename StencilT::ValueType Vec3Type;
1391 typedef typename Vec3Type::value_type ValueType;
1400 template<
typename MapType, DDScheme DiffScheme>
1406 template<
typename Accessor>
1407 static typename Accessor::ValueType
result(
const MapType& map,
1408 const Accessor& grid,
const Coord& ijk)
1410 typedef typename Accessor::ValueType ValueType;
1421 Mat3d d2_is(iddx, iddxy, iddxz,
1423 iddxz, iddyz, iddz);
1427 d2_rs = map.applyIJC(d2_is);
1434 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1438 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1442 template<
typename StencilT>
1443 static typename StencilT::ValueType
result(
const MapType& map,
const StencilT& stencil)
1445 typedef typename StencilT::ValueType ValueType;
1456 Mat3d d2_is(iddx, iddxy, iddxz,
1458 iddxz, iddyz, iddz);
1462 d2_rs = map.applyIJC(d2_is);
1469 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1473 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1478 template<DDScheme DiffScheme>
1482 template<
typename Accessor>
1484 const Accessor& grid,
const Coord& ijk)
1490 template<
typename StencilT>
1499 template<DDScheme DiffScheme>
1503 template<
typename Accessor>
1505 const Accessor& grid,
const Coord& ijk)
1511 template<
typename StencilT>
1519 template<DDScheme DiffScheme>
1523 template<
typename Accessor>
static typename Accessor::ValueType
1526 typedef typename Accessor::ValueType ValueType;
1532 template<
typename StencilT>
static typename StencilT::ValueType
1535 typedef typename StencilT::ValueType ValueType;
1542 template<DDScheme DiffScheme>
1546 template<
typename Accessor>
static typename Accessor::ValueType
1549 typedef typename Accessor::ValueType ValueType;
1555 template<
typename StencilT>
static typename StencilT::ValueType
1558 typedef typename StencilT::ValueType ValueType;
1565 template<DDScheme DiffScheme>
1569 template<
typename Accessor>
static typename Accessor::ValueType
1572 typedef typename Accessor::ValueType ValueType;
1580 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1584 template<
typename StencilT>
static typename StencilT::ValueType
1587 typedef typename StencilT::ValueType ValueType;
1595 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1600 template<DDScheme DiffScheme>
1604 template<
typename Accessor>
static typename Accessor::ValueType
1607 typedef typename Accessor::ValueType ValueType;
1614 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1618 template<
typename StencilT>
static typename StencilT::ValueType
1621 typedef typename StencilT::ValueType ValueType;
1628 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1636 template<
typename MapType, DScheme DiffScheme>
1643 typedef typename Accessor::ValueType ValueType;
1647 ValueType d = grid.getValue(ijk);
1652 Vec3d result = ijk.
asVec3d() - map.applyInverseMap(vectorFromSurface);
1653 return Vec3Type(result);
1656 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1657 return Vec3Type(result);
1663 result(
const MapType& map,
const StencilT& stencil)
1665 typedef typename StencilT::ValueType ValueType;
1669 ValueType d = stencil.template getValue<0, 0, 0>();
1674 Vec3d result = stencil.getCenterCoord().asVec3d()
1675 - map.applyInverseMap(vectorFromSurface);
1676 return Vec3Type(result);
1678 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1679 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1680 return Vec3Type(result);
1689 template<
typename MapType, DScheme DiffScheme>
1696 typedef typename Accessor::ValueType ValueType;
1699 ValueType d = grid.getValue(ijk);
1702 Vec3Type vectorFromSurface =
1704 Vec3d result = map.applyMap(ijk.
asVec3d()) - vectorFromSurface;
1706 return Vec3Type(result);
1711 result(
const MapType& map,
const StencilT& stencil)
1713 typedef typename StencilT::ValueType ValueType;
1716 ValueType d = stencil.template getValue<0, 0, 0>();
1719 Vec3Type vectorFromSurface =
1721 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1723 return Vec3Type(result);
1731 template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1735 template<
typename Accessor>
1736 static void compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1737 double& alpha,
double& beta)
1739 typedef typename Accessor::ValueType ValueType;
1757 Mat3d d2_is(iddx, iddxy, iddxz,
1759 iddxz, iddyz, iddz);
1765 d2_rs = map.applyIJC(d2_is);
1766 d1_rs = map.applyIJT(d1_is);
1768 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1769 d1_rs = map.applyIJT(d1_is, ijk.
asVec3d());
1773 double Dx2 = d1_rs(0)*d1_rs(0);
1774 double Dy2 = d1_rs(1)*d1_rs(1);
1775 double Dz2 = d1_rs(2)*d1_rs(2);
1778 alpha = (Dx2*(d2_rs(1,1)+d2_rs(2,2))+Dy2*(d2_rs(0,0)+d2_rs(2,2))
1779 +Dz2*(d2_rs(0,0)+d2_rs(1,1))
1780 -2*(d1_rs(0)*(d1_rs(1)*d2_rs(0,1)+d1_rs(2)*d2_rs(0,2))
1781 +d1_rs(1)*d1_rs(2)*d2_rs(1,2)));
1782 beta = std::sqrt(Dx2 + Dy2 + Dz2);
1785 template<
typename Accessor>
1786 static typename Accessor::ValueType
result(
const MapType& map,
1787 const Accessor& grid,
const Coord& ijk)
1789 typedef typename Accessor::ValueType ValueType;
1791 compute(map, grid, ijk, alpha, beta);
1793 return ValueType(alpha/(2. *
math::Pow3(beta)));
1796 template<
typename Accessor>
1797 static typename Accessor::ValueType
normGrad(
const MapType& map,
1798 const Accessor& grid,
const Coord& ijk)
1800 typedef typename Accessor::ValueType ValueType;
1802 compute(map, grid, ijk, alpha, beta);
1804 return ValueType(alpha/(2. *
math::Pow2(beta)));
1808 template<
typename StencilT>
1809 static void compute(
const MapType& map,
const StencilT& stencil,
double& alpha,
double& beta)
1811 typedef typename StencilT::ValueType ValueType;
1829 Mat3d d2_is(iddx, iddxy, iddxz,
1831 iddxz, iddyz, iddz);
1837 d2_rs = map.applyIJC(d2_is);
1838 d1_rs = map.applyIJT(d1_is);
1840 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1841 d1_rs = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1845 double Dx2 = d1_rs(0)*d1_rs(0);
1846 double Dy2 = d1_rs(1)*d1_rs(1);
1847 double Dz2 = d1_rs(2)*d1_rs(2);
1850 alpha = (Dx2*(d2_rs(1,1)+d2_rs(2,2))+Dy2*(d2_rs(0,0)+d2_rs(2,2))
1851 +Dz2*(d2_rs(0,0)+d2_rs(1,1))
1852 -2*(d1_rs(0)*(d1_rs(1)*d2_rs(0,1)+d1_rs(2)*d2_rs(0,2))
1853 +d1_rs(1)*d1_rs(2)*d2_rs(1,2)));
1854 beta = std::sqrt(Dx2 + Dy2 + Dz2);
1857 template<
typename StencilT>
1858 static typename StencilT::ValueType
1859 result(
const MapType& map,
const StencilT stencil)
1861 typedef typename StencilT::ValueType ValueType;
1863 compute(map, stencil, alpha, beta);
1864 return ValueType(alpha/(2*
math::Pow3(beta)));
1867 template<
typename StencilT>
1868 static typename StencilT::ValueType
normGrad(
const MapType& map,
const StencilT stencil)
1870 typedef typename StencilT::ValueType ValueType;
1872 compute(map, stencil, alpha, beta);
1874 return ValueType(alpha/(2*
math::Pow2(beta)));
1879 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1883 template<
typename Accessor>
1885 const Accessor& grid,
const Coord& ijk)
1887 typedef typename Accessor::ValueType ValueType;
1889 ValueType alpha, beta;
1892 return ValueType(alpha /(2*
math::Pow3(beta)));
1895 template<
typename Accessor>
1897 const Accessor& grid,
const Coord& ijk)
1899 typedef typename Accessor::ValueType ValueType;
1901 ValueType alpha, beta;
1904 return ValueType(alpha/(2*
math::Pow2(beta)));
1908 template<
typename StencilT>
1911 typedef typename StencilT::ValueType ValueType;
1913 ValueType alpha, beta;
1916 return ValueType(alpha /(2*
math::Pow3(beta)));
1919 template<
typename StencilT>
1922 typedef typename StencilT::ValueType ValueType;
1924 ValueType alpha, beta;
1927 return ValueType(alpha/(2*
math::Pow2(beta)));
1932 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1936 template<
typename Accessor>
1938 const Accessor& grid,
const Coord& ijk)
1940 typedef typename Accessor::ValueType ValueType;
1942 ValueType alpha, beta;
1946 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1949 template<
typename Accessor>
1951 const Accessor& grid,
const Coord& ijk)
1953 typedef typename Accessor::ValueType ValueType;
1955 ValueType alpha, beta;
1959 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
1963 template<
typename StencilT>
1966 typedef typename StencilT::ValueType ValueType;
1968 ValueType alpha, beta;
1972 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1975 template<
typename StencilT>
1978 typedef typename StencilT::ValueType ValueType;
1980 ValueType alpha, beta;
1984 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
1989 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1993 template<
typename Accessor>
static typename Accessor::ValueType
1996 typedef typename Accessor::ValueType ValueType;
1998 ValueType alpha, beta;
2002 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2005 template<
typename Accessor>
static typename Accessor::ValueType
2008 typedef typename Accessor::ValueType ValueType;
2010 ValueType alpha, beta;
2014 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2018 template<
typename StencilT>
static typename StencilT::ValueType
2021 typedef typename StencilT::ValueType ValueType;
2023 ValueType alpha, beta;
2027 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2030 template<
typename StencilT>
static typename StencilT::ValueType
2033 typedef typename StencilT::ValueType ValueType;
2035 ValueType alpha, beta;
2039 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2051 template<
typename Gr
idType>
2066 {
return mMap->applyIJC(m,v,pos); }
2082 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:642
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition: Operators.h:238
boost::shared_ptr< const MapBase > ConstPtr
Definition: Maps.h:162
GenericMap(MapBase::ConstPtr map)
Definition: Operators.h:2056
Definition: FiniteDifference.h:66
static void result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Definition: Operators.h:544
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:210
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1137
Definition: FiniteDifference.h:195
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:833
ResultType result(const StencilType &stencil)
Definition: Operators.h:70
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:200
static double result(const MapT &map, const StencilType &stencil)
Definition: Operators.h:99
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition: Operators.h:493
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition: Operators.h:1260
double determinant() const
Definition: Operators.h:2068
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition: Operators.h:137
Definition: FiniteDifference.h:439
Map traits.
Definition: Maps.h:79
Type Pow3(Type x)
Return .
Definition: Math.h:464
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1283
const MapT & mMap
Definition: GridOperators.h:260
SevenPointStencil< GridType > StencilType
Definition: Operators.h:169
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:762
GenericMap(const Transform &t)
Definition: Operators.h:2054
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition: Operators.h:1868
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
Definition: Operators.h:1403
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:919
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
Definition: Maps.h:1617
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:684
Vec3d asVec3d() const
Definition: Coord.h:136
Definition: FiniteDifference.h:198
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1343
Definition: Operators.h:157
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1504
Definition: FiniteDifference.h:194
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:380
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:936
Type Pow2(Type x)
Return .
Definition: Math.h:460
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: FiniteDifference.h:71
Definition: Stencils.h:785
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:419
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:523
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:742
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1884
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1570
Biased gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:794
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1483
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:457
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Definition: Operators.h:2048
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:846
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Definition: Operators.h:61
Mat3d applyIJC(const Mat3d &m) const
Definition: Operators.h:2064
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition: Operators.h:2065
~GenericMap()
Definition: Operators.h:2057
Definition: FiniteDifference.h:1720
Vec3d applyInverseMap(const Vec3d &in) const
Definition: Operators.h:2060
GenericMap(const GridType &g)
Definition: Operators.h:2052
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:813
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
Definition: FiniteDifference.h:68
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition: Operators.h:78
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:650
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1207
Compute the closest-point transform to a level set.
Definition: Operators.h:1637
Gradient operators defined in index space of various orders.
Definition: Operators.h:122
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:260
Compute the closest-point transform to a level set.
Definition: Operators.h:1690
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition: Operators.h:810
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1641
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1123
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition: Operators.h:92
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:190
double determinant(const Vec3d &in) const
Definition: Operators.h:2069
Center difference gradient operators, defined with respect to the range-space of the map...
Definition: Operators.h:609
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:404
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1619
Definition: Operators.h:251
math::Vec3< ValueType > Vec3Type
Definition: Operators.h:111
Definition: Operators.h:109
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1909
A specialized linear transform that performs a translation.
Definition: Maps.h:996
Definition: Operators.h:824
Definition: FiniteDifference.h:1474
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1158
#define OPENVDB_VERSION_NAME
Definition: version.h:45
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:47
static void compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Definition: Operators.h:1736
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:273
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1711
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:102
Definition: FiniteDifference.h:73
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:390
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1193
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1605
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition: Operators.h:226
Abstract base class for maps.
Definition: Maps.h:158
Definition: FiniteDifference.h:179
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
Vec3d voxelSize(const Vec3d &v) const
Definition: Operators.h:2072
static double result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:80
Vec3d voxelSize() const
Definition: Operators.h:2071
Definition: FiniteDifference.h:180
static void compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Definition: Operators.h:1809
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1585
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1786
Definition: Operators.h:51
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:728
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:625
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:480
Vec3d applyIJT(const Vec3d &in) const
Definition: Operators.h:2062
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1407
const MapType map
Definition: Operators.h:72
Definition: FiniteDifference.h:70
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:438
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1171
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1264
Definition: FiniteDifference.h:181
Definition: FiniteDifference.h:67
Curl operator defined in index space using various first derivative schemes.
Definition: Operators.h:506
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1443
Definition: Operators.h:152
Definition: FiniteDifference.h:197
Definition: FiniteDifference.h:69
Vec3d applyMap(const Vec3d &in) const
Definition: Operators.h:2059
Definition: Stencils.h:519
Compute the mean curvature.
Definition: Operators.h:1732
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1339
Definition: FiniteDifference.h:65
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1797
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:776
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1694
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1491
T::ValueType ValueType
Definition: Operators.h:110
Definition: Operators.h:48
GenericMap(MapBase::Ptr map)
Definition: Operators.h:2055
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition: Operators.h:1512
Definition: FiniteDifference.h:72
Definition: FiniteDifference.h:196
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:94
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1663
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:815
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1172
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1920
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:126
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition: Operators.h:2063
static double result(const StencilType &stencil)
Definition: Operators.h:85
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:56
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1241
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:66
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:510
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1341
Compute the mean curvature in index space.
Definition: Operators.h:540
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:484
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1227
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition: Operators.h:1859
boost::shared_ptr< MapBase > Ptr
Definition: Maps.h:161
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
Laplacian defined in index space, using various center-difference stencils.
Definition: Operators.h:363
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1896
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:817
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition: Operators.h:219
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:614
SevenPointStencil< GridType > StencilType
Definition: Operators.h:158
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:959
ThirteenPointStencil< GridType > StencilType
Definition: Operators.h:180
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:915
MapAdapter(const MapType &m)
Definition: Operators.h:62
Definition: FiniteDifference.h:74
Definition: Stencils.h:234
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:971
Definition: FiniteDifference.h:62
static void result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Definition: Operators.h:573