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)
295 v1(grid.getValue(ijk.offsetBy(-2, 0, 0)) - grid.getValue(ijk.offsetBy(-3, 0, 0)),
296 grid.getValue(ijk.offsetBy( 0,-2, 0)) - grid.getValue(ijk.offsetBy( 0,-3, 0)),
297 grid.getValue(ijk.offsetBy( 0, 0,-2)) - grid.getValue(ijk.offsetBy( 0, 0,-3)), 0),
298 v2(grid.getValue(ijk.offsetBy(-1, 0, 0)) - grid.getValue(ijk.offsetBy(-2, 0, 0)),
299 grid.getValue(ijk.offsetBy( 0,-1, 0)) - grid.getValue(ijk.offsetBy( 0,-2, 0)),
300 grid.getValue(ijk.offsetBy( 0, 0,-1)) - grid.getValue(ijk.offsetBy( 0, 0,-2)), 0),
301 v3(grid.getValue(ijk ) - grid.getValue(ijk.offsetBy(-1, 0, 0)),
302 grid.getValue(ijk ) - grid.getValue(ijk.offsetBy( 0,-1, 0)),
303 grid.getValue(ijk ) - grid.getValue(ijk.offsetBy( 0, 0,-1)), 0),
304 v4(grid.getValue(ijk.offsetBy( 1, 0, 0)) - grid.getValue(ijk ),
305 grid.getValue(ijk.offsetBy( 0, 1, 0)) - grid.getValue(ijk ),
306 grid.getValue(ijk.offsetBy( 0, 0, 1)) - grid.getValue(ijk ), 0),
307 v5(grid.getValue(ijk.offsetBy( 2, 0, 0)) - grid.getValue(ijk.offsetBy( 1, 0, 0)),
308 grid.getValue(ijk.offsetBy( 0, 2, 0)) - grid.getValue(ijk.offsetBy( 0, 1, 0)),
309 grid.getValue(ijk.offsetBy( 0, 0, 2)) - grid.getValue(ijk.offsetBy( 0, 0, 1)), 0),
310 v6(grid.getValue(ijk.offsetBy( 3, 0, 0)) - grid.getValue(ijk.offsetBy( 2, 0, 0)),
311 grid.getValue(ijk.offsetBy( 0, 3, 0)) - grid.getValue(ijk.offsetBy( 0, 2, 0)),
312 grid.getValue(ijk.offsetBy( 0, 0, 3)) - grid.getValue(ijk.offsetBy( 0, 0, 2)), 0),
320 template<
typename StencilT>
321 static typename StencilT::ValueType
322 result(
const StencilT& s)
326 v1(s.template getValue<-2, 0, 0>() - s.template getValue<-3, 0, 0>(),
327 s.template getValue< 0,-2, 0>() - s.template getValue< 0,-3, 0>(),
328 s.template getValue< 0, 0,-2>() - s.template getValue< 0, 0,-3>(), 0),
329 v2(s.template getValue<-1, 0, 0>() - s.template getValue<-2, 0, 0>(),
330 s.template getValue< 0,-1, 0>() - s.template getValue< 0,-2, 0>(),
331 s.template getValue< 0, 0,-1>() - s.template getValue< 0, 0,-2>(), 0),
332 v3(s.template getValue< 0, 0, 0>() - s.template getValue<-1, 0, 0>(),
333 s.template getValue< 0, 0, 0>() - s.template getValue< 0,-1, 0>(),
334 s.template getValue< 0, 0, 0>() - s.template getValue< 0, 0,-1>(), 0),
335 v4(s.template getValue< 1, 0, 0>() - s.template getValue< 0, 0, 0>(),
336 s.template getValue< 0, 1, 0>() - s.template getValue< 0, 0, 0>(),
337 s.template getValue< 0, 0, 1>() - s.template getValue< 0, 0, 0>(), 0),
338 v5(s.template getValue< 2, 0, 0>() - s.template getValue< 1, 0, 0>(),
339 s.template getValue< 0, 2, 0>() - s.template getValue< 0, 1, 0>(),
340 s.template getValue< 0, 0, 2>() - s.template getValue< 0, 0, 1>(), 0),
341 v6(s.template getValue< 3, 0, 0>() - s.template getValue< 2, 0, 0>(),
342 s.template getValue< 0, 3, 0>() - s.template getValue< 0, 2, 0>(),
343 s.template getValue< 0, 0, 3>() - s.template getValue< 0, 0, 2>(), 0),
350 #endif //DWA_OPENVDB // for SIMD - note will do the computations in float
355 template<DDScheme DiffScheme>
360 template<
typename Accessor>
361 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk);
364 template<
typename StencilT>
365 static typename StencilT::ValueType result(
const StencilT& stencil);
373 template<
typename Accessor>
374 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
376 return grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
377 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy(0, -1, 0)) +
379 - 6*grid.getValue(ijk);
383 template<
typename StencilT>
384 static typename StencilT::ValueType
result(
const StencilT& stencil)
386 return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
387 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
388 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
389 - 6*stencil.template getValue< 0, 0, 0>();
397 template<
typename Accessor>
398 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
401 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
402 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
403 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
405 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
406 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
407 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
408 - 7.5*grid.getValue(ijk);
412 template<
typename StencilT>
413 static typename StencilT::ValueType
result(
const StencilT& stencil)
416 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
417 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
418 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
420 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
421 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
422 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
423 - 7.5*stencil.template getValue< 0, 0, 0>();
431 template<
typename Accessor>
432 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
435 grid.getValue(ijk.
offsetBy(3,0,0)) + grid.getValue(ijk.
offsetBy(-3, 0, 0)) +
436 grid.getValue(ijk.
offsetBy(0,3,0)) + grid.getValue(ijk.
offsetBy( 0,-3, 0)) +
437 grid.getValue(ijk.
offsetBy(0,0,3)) + grid.getValue(ijk.
offsetBy( 0, 0,-3)) )
439 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
440 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
441 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
443 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
444 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
445 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
446 - (3*49/18.)*grid.getValue(ijk);
450 template<
typename StencilT>
451 static typename StencilT::ValueType
result(
const StencilT& stencil)
454 stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
455 stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
456 stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
458 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
459 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
460 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
462 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
463 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
464 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
465 - (3*49/18.)*stencil.template getValue< 0, 0, 0>();
472 template<DScheme DiffScheme>
477 template<
typename Accessor>
static typename Accessor::ValueType::value_type
486 template<
typename StencilT>
static typename StencilT::ValueType::value_type
498 template<DScheme DiffScheme>
503 template<
typename Accessor>
504 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
506 typedef typename Accessor::ValueType Vec3Type;
516 template<
typename StencilT>
517 static typename StencilT::ValueType
result(
const StencilT& stencil)
519 typedef typename StencilT::ValueType Vec3Type;
532 template<DDScheme DiffScheme2, DScheme DiffScheme1>
540 template<
typename Accessor>
542 typename Accessor::ValueType& alpha,
543 typename Accessor::ValueType& beta)
545 typedef typename Accessor::ValueType ValueType;
551 const ValueType Dx2 = Dx*Dx;
552 const ValueType Dy2 = Dy*Dy;
553 const ValueType Dz2 = Dz*Dz;
554 const ValueType normGrad = Dx2 + Dy2 + Dz2;
569 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
570 beta = ValueType(std::sqrt(
double(normGrad)));
578 template<
typename StencilT>
579 static bool result(
const StencilT& stencil,
580 typename StencilT::ValueType& alpha,
581 typename StencilT::ValueType& beta)
583 typedef typename StencilT::ValueType ValueType;
588 const ValueType Dx2 = Dx*Dx;
589 const ValueType Dy2 = Dy*Dy;
590 const ValueType Dz2 = Dz*Dz;
591 const ValueType normGrad = Dx2 + Dy2 + Dz2;
606 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
607 beta = ValueType(std::sqrt(
double(normGrad)));
617 template<
typename MapType, DScheme DiffScheme>
624 template<
typename Accessor>
626 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
631 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
635 template<
typename StencilT>
637 result(
const MapType& map,
const StencilT& stencil)
642 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
648 template<DScheme DiffScheme>
652 template<
typename Accessor>
660 template<
typename StencilT>
674 template<
typename Accessor>
683 return iGradient * inv2dx;
687 template<
typename StencilT>
696 return iGradient * inv2dx;
706 template<
typename Accessor>
715 return iGradient * inv2dx;
719 template<
typename StencilT>
728 return iGradient * inv2dx;
738 template<
typename Accessor>
752 template<
typename StencilT>
772 template<
typename Accessor>
786 template<
typename StencilT>
803 template<
typename MapType, BiasedGradientScheme GradScheme>
810 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
813 typedef typename Accessor::ValueType ValueType;
817 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
822 result(
const MapType& map,
const StencilT& stencil,
825 typedef typename StencilT::ValueType ValueType;
829 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
838 template<
typename MapType, BiasedGradientScheme GradScheme>
846 template<
typename Accessor>
847 static typename Accessor::ValueType
848 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
850 typedef typename Accessor::ValueType ValueType;
859 template<
typename StencilT>
860 static typename StencilT::ValueType
861 result(
const MapType& map,
const StencilT& stencil)
863 typedef typename StencilT::ValueType ValueType;
873 template<BiasedGradientScheme GradScheme>
877 template<
typename Accessor>
878 static typename Accessor::ValueType
881 typedef typename Accessor::ValueType ValueType;
888 template<
typename StencilT>
889 static typename StencilT::ValueType
892 typedef typename StencilT::ValueType ValueType;
900 template<BiasedGradientScheme GradScheme>
904 template<
typename Accessor>
905 static typename Accessor::ValueType
908 typedef typename Accessor::ValueType ValueType;
915 template<
typename StencilT>
916 static typename StencilT::ValueType
919 typedef typename StencilT::ValueType ValueType;
928 template<
typename MapType, DScheme DiffScheme>
934 template<
typename Accessor>
static typename Accessor::ValueType::value_type
935 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
937 typedef typename Accessor::ValueType::value_type ValueType;
940 for (
int i=0; i < 3; i++) {
944 div += ValueType(map.applyIJT(vec, ijk.
asVec3d())[i]);
950 template<
typename StencilT>
static typename StencilT::ValueType::value_type
951 result(
const MapType& map,
const StencilT& stencil)
953 typedef typename StencilT::ValueType::value_type ValueType;
956 for (
int i=0; i < 3; i++) {
960 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
968 template<DScheme DiffScheme>
972 template<
typename Accessor>
static typename Accessor::ValueType::value_type
975 typedef typename Accessor::ValueType::value_type ValueType;
983 template<
typename StencilT>
static typename StencilT::ValueType::value_type
986 typedef typename StencilT::ValueType::value_type ValueType;
996 template<DScheme DiffScheme>
1000 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1003 typedef typename Accessor::ValueType::value_type ValueType;
1008 ValueType invdx = ValueType(map.
getInvScale()[0]);
1013 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1016 typedef typename StencilT::ValueType::value_type ValueType;
1021 ValueType invdx = ValueType(map.
getInvScale()[0]);
1028 template<DScheme DiffScheme>
1032 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1035 typedef typename Accessor::ValueType::value_type ValueType;
1040 ValueType invdx = ValueType(map.
getInvScale()[0]);
1045 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1048 typedef typename StencilT::ValueType::value_type ValueType;
1053 ValueType invdx = ValueType(map.
getInvScale()[0]);
1064 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1067 typedef typename Accessor::ValueType::value_type ValueType;
1072 return div * inv2dx;
1076 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1079 typedef typename StencilT::ValueType::value_type ValueType;
1084 return div * inv2dx;
1094 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1097 typedef typename Accessor::ValueType::value_type ValueType;
1103 return div * inv2dx;
1107 template<
typename StencilT>
static typename StencilT::ValueType::value_type
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::value_type ValueType;
1131 ValueType div = ValueType(
1139 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1142 typedef typename StencilT::ValueType::value_type ValueType;
1155 template<DScheme DiffScheme>
1159 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1162 typedef typename Accessor::ValueType::value_type ValueType;
1164 ValueType div = ValueType(
1172 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1175 typedef typename StencilT::ValueType::value_type ValueType;
1192 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1195 typedef typename Accessor::ValueType::value_type ValueType;
1197 ValueType div = ValueType(
1205 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1208 typedef typename StencilT::ValueType::value_type ValueType;
1210 ValueType div = ValueType(
1224 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1227 typedef typename Accessor::ValueType::value_type ValueType;
1229 ValueType div = ValueType(
1237 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1240 typedef typename StencilT::ValueType::value_type ValueType;
1242 ValueType div = ValueType(
1253 template<
typename MapType, DScheme DiffScheme>
1259 template<
typename Accessor>
static typename Accessor::ValueType
1262 typedef typename Accessor::ValueType Vec3Type;
1264 for (
int i = 0; i < 3; i++) {
1270 mat[i] = Vec3Type(map.applyIJT(vec, ijk.
asVec3d()));
1272 return Vec3Type(mat[2][1] - mat[1][2],
1273 mat[0][2] - mat[2][0],
1274 mat[1][0] - mat[0][1]);
1278 template<
typename StencilT>
static typename StencilT::ValueType
1279 result(
const MapType& map,
const StencilT& stencil)
1281 typedef typename StencilT::ValueType Vec3Type;
1283 for (
int i = 0; i < 3; i++) {
1289 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1291 return Vec3Type(mat[2][1] - mat[1][2],
1292 mat[0][2] - mat[2][0],
1293 mat[1][0] - mat[0][1]);
1298 template<DScheme DiffScheme>
1302 template<
typename Accessor>
static typename Accessor::ValueType
1305 typedef typename Accessor::ValueType Vec3Type;
1306 typedef typename Vec3Type::value_type ValueType;
1311 template<
typename StencilT>
static typename StencilT::ValueType
1314 typedef typename StencilT::ValueType Vec3Type;
1315 typedef typename Vec3Type::value_type ValueType;
1321 template<DScheme DiffScheme>
1325 template<
typename Accessor>
static typename Accessor::ValueType
1328 typedef typename Accessor::ValueType Vec3Type;
1329 typedef typename Vec3Type::value_type ValueType;
1335 template<
typename StencilT>
static typename StencilT::ValueType
1338 typedef typename StencilT::ValueType Vec3Type;
1339 typedef typename Vec3Type::value_type ValueType;
1350 template<
typename Accessor>
static typename Accessor::ValueType
1353 typedef typename Accessor::ValueType Vec3Type;
1354 typedef typename Vec3Type::value_type ValueType;
1360 template<
typename StencilT>
static typename StencilT::ValueType
1363 typedef typename StencilT::ValueType Vec3Type;
1364 typedef typename Vec3Type::value_type ValueType;
1375 template<
typename Accessor>
static typename Accessor::ValueType
1378 typedef typename Accessor::ValueType Vec3Type;
1379 typedef typename Vec3Type::value_type ValueType;
1385 template<
typename StencilT>
static typename StencilT::ValueType
1388 typedef typename StencilT::ValueType Vec3Type;
1389 typedef typename Vec3Type::value_type ValueType;
1398 template<
typename MapType, DDScheme DiffScheme>
1404 template<
typename Accessor>
1405 static typename Accessor::ValueType
result(
const MapType& map,
1406 const Accessor& grid,
const Coord& ijk)
1408 typedef typename Accessor::ValueType ValueType;
1419 Mat3d d2_is(iddx, iddxy, iddxz,
1421 iddxz, iddyz, iddz);
1425 d2_rs = map.applyIJC(d2_is);
1432 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1436 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1440 template<
typename StencilT>
1441 static typename StencilT::ValueType
result(
const MapType& map,
const StencilT& stencil)
1443 typedef typename StencilT::ValueType ValueType;
1454 Mat3d d2_is(iddx, iddxy, iddxz,
1456 iddxz, iddyz, iddz);
1460 d2_rs = map.applyIJC(d2_is);
1467 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1471 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1476 template<DDScheme DiffScheme>
1480 template<
typename Accessor>
1482 const Accessor& grid,
const Coord& ijk)
1488 template<
typename StencilT>
1497 template<DDScheme DiffScheme>
1501 template<
typename Accessor>
1503 const Accessor& grid,
const Coord& ijk)
1509 template<
typename StencilT>
1517 template<DDScheme DiffScheme>
1521 template<
typename Accessor>
static typename Accessor::ValueType
1524 typedef typename Accessor::ValueType ValueType;
1530 template<
typename StencilT>
static typename StencilT::ValueType
1533 typedef typename StencilT::ValueType ValueType;
1540 template<DDScheme DiffScheme>
1544 template<
typename Accessor>
static typename Accessor::ValueType
1547 typedef typename Accessor::ValueType ValueType;
1553 template<
typename StencilT>
static typename StencilT::ValueType
1556 typedef typename StencilT::ValueType ValueType;
1563 template<DDScheme DiffScheme>
1567 template<
typename Accessor>
static typename Accessor::ValueType
1570 typedef typename Accessor::ValueType ValueType;
1578 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1582 template<
typename StencilT>
static typename StencilT::ValueType
1585 typedef typename StencilT::ValueType ValueType;
1593 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1598 template<DDScheme DiffScheme>
1602 template<
typename Accessor>
static typename Accessor::ValueType
1605 typedef typename Accessor::ValueType ValueType;
1612 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1616 template<
typename StencilT>
static typename StencilT::ValueType
1619 typedef typename StencilT::ValueType ValueType;
1626 return ValueType(iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2]);
1634 template<
typename MapType, DScheme DiffScheme>
1641 typedef typename Accessor::ValueType ValueType;
1645 ValueType d = grid.getValue(ijk);
1650 Vec3d result = ijk.
asVec3d() - map.applyInverseMap(vectorFromSurface);
1651 return Vec3Type(result);
1654 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1655 return Vec3Type(result);
1661 result(
const MapType& map,
const StencilT& stencil)
1663 typedef typename StencilT::ValueType ValueType;
1667 ValueType d = stencil.template getValue<0, 0, 0>();
1672 Vec3d result = stencil.getCenterCoord().asVec3d()
1673 - map.applyInverseMap(vectorFromSurface);
1674 return Vec3Type(result);
1676 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1677 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1678 return Vec3Type(result);
1687 template<
typename MapType, DScheme DiffScheme>
1694 typedef typename Accessor::ValueType ValueType;
1697 ValueType d = grid.getValue(ijk);
1700 Vec3Type vectorFromSurface =
1702 Vec3d result = map.applyMap(ijk.
asVec3d()) - vectorFromSurface;
1704 return Vec3Type(result);
1709 result(
const MapType& map,
const StencilT& stencil)
1711 typedef typename StencilT::ValueType ValueType;
1714 ValueType d = stencil.template getValue<0, 0, 0>();
1717 Vec3Type vectorFromSurface =
1719 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1721 return Vec3Type(result);
1729 template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1736 template<
typename Accessor>
1737 static bool compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1738 double& alpha,
double& beta)
1740 typedef typename Accessor::ValueType ValueType;
1747 d1_ws = map.applyIJT(d1_is);
1749 d1_ws = map.applyIJT(d1_is, ijk.
asVec3d());
1751 const double Dx2 = d1_ws(0)*d1_ws(0);
1752 const double Dy2 = d1_ws(1)*d1_ws(1);
1753 const double Dz2 = d1_ws(2)*d1_ws(2);
1754 const double normGrad = Dx2 + Dy2 + Dz2;
1770 Mat3d d2_is(iddx, iddxy, iddxz,
1772 iddxz, iddyz, iddz);
1777 d2_ws = map.applyIJC(d2_is);
1779 d2_ws = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1783 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1784 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1785 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1786 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1787 beta = std::sqrt(normGrad);
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 return compute(map, grid, ijk, alpha, beta) ?
1801 template<
typename Accessor>
1802 static typename Accessor::ValueType
normGrad(
const MapType& map,
1803 const Accessor& grid,
const Coord& ijk)
1805 typedef typename Accessor::ValueType ValueType;
1807 return compute(map, grid, ijk, alpha, beta) ?
1815 template<
typename StencilT>
1816 static bool compute(
const MapType& map,
const StencilT& stencil,
1817 double& alpha,
double& beta)
1819 typedef typename StencilT::ValueType ValueType;
1826 d1_ws = map.applyIJT(d1_is);
1828 d1_ws = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1830 const double Dx2 = d1_ws(0)*d1_ws(0);
1831 const double Dy2 = d1_ws(1)*d1_ws(1);
1832 const double Dz2 = d1_ws(2)*d1_ws(2);
1833 const double normGrad = Dx2 + Dy2 + Dz2;
1849 Mat3d d2_is(iddx, iddxy, iddxz,
1851 iddxz, iddyz, iddz);
1856 d2_ws = map.applyIJC(d2_is);
1858 d2_ws = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1862 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1863 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1864 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1865 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1866 beta = std::sqrt(normGrad);
1870 template<
typename StencilT>
1871 static typename StencilT::ValueType
1872 result(
const MapType& map,
const StencilT stencil)
1874 typedef typename StencilT::ValueType ValueType;
1876 return compute(map, stencil, alpha, beta) ?
1880 template<
typename StencilT>
1881 static typename StencilT::ValueType
normGrad(
const MapType& map,
const StencilT stencil)
1883 typedef typename StencilT::ValueType ValueType;
1885 return compute(map, stencil, alpha, beta) ?
1891 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1895 template<
typename Accessor>
1897 const Accessor& grid,
const Coord& ijk)
1899 typedef typename Accessor::ValueType ValueType;
1901 ValueType alpha, beta;
1906 template<
typename Accessor>
1908 const Accessor& grid,
const Coord& ijk)
1910 typedef typename Accessor::ValueType ValueType;
1912 ValueType alpha, beta;
1918 template<
typename StencilT>
1921 typedef typename StencilT::ValueType ValueType;
1923 ValueType alpha, beta;
1928 template<
typename StencilT>
1931 typedef typename StencilT::ValueType ValueType;
1933 ValueType alpha, beta;
1940 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1944 template<
typename Accessor>
1946 const Accessor& grid,
const Coord& ijk)
1948 typedef typename Accessor::ValueType ValueType;
1950 ValueType alpha, beta;
1953 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1958 template<
typename Accessor>
1960 const Accessor& grid,
const Coord& ijk)
1962 typedef typename Accessor::ValueType ValueType;
1964 ValueType alpha, beta;
1967 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
1973 template<
typename StencilT>
1976 typedef typename StencilT::ValueType ValueType;
1978 ValueType alpha, beta;
1981 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1986 template<
typename StencilT>
1989 typedef typename StencilT::ValueType ValueType;
1991 ValueType alpha, beta;
1994 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2001 template<DDScheme DiffScheme2, DScheme DiffScheme1>
2005 template<
typename Accessor>
static typename Accessor::ValueType
2008 typedef typename Accessor::ValueType ValueType;
2010 ValueType alpha, beta;
2013 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2018 template<
typename Accessor>
static typename Accessor::ValueType
2021 typedef typename Accessor::ValueType ValueType;
2023 ValueType alpha, beta;
2026 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2032 template<
typename StencilT>
static typename StencilT::ValueType
2035 typedef typename StencilT::ValueType ValueType;
2037 ValueType alpha, beta;
2040 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2045 template<
typename StencilT>
static typename StencilT::ValueType
2048 typedef typename StencilT::ValueType ValueType;
2050 ValueType alpha, beta;
2053 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2067 template<
typename Gr
idType>
2082 {
return mMap->applyIJC(m,v,pos); }
2098 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
boost::shared_ptr< const MapBase > ConstPtr
Definition: Maps.h:162
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition: Operators.h:78
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:788
ThirteenPointStencil< GridType > StencilType
Definition: Operators.h:180
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1639
math::Vec3< ValueType > Vec3Type
Definition: Operators.h:111
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:817
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1343
Vec3d voxelSize() const
Definition: Operators.h:2087
Definition: FiniteDifference.h:1786
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition: Operators.h:238
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1617
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:740
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:815
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:848
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:210
ResultType result(const StencilType &stencil)
Definition: Operators.h:70
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition: Operators.h:1256
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1140
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:517
Definition: FiniteDifference.h:70
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:200
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition: Operators.h:1881
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:474
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:973
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:451
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1206
Vec3d applyIJT(const Vec3d &in) const
Definition: Operators.h:2078
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:984
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:504
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1907
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:478
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:374
Vec3d applyMap(const Vec3d &in) const
Definition: Operators.h:2075
Definition: Stencils.h:519
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition: Operators.h:219
A specialized linear transform that performs a translation.
Definition: Maps.h:998
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:273
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:94
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:861
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
stencil access version
Definition: Operators.h:1816
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:413
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
stencil access version
Definition: Operators.h:579
Definition: FiniteDifference.h:69
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1160
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1481
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1568
Type Pow2(Type x)
Return .
Definition: Math.h:458
SevenPointStencil< GridType > StencilType
Definition: Operators.h:169
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition: Operators.h:2079
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Definition: Operators.h:61
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1692
Definition: FiniteDifference.h:196
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1279
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1173
GenericMap(MapBase::Ptr map)
Definition: Operators.h:2071
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1173
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:654
Definition: Operators.h:157
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:935
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition: Operators.h:92
Compute the closest-point transform to a level set.
Definition: Operators.h:1635
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition: Operators.h:487
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:398
Definition: Operators.h:109
Definition: Operators.h:51
Compute the closest-point transform to a level set.
Definition: Operators.h:1688
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1603
#define OPENVDB_VERSION_NAME
Definition: version.h:45
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:47
Definition: FiniteDifference.h:1508
GenericMap(MapBase::ConstPtr map)
Definition: Operators.h:2072
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:384
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:813
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1345
Gradient operators defined in index space of various orders.
Definition: Operators.h:122
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:810
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:260
Biased gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:806
static double result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:80
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
Definition: Maps.h:1619
Definition: FiniteDifference.h:67
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:126
Definition: FiniteDifference.h:198
double determinant() const
Definition: Operators.h:2084
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1583
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1238
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1792
Definition: FiniteDifference.h:68
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:637
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1260
Definition: Operators.h:839
Curl operator defined in index space using various first derivative schemes.
Definition: Operators.h:500
Definition: Operators.h:152
Definition: FiniteDifference.h:72
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Definition: Operators.h:2064
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
random access version
Definition: Operators.h:541
Type Pow3(Type x)
Return .
Definition: Math.h:462
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
Definition: Operators.h:1401
NineteenPointStencil< GridType > StencilType
Definition: Operators.h:190
Definition: FiniteDifference.h:66
Definition: FiniteDifference.h:195
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition: Operators.h:226
Definition: Stencils.h:785
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1441
const MapType map
Definition: Operators.h:72
GenericMap(const Transform &t)
Definition: Operators.h:2070
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:102
Compute the mean curvature.
Definition: Operators.h:1730
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1127
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:352
Definition: Operators.h:48
Definition: FiniteDifference.h:180
Definition: FiniteDifference.h:71
Abstract base class for maps.
Definition: Maps.h:158
Map traits.
Definition: Maps.h:79
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:754
Definition: FiniteDifference.h:74
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition: Operators.h:2081
~GenericMap()
Definition: Operators.h:2073
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:931
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1405
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition: Operators.h:822
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1341
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition: Operators.h:1510
Definition: Operators.h:251
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:774
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1919
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1802
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1225
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1489
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:662
Mat3d applyIJC(const Mat3d &m) const
Definition: Operators.h:2080
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:951
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1193
Center difference gradient operators, defined with respect to the range-space of the map...
Definition: Operators.h:621
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:684
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition: Operators.h:137
Definition: FiniteDifference.h:441
static double result(const StencilType &stencil)
Definition: Operators.h:85
Vec3d applyInverseMap(const Vec3d &in) const
Definition: Operators.h:2076
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1502
static double result(const MapT &map, const StencilType &stencil)
Definition: Operators.h:99
Definition: FiniteDifference.h:179
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
GenericMap(const GridType &g)
Definition: Operators.h:2068
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:432
Tolerance for floating-point comparison.
Definition: Math.h:116
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1896
MapAdapter(const MapType &m)
Definition: Operators.h:62
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1709
Definition: FiniteDifference.h:62
Definition: FiniteDifference.h:181
boost::shared_ptr< MapBase > Ptr
Definition: Maps.h:161
Vec3d asVec3d() const
Definition: Coord.h:136
Laplacian defined in index space, using various center-difference stencils.
Definition: Operators.h:357
double determinant(const Vec3d &in) const
Definition: Operators.h:2085
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition: Operators.h:1872
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:66
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1929
Vec3d voxelSize(const Vec3d &v) const
Definition: Operators.h:2088
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1661
Definition: FiniteDifference.h:65
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:626
Definition: FiniteDifference.h:197
SevenPointStencil< GridType > StencilType
Definition: Operators.h:158
Definition: Stencils.h:234
Definition: FiniteDifference.h:73
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
random access version
Definition: Operators.h:1737
Definition: FiniteDifference.h:194
Compute the mean curvature in index space.
Definition: Operators.h:534
ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, float scale2=0.01)
Implementation of nominally fifth-order finite-difference WENO.
Definition: FiniteDifference.h:331
T::ValueType ValueType
Definition: Operators.h:110