6 #ifndef OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 7 #define OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED 22 template<
typename Vec3T>
struct is_vec3d {
static const bool value =
false; };
25 template<
typename T>
struct is_double {
static const bool value =
false; };
26 template<>
struct is_double<double> {
static const bool value =
true; };
34 template<
typename MapType,
typename OpType,
typename ResultType>
38 template<
typename AccessorType>
40 result(
const AccessorType& grid,
const Coord& ijk) {
return OpType::result(map, grid, ijk); }
42 template<
typename StencilType>
44 result(
const StencilType& stencil) {
return OpType::result(map, stencil); }
51 template<
typename OpType>
53 template<
typename AccessorType>
54 static inline double result(
const AccessorType& grid,
const Coord& ijk) {
55 return double(OpType::result(grid, ijk).length());
58 template<
typename StencilType>
59 static inline double result(
const StencilType& stencil) {
60 return double(OpType::result(stencil).length());
65 template<
typename OpType,
typename MapT>
67 template<
typename AccessorType>
68 static inline double result(
const MapT& map,
const AccessorType& grid,
const Coord& ijk) {
69 return double(OpType::result(map, grid, ijk).length());
72 template<
typename StencilType>
73 static inline double result(
const MapT& map,
const StencilType& stencil) {
74 return double(OpType::result(map, stencil).length());
94 template<DScheme DiffScheme>
102 using ValueType =
typename Accessor::ValueType;
113 using ValueType =
typename StencilT::ValueType;
125 template<BiasedGradientScheme bgs>
130 template<
typename Gr
idType,
bool IsSafe = true>
141 template<
typename Gr
idType,
bool IsSafe = true>
152 template<
typename Gr
idType,
bool IsSafe = true>
162 template<
typename Gr
idType,
bool IsSafe = true>
172 template<
typename Gr
idType,
bool IsSafe = true>
182 template<
typename Gr
idType,
bool IsSafe = true>
192 template<BiasedGradientScheme GradScheme,
typename Vec3Bias>
199 template<
typename Accessor>
203 using ValueType =
typename Accessor::ValueType;
212 template<
typename StencilT>
214 result(
const StencilT& stencil,
const Vec3Bias& V)
216 using ValueType =
typename StencilT::ValueType;
226 template<BiasedGradientScheme GradScheme>
234 template<
typename Accessor>
235 static typename Accessor::ValueType
238 using ValueType =
typename Accessor::ValueType;
247 template<
typename StencilT>
248 static typename StencilT::ValueType
251 using ValueType =
typename StencilT::ValueType;
260 #ifdef DWA_OPENVDB // for SIMD - note will do the computations in float 265 template<
typename Accessor>
266 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk)
271 GetValue(
const Accessor& acc_): acc(acc_) {}
273 inline simd::Float4::value_type operator()(
const Coord& ijk_) {
274 return static_cast<simd::Float4::value_type
>(acc.getValue(ijk_));
287 v3(valueAt(ijk ) - valueAt(ijk.
offsetBy(-1, 0, 0)),
288 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0,-1, 0)),
289 valueAt(ijk ) - valueAt(ijk.
offsetBy( 0, 0,-1)), 0),
290 v4(valueAt(ijk.
offsetBy( 1, 0, 0)) - valueAt(ijk ),
291 valueAt(ijk.
offsetBy( 0, 1, 0)) - valueAt(ijk ),
292 valueAt(ijk.
offsetBy( 0, 0, 1)) - valueAt(ijk ), 0),
306 template<
typename StencilT>
307 static typename StencilT::ValueType result(
const StencilT& s)
309 using F4Val = simd::Float4::value_type;
313 v1(F4Val(s.template getValue<-2, 0, 0>()) - F4Val(s.template getValue<-3, 0, 0>()),
314 F4Val(s.template getValue< 0,-2, 0>()) - F4Val(s.template getValue< 0,-3, 0>()),
315 F4Val(s.template getValue< 0, 0,-2>()) - F4Val(s.template getValue< 0, 0,-3>()), 0),
316 v2(F4Val(s.template getValue<-1, 0, 0>()) - F4Val(s.template getValue<-2, 0, 0>()),
317 F4Val(s.template getValue< 0,-1, 0>()) - F4Val(s.template getValue< 0,-2, 0>()),
318 F4Val(s.template getValue< 0, 0,-1>()) - F4Val(s.template getValue< 0, 0,-2>()), 0),
319 v3(F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue<-1, 0, 0>()),
320 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0,-1, 0>()),
321 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0, 0,-1>()), 0),
322 v4(F4Val(s.template getValue< 1, 0, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
323 F4Val(s.template getValue< 0, 1, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
324 F4Val(s.template getValue< 0, 0, 1>()) - F4Val(s.template getValue< 0, 0, 0>()), 0),
325 v5(F4Val(s.template getValue< 2, 0, 0>()) - F4Val(s.template getValue< 1, 0, 0>()),
326 F4Val(s.template getValue< 0, 2, 0>()) - F4Val(s.template getValue< 0, 1, 0>()),
327 F4Val(s.template getValue< 0, 0, 2>()) - F4Val(s.template getValue< 0, 0, 1>()), 0),
328 v6(F4Val(s.template getValue< 3, 0, 0>()) - F4Val(s.template getValue< 2, 0, 0>()),
329 F4Val(s.template getValue< 0, 3, 0>()) - F4Val(s.template getValue< 0, 2, 0>()),
330 F4Val(s.template getValue< 0, 0, 3>()) - F4Val(s.template getValue< 0, 0, 2>()), 0),
337 #endif //DWA_OPENVDB // for SIMD - note will do the computations in float 342 template<DDScheme DiffScheme>
347 template<
typename Accessor>
348 static typename Accessor::ValueType result(
const Accessor& grid,
const Coord& ijk);
351 template<
typename StencilT>
352 static typename StencilT::ValueType result(
const StencilT& stencil);
360 template<
typename Accessor>
361 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
363 return grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
364 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy(0, -1, 0)) +
366 - 6*grid.getValue(ijk);
370 template<
typename StencilT>
371 static typename StencilT::ValueType
result(
const StencilT& stencil)
373 return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
374 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
375 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
376 - 6*stencil.template getValue< 0, 0, 0>();
384 template<
typename Accessor>
385 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
387 using ValueT =
typename Accessor::ValueType;
388 return static_cast<ValueT
>(
390 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
391 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
392 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
394 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
395 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
396 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
397 - 7.5*grid.getValue(ijk));
401 template<
typename StencilT>
402 static typename StencilT::ValueType
result(
const StencilT& stencil)
404 using ValueT =
typename StencilT::ValueType;
405 return static_cast<ValueT
>(
407 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
408 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
409 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
411 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
412 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
413 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
414 - 7.5*stencil.template getValue< 0, 0, 0>());
422 template<
typename Accessor>
423 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
425 using ValueT =
typename Accessor::ValueType;
426 return static_cast<ValueT
>(
428 grid.getValue(ijk.
offsetBy(3,0,0)) + grid.getValue(ijk.
offsetBy(-3, 0, 0)) +
429 grid.getValue(ijk.
offsetBy(0,3,0)) + grid.getValue(ijk.
offsetBy( 0,-3, 0)) +
430 grid.getValue(ijk.
offsetBy(0,0,3)) + grid.getValue(ijk.
offsetBy( 0, 0,-3)) )
432 grid.getValue(ijk.
offsetBy(2,0,0)) + grid.getValue(ijk.
offsetBy(-2, 0, 0)) +
433 grid.getValue(ijk.
offsetBy(0,2,0)) + grid.getValue(ijk.
offsetBy( 0,-2, 0)) +
434 grid.getValue(ijk.
offsetBy(0,0,2)) + grid.getValue(ijk.
offsetBy( 0, 0,-2)) )
436 grid.getValue(ijk.
offsetBy(1,0,0)) + grid.getValue(ijk.
offsetBy(-1, 0, 0)) +
437 grid.getValue(ijk.
offsetBy(0,1,0)) + grid.getValue(ijk.
offsetBy( 0,-1, 0)) +
438 grid.getValue(ijk.
offsetBy(0,0,1)) + grid.getValue(ijk.
offsetBy( 0, 0,-1)) )
439 - (3*49/18.)*grid.getValue(ijk));
443 template<
typename StencilT>
444 static typename StencilT::ValueType
result(
const StencilT& stencil)
446 using ValueT =
typename StencilT::ValueType;
447 return static_cast<ValueT
>(
449 stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
450 stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
451 stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
453 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
454 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
455 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
457 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
458 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
459 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
460 - (3*49/18.)*stencil.template getValue< 0, 0, 0>());
467 template<DScheme DiffScheme>
472 template<
typename Accessor>
static typename Accessor::ValueType::value_type
481 template<
typename StencilT>
static typename StencilT::ValueType::value_type
493 template<DScheme DiffScheme>
498 template<
typename Accessor>
499 static typename Accessor::ValueType
result(
const Accessor& grid,
const Coord& ijk)
501 using Vec3Type =
typename Accessor::ValueType;
511 template<
typename StencilT>
512 static typename StencilT::ValueType
result(
const StencilT& stencil)
514 using Vec3Type =
typename StencilT::ValueType;
527 template<DDScheme DiffScheme2, DScheme DiffScheme1>
535 template<
typename Accessor>
537 typename Accessor::ValueType& alpha,
538 typename Accessor::ValueType& beta)
540 using ValueType =
typename Accessor::ValueType;
546 const ValueType Dx2 = Dx*Dx;
547 const ValueType Dy2 = Dy*Dy;
548 const ValueType Dz2 = Dz*Dz;
549 const ValueType normGrad = Dx2 + Dy2 + Dz2;
564 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
565 beta = ValueType(std::sqrt(
double(normGrad)));
573 template<
typename StencilT>
574 static bool result(
const StencilT& stencil,
575 typename StencilT::ValueType& alpha,
576 typename StencilT::ValueType& beta)
578 using ValueType =
typename StencilT::ValueType;
583 const ValueType Dx2 = Dx*Dx;
584 const ValueType Dy2 = Dy*Dy;
585 const ValueType Dz2 = Dz*Dz;
586 const ValueType normGrad = Dx2 + Dy2 + Dz2;
601 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
602 beta = ValueType(std::sqrt(
double(normGrad)));
612 template<
typename MapType, DScheme DiffScheme>
619 template<
typename Accessor>
621 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
626 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
630 template<
typename StencilT>
632 result(
const MapType& map,
const StencilT& stencil)
637 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
643 template<DScheme DiffScheme>
647 template<
typename Accessor>
655 template<
typename StencilT>
669 template<
typename Accessor>
678 return iGradient * inv2dx;
682 template<
typename StencilT>
691 return iGradient * inv2dx;
701 template<
typename Accessor>
710 return iGradient * inv2dx;
714 template<
typename StencilT>
723 return iGradient * inv2dx;
733 template<
typename Accessor>
746 return Vec3Type(ValueType(gradient0),
747 ValueType(gradient1),
748 ValueType(gradient2));
752 template<
typename StencilT>
765 return Vec3Type(ValueType(gradient0),
766 ValueType(gradient1),
767 ValueType(gradient2));
777 template<
typename Accessor>
790 return Vec3Type(ValueType(gradient0),
791 ValueType(gradient1),
792 ValueType(gradient2));
796 template<
typename StencilT>
809 return Vec3Type(ValueType(gradient0),
810 ValueType(gradient1),
811 ValueType(gradient2));
818 template<
typename MapType, BiasedGradientScheme GradScheme>
825 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
828 using ValueType =
typename Accessor::ValueType;
832 return Vec3Type(map.applyIJT(iGradient, ijk.
asVec3d()));
837 result(
const MapType& map,
const StencilT& stencil,
840 using ValueType =
typename StencilT::ValueType;
844 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
853 template<
typename MapType, BiasedGradientScheme GradScheme>
861 template<
typename Accessor>
862 static typename Accessor::ValueType
863 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
865 using ValueType =
typename Accessor::ValueType;
874 template<
typename StencilT>
875 static typename StencilT::ValueType
876 result(
const MapType& map,
const StencilT& stencil)
878 using ValueType =
typename StencilT::ValueType;
888 template<BiasedGradientScheme GradScheme>
892 template<
typename Accessor>
893 static typename Accessor::ValueType
896 using ValueType =
typename Accessor::ValueType;
903 template<
typename StencilT>
904 static typename StencilT::ValueType
907 using ValueType =
typename StencilT::ValueType;
915 template<BiasedGradientScheme GradScheme>
919 template<
typename Accessor>
920 static typename Accessor::ValueType
923 using ValueType =
typename Accessor::ValueType;
930 template<
typename StencilT>
931 static typename StencilT::ValueType
934 using ValueType =
typename StencilT::ValueType;
943 template<
typename MapType, DScheme DiffScheme>
949 template<
typename Accessor>
static typename Accessor::ValueType::value_type
950 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
952 using ValueType =
typename Accessor::ValueType::value_type;
955 for (
int i=0; i < 3; i++) {
959 div += ValueType(map.applyIJT(vec, ijk.
asVec3d())[i]);
965 template<
typename StencilT>
static typename StencilT::ValueType::value_type
966 result(
const MapType& map,
const StencilT& stencil)
968 using ValueType =
typename StencilT::ValueType::value_type;
971 for (
int i=0; i < 3; i++) {
975 div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
983 template<DScheme DiffScheme>
987 template<
typename Accessor>
static typename Accessor::ValueType::value_type
990 using ValueType =
typename Accessor::ValueType::value_type;
998 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1001 using ValueType =
typename StencilT::ValueType::value_type;
1011 template<DScheme DiffScheme>
1015 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1018 using ValueType =
typename Accessor::ValueType::value_type;
1023 ValueType invdx = ValueType(map.
getInvScale()[0]);
1028 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1031 using ValueType =
typename StencilT::ValueType::value_type;
1036 ValueType invdx = ValueType(map.
getInvScale()[0]);
1043 template<DScheme DiffScheme>
1047 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1050 using ValueType =
typename Accessor::ValueType::value_type;
1055 ValueType invdx = ValueType(map.
getInvScale()[0]);
1060 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1063 using ValueType =
typename StencilT::ValueType::value_type;
1068 ValueType invdx = ValueType(map.
getInvScale()[0]);
1079 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1082 using ValueType =
typename Accessor::ValueType::value_type;
1087 return div * inv2dx;
1091 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1094 using ValueType =
typename StencilT::ValueType::value_type;
1099 return div * inv2dx;
1109 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1112 using ValueType =
typename Accessor::ValueType::value_type;
1118 return div * inv2dx;
1122 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1125 using ValueType =
typename StencilT::ValueType::value_type;
1131 return div * inv2dx;
1137 template<DScheme DiffScheme>
1141 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1144 using ValueType =
typename Accessor::ValueType::value_type;
1146 ValueType div = ValueType(
1154 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1157 using ValueType =
typename StencilT::ValueType::value_type;
1170 template<DScheme DiffScheme>
1174 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1177 using ValueType =
typename Accessor::ValueType::value_type;
1179 ValueType div = ValueType(
1187 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1190 using ValueType =
typename StencilT::ValueType::value_type;
1207 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1210 using ValueType =
typename Accessor::ValueType::value_type;
1212 ValueType div = ValueType(
1220 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1223 using ValueType =
typename StencilT::ValueType::value_type;
1225 ValueType div = ValueType(
1239 template<
typename Accessor>
static typename Accessor::ValueType::value_type
1242 using ValueType =
typename Accessor::ValueType::value_type;
1244 ValueType div = ValueType(
1252 template<
typename StencilT>
static typename StencilT::ValueType::value_type
1255 using ValueType =
typename StencilT::ValueType::value_type;
1257 ValueType div = ValueType(
1268 template<
typename MapType, DScheme DiffScheme>
1274 template<
typename Accessor>
static typename Accessor::ValueType
1277 using Vec3Type =
typename Accessor::ValueType;
1279 for (
int i = 0; i < 3; i++) {
1285 mat[i] = Vec3Type(map.applyIJT(vec, ijk.
asVec3d()));
1287 return Vec3Type(mat[2][1] - mat[1][2],
1288 mat[0][2] - mat[2][0],
1289 mat[1][0] - mat[0][1]);
1293 template<
typename StencilT>
static typename StencilT::ValueType
1294 result(
const MapType& map,
const StencilT& stencil)
1296 using Vec3Type =
typename StencilT::ValueType;
1298 for (
int i = 0; i < 3; i++) {
1304 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1306 return Vec3Type(mat[2][1] - mat[1][2],
1307 mat[0][2] - mat[2][0],
1308 mat[1][0] - mat[0][1]);
1313 template<DScheme DiffScheme>
1317 template<
typename Accessor>
static typename Accessor::ValueType
1320 using Vec3Type =
typename Accessor::ValueType;
1321 using ValueType =
typename Vec3Type::value_type;
1326 template<
typename StencilT>
static typename StencilT::ValueType
1329 using Vec3Type =
typename StencilT::ValueType;
1330 using ValueType =
typename Vec3Type::value_type;
1336 template<DScheme DiffScheme>
1340 template<
typename Accessor>
static typename Accessor::ValueType
1343 using Vec3Type =
typename Accessor::ValueType;
1344 using ValueType =
typename Vec3Type::value_type;
1350 template<
typename StencilT>
static typename StencilT::ValueType
1353 using Vec3Type =
typename StencilT::ValueType;
1354 using ValueType =
typename Vec3Type::value_type;
1365 template<
typename Accessor>
static typename Accessor::ValueType
1368 using Vec3Type =
typename Accessor::ValueType;
1369 using ValueType =
typename Vec3Type::value_type;
1375 template<
typename StencilT>
static typename StencilT::ValueType
1378 using Vec3Type =
typename StencilT::ValueType;
1379 using ValueType =
typename Vec3Type::value_type;
1390 template<
typename Accessor>
static typename Accessor::ValueType
1393 using Vec3Type =
typename Accessor::ValueType;
1394 using ValueType =
typename Vec3Type::value_type;
1400 template<
typename StencilT>
static typename StencilT::ValueType
1403 using Vec3Type =
typename StencilT::ValueType;
1404 using ValueType =
typename Vec3Type::value_type;
1413 template<
typename MapType, DDScheme DiffScheme>
1419 template<
typename Accessor>
1420 static typename Accessor::ValueType
result(
const MapType& map,
1421 const Accessor& grid,
const Coord& ijk)
1423 using ValueType =
typename Accessor::ValueType;
1434 Mat3d d2_is(iddx, iddxy, iddxz,
1436 iddxz, iddyz, iddz);
1440 d2_rs = map.applyIJC(d2_is);
1447 d2_rs = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1451 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1455 template<
typename StencilT>
1456 static typename StencilT::ValueType
result(
const MapType& map,
const StencilT& stencil)
1458 using ValueType =
typename StencilT::ValueType;
1469 Mat3d d2_is(iddx, iddxy, iddxz,
1471 iddxz, iddyz, iddz);
1475 d2_rs = map.applyIJC(d2_is);
1482 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1486 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1491 template<DDScheme DiffScheme>
1495 template<
typename Accessor>
1497 const Accessor& grid,
const Coord& ijk)
1503 template<
typename StencilT>
1512 template<DDScheme DiffScheme>
1516 template<
typename Accessor>
1518 const Accessor& grid,
const Coord& ijk)
1524 template<
typename StencilT>
1532 template<DDScheme DiffScheme>
1536 template<
typename Accessor>
static typename Accessor::ValueType
1539 using ValueType =
typename Accessor::ValueType;
1545 template<
typename StencilT>
static typename StencilT::ValueType
1548 using ValueType =
typename StencilT::ValueType;
1555 template<DDScheme DiffScheme>
1559 template<
typename Accessor>
static typename Accessor::ValueType
1562 using ValueType =
typename Accessor::ValueType;
1568 template<
typename StencilT>
static typename StencilT::ValueType
1571 using ValueType =
typename StencilT::ValueType;
1578 template<DDScheme DiffScheme>
1582 template<
typename Accessor>
static typename Accessor::ValueType
1585 using ValueType =
typename Accessor::ValueType;
1594 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1600 template<
typename StencilT>
static typename StencilT::ValueType
1603 using ValueType =
typename StencilT::ValueType;
1612 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1619 template<DDScheme DiffScheme>
1623 template<
typename Accessor>
static typename Accessor::ValueType
1626 using ValueType =
typename Accessor::ValueType;
1634 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1640 template<
typename StencilT>
static typename StencilT::ValueType
1643 using ValueType =
typename StencilT::ValueType;
1651 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1661 template<
typename MapType, DScheme DiffScheme>
1668 using ValueType =
typename Accessor::ValueType;
1672 ValueType d = grid.getValue(ijk);
1677 Vec3d result = ijk.
asVec3d() - map.applyInverseMap(vectorFromSurface);
1678 return Vec3Type(result);
1681 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1682 return Vec3Type(result);
1688 result(
const MapType& map,
const StencilT& stencil)
1690 using ValueType =
typename StencilT::ValueType;
1694 ValueType d = stencil.template getValue<0, 0, 0>();
1699 Vec3d result = stencil.getCenterCoord().asVec3d()
1700 - map.applyInverseMap(vectorFromSurface);
1701 return Vec3Type(result);
1703 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1704 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1705 return Vec3Type(result);
1714 template<
typename MapType, DScheme DiffScheme>
1721 using ValueType =
typename Accessor::ValueType;
1724 ValueType d = grid.getValue(ijk);
1727 Vec3Type vectorFromSurface =
1729 Vec3d result = map.applyMap(ijk.
asVec3d()) - vectorFromSurface;
1731 return Vec3Type(result);
1736 result(
const MapType& map,
const StencilT& stencil)
1738 using ValueType =
typename StencilT::ValueType;
1741 ValueType d = stencil.template getValue<0, 0, 0>();
1744 Vec3Type vectorFromSurface =
1746 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1748 return Vec3Type(result);
1757 template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1764 template<
typename Accessor>
1765 static bool compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1766 double& alpha,
double& beta)
1768 using ValueType =
typename Accessor::ValueType;
1775 d1_ws = map.applyIJT(d1_is);
1777 d1_ws = map.applyIJT(d1_is, ijk.
asVec3d());
1779 const double Dx2 = d1_ws(0)*d1_ws(0);
1780 const double Dy2 = d1_ws(1)*d1_ws(1);
1781 const double Dz2 = d1_ws(2)*d1_ws(2);
1782 const double normGrad = Dx2 + Dy2 + Dz2;
1798 Mat3d d2_is(iddx, iddxy, iddxz,
1800 iddxz, iddyz, iddz);
1805 d2_ws = map.applyIJC(d2_is);
1807 d2_ws = map.applyIJC(d2_is, d1_is, ijk.
asVec3d());
1811 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1812 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1813 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1814 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1815 beta = std::sqrt(normGrad);
1819 template<
typename Accessor>
1820 static typename Accessor::ValueType
result(
const MapType& map,
1821 const Accessor& grid,
const Coord& ijk)
1823 using ValueType =
typename Accessor::ValueType;
1825 return compute(map, grid, ijk, alpha, beta) ?
1829 template<
typename Accessor>
1830 static typename Accessor::ValueType
normGrad(
const MapType& map,
1831 const Accessor& grid,
const Coord& ijk)
1833 using ValueType =
typename Accessor::ValueType;
1835 return compute(map, grid, ijk, alpha, beta) ?
1843 template<
typename StencilT>
1844 static bool compute(
const MapType& map,
const StencilT& stencil,
1845 double& alpha,
double& beta)
1847 using ValueType =
typename StencilT::ValueType;
1854 d1_ws = map.applyIJT(d1_is);
1856 d1_ws = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1858 const double Dx2 = d1_ws(0)*d1_ws(0);
1859 const double Dy2 = d1_ws(1)*d1_ws(1);
1860 const double Dz2 = d1_ws(2)*d1_ws(2);
1861 const double normGrad = Dx2 + Dy2 + Dz2;
1877 Mat3d d2_is(iddx, iddxy, iddxz,
1879 iddxz, iddyz, iddz);
1884 d2_ws = map.applyIJC(d2_is);
1886 d2_ws = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1890 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1891 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1892 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1893 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1894 beta = std::sqrt(normGrad);
1898 template<
typename StencilT>
1899 static typename StencilT::ValueType
1900 result(
const MapType& map,
const StencilT stencil)
1902 using ValueType =
typename StencilT::ValueType;
1904 return compute(map, stencil, alpha, beta) ?
1908 template<
typename StencilT>
1909 static typename StencilT::ValueType
normGrad(
const MapType& map,
const StencilT stencil)
1911 using ValueType =
typename StencilT::ValueType;
1913 return compute(map, stencil, alpha, beta) ?
1919 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1923 template<
typename Accessor>
1925 const Accessor& grid,
const Coord& ijk)
1927 using ValueType =
typename Accessor::ValueType;
1929 ValueType alpha, beta;
1934 template<
typename Accessor>
1936 const Accessor& grid,
const Coord& ijk)
1938 using ValueType =
typename Accessor::ValueType;
1940 ValueType alpha, beta;
1946 template<
typename StencilT>
1949 using ValueType =
typename StencilT::ValueType;
1951 ValueType alpha, beta;
1956 template<
typename StencilT>
1959 using ValueType =
typename StencilT::ValueType;
1961 ValueType alpha, beta;
1968 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1972 template<
typename Accessor>
1974 const Accessor& grid,
const Coord& ijk)
1976 using ValueType =
typename Accessor::ValueType;
1978 ValueType alpha, beta;
1981 return ValueType(alpha*inv2dx/
math::Pow3(beta));
1986 template<
typename Accessor>
1988 const Accessor& grid,
const Coord& ijk)
1990 using ValueType =
typename Accessor::ValueType;
1992 ValueType alpha, beta;
1995 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2001 template<
typename StencilT>
2004 using ValueType =
typename StencilT::ValueType;
2006 ValueType alpha, beta;
2009 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2014 template<
typename StencilT>
2017 using ValueType =
typename StencilT::ValueType;
2019 ValueType alpha, beta;
2022 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2029 template<DDScheme DiffScheme2, DScheme DiffScheme1>
2033 template<
typename Accessor>
static typename Accessor::ValueType
2036 using ValueType =
typename Accessor::ValueType;
2038 ValueType alpha, beta;
2041 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2046 template<
typename Accessor>
static typename Accessor::ValueType
2049 using ValueType =
typename Accessor::ValueType;
2051 ValueType alpha, beta;
2054 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2060 template<
typename StencilT>
static typename StencilT::ValueType
2063 using ValueType =
typename StencilT::ValueType;
2065 ValueType alpha, beta;
2068 return ValueType(alpha*inv2dx/
math::Pow3(beta));
2073 template<
typename StencilT>
static typename StencilT::ValueType
2076 using ValueType =
typename StencilT::ValueType;
2078 ValueType alpha, beta;
2081 return ValueType(alpha*invdxdx/(2*
math::Pow2(beta)));
2095 template<
typename Gr
idType>
2110 {
return mMap->applyIJC(m,v,pos); }
2126 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1830
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition: Operators.h:2109
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:966
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1624
Definition: FiniteDifference.h:47
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition: Operators.h:214
GenericMap(const Transform &t)
Definition: Operators.h:2098
Compute the closest-point transform to a level set.
Definition: Operators.h:1662
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition: Operators.h:201
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1253
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:657
ResultType result(const StencilType &stencil)
Definition: Operators.h:44
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:68
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Random access version.
Definition: Operators.h:1765
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:754
~GenericMap()
Definition: Operators.h:2101
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1688
static double result(const StencilType &stencil)
Definition: Operators.h:59
Definition: Operators.h:83
Definition: FiniteDifference.h:42
Map traits.
Definition: Maps.h:55
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1155
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1601
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:473
Gradient operators defined in index space of various orders.
Definition: Operators.h:96
Vec3d applyInverseMap(const Vec3d &in) const
Definition: Operators.h:2104
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:512
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition: Operators.h:66
Definition: FiniteDifference.h:35
Definition: FiniteDifference.h:38
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:371
Laplacian defined in index space, using various center-difference stencils.
Definition: Operators.h:344
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1275
Vec3d voxelSize(const Vec3d &v) const
Definition: Operators.h:2116
Abstract base class for maps.
Definition: Maps.h:134
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Definition: Operators.h:35
Definition: FiniteDifference.h:1484
typename T::ValueType ValueType
Definition: Operators.h:84
SharedPtr< MapBase > Ptr
Definition: Maps.h:137
Definition: FiniteDifference.h:40
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1583
Type Pow2(Type x)
Return x2.
Definition: Math.h:495
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:649
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1641
Definition: FiniteDifference.h:39
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:469
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:423
Definition: Stencils.h:544
Compute the closest-point transform to a level set.
Definition: Operators.h:1715
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Stencil access version.
Definition: Operators.h:1844
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
Vec3d asVec3d() const
Definition: Coord.h:144
Compute the mean curvature.
Definition: Operators.h:1758
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1332
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition: Operators.h:482
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
Definition: Operators.h:1416
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:795
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1924
Definition: FiniteDifference.h:154
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1208
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:444
Mat3d applyIJC(const Mat3d &m) const
Definition: Operators.h:2108
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:988
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:361
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition: Coord.h:92
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:32
Definition: FiniteDifference.h:168
Biased gradient operators, defined with respect to the range-space of the map.
Definition: Operators.h:821
Compute the mean curvature in index space.
Definition: Operators.h:529
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:797
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:656
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition: Operators.h:111
SharedPtr< T > ConstPtrCast(const SharedPtr< U > &ptr)
Return a new shared pointer that points to the same object as the given pointer but with possibly dif...
Definition: Types.h:103
Definition: FiniteDifference.h:169
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:102
Curl operator defined in index space using various first derivative schemes.
Definition: Operators.h:495
Vec3d voxelSize() const
Definition: Operators.h:2115
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:100
Definition: Operators.h:854
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
Definition: Maps.h:1605
GenericMap(MapBase::ConstPtr map)
Definition: Operators.h:2100
double determinant(const Vec3d &in) const
Definition: Operators.h:2113
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition: Operators.h:837
static double result(const MapT &map, const StencilType &stencil)
Definition: Operators.h:73
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1142
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:402
Definition: FiniteDifference.h:153
Definition: FiniteDifference.h:1762
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1155
Definition: Operators.h:131
Definition: Stencils.h:240
MapAdapter(const MapType &m)
Definition: Operators.h:36
Definition: Operators.h:126
Definition: FiniteDifference.h:43
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:621
Type Pow3(Type x)
Return x3.
Definition: Math.h:499
Definition: FiniteDifference.h:41
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:779
SharedPtr< const MapBase > ConstPtr
Definition: Maps.h:138
Definition: Stencils.h:814
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1504
Definition: Exceptions.h:13
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:863
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1736
Vec3d applyMap(const Vec3d &in) const
Definition: Operators.h:2103
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1947
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition: Operators.h:1271
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition: Operators.h:1909
GenericMap(const GridType &g)
Definition: Operators.h:2096
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition: Operators.h:1525
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition: Operators.h:1221
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition: Operators.h:193
Definition: FiniteDifference.h:152
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1719
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1328
Definition: FiniteDifference.h:170
static StencilT::ValueType result(const StencilT &stencil)
Definition: Operators.h:249
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1496
Definition: FiniteDifference.h:171
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:876
Center difference gradient operators, defined with respect to the range-space of the map...
Definition: Operators.h:616
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:385
A specialized linear transform that performs a translation.
Definition: Maps.h:972
Definition: Operators.h:22
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1517
Tolerance for floating-point comparison.
Definition: Math.h:90
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1666
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1420
Definition: FiniteDifference.h:416
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1175
Real GodunovsNormSqrd(bool isOutside, Real dP_xm, Real dP_xp, Real dP_ym, Real dP_yp, Real dP_zm, Real dP_zp)
Definition: FiniteDifference.h:326
Vec3d applyIJT(const Vec3d &in) const
Definition: Operators.h:2106
static double result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:54
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition: Operators.h:2107
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:825
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1820
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:1188
Definition: Operators.h:227
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Stencil access version.
Definition: Operators.h:574
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:236
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1240
Defines various finite difference stencils by means of the "curiously recurring template pattern" on ...
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1330
Definition: FiniteDifference.h:167
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1294
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition: Operators.h:40
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition: Operators.h:1900
Definition: FiniteDifference.h:46
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:154
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:735
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Definition: Operators.h:2092
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:999
GenericMap(MapBase::Ptr map)
Definition: Operators.h:2099
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:950
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition: Operators.h:798
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition: Operators.h:52
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Random access version.
Definition: Operators.h:536
Definition: FiniteDifference.h:45
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:632
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:499
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:793
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition: Operators.h:1456
double determinant() const
Definition: Operators.h:2112
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:946
const MapType map
Definition: Operators.h:46
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition: Operators.h:1935
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition: Operators.h:1957
Definition: FiniteDifference.h:44
ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, float scale2=0.01f)
Implementation of nominally fifth-order finite-difference WENO.
Definition: FiniteDifference.h:304
Definition: Operators.h:25