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; };
34 template<
typename MapType,
typename OpType,
typename ResultType>
38 template<
typename AccessorType>
42 template<
typename StencilType>
51 template<
typename OpType>
53 template<
typename AccessorType>
54 static inline double result(
const AccessorType& grid,
const Coord& ijk) {
58 template<
typename StencilType>
65 template<
typename OpType,
typename MapT>
67 template<
typename AccessorType>
68 static inline double result(
const MapT& map,
const AccessorType& grid,
const Coord& ijk) {
72 template<
typename StencilType>
73 static inline double result(
const MapT& map,
const StencilType&
stencil) {
98 template<DScheme DiffScheme>
128 template<BiasedGradientScheme bgs>
133 template<
typename Gr
idType,
bool IsSafe = true>
144 template<
typename Gr
idType,
bool IsSafe = true>
155 template<
typename Gr
idType,
bool IsSafe = true>
165 template<
typename Gr
idType,
bool IsSafe = true>
175 template<
typename Gr
idType,
bool IsSafe = true>
185 template<
typename Gr
idType,
bool IsSafe = true>
195 template<BiasedGradientScheme GradScheme,
typename Vec3Bias>
202 template<
typename Accessor>
215 template<
typename StencilT>
229 template<BiasedGradientScheme GradScheme>
237 template<
typename Accessor>
250 template<
typename StencilT>
263 #ifdef DWA_OPENVDB // for SIMD - note will do the computations in float
268 template<
typename Accessor>
274 GetValue(
const Accessor& acc_): acc(acc_) {}
284 v1(valueAt(ijk.offsetBy(-2, 0, 0)) - valueAt(ijk.offsetBy(-3, 0, 0)),
285 valueAt(ijk.offsetBy( 0,-2, 0)) - valueAt(ijk.offsetBy( 0,-3, 0)),
286 valueAt(ijk.offsetBy( 0, 0,-2)) - valueAt(ijk.offsetBy( 0, 0,-3)), 0),
287 v2(valueAt(ijk.offsetBy(-1, 0, 0)) - valueAt(ijk.offsetBy(-2, 0, 0)),
288 valueAt(ijk.offsetBy( 0,-1, 0)) - valueAt(ijk.offsetBy( 0,-2, 0)),
289 valueAt(ijk.offsetBy( 0, 0,-1)) - valueAt(ijk.offsetBy( 0, 0,-2)), 0),
290 v3(valueAt(ijk ) - valueAt(ijk.offsetBy(-1, 0, 0)),
291 valueAt(ijk ) - valueAt(ijk.offsetBy( 0,-1, 0)),
292 valueAt(ijk ) - valueAt(ijk.offsetBy( 0, 0,-1)), 0),
293 v4(valueAt(ijk.offsetBy( 1, 0, 0)) - valueAt(ijk ),
294 valueAt(ijk.offsetBy( 0, 1, 0)) - valueAt(ijk ),
295 valueAt(ijk.offsetBy( 0, 0, 1)) - valueAt(ijk ), 0),
296 v5(valueAt(ijk.offsetBy( 2, 0, 0)) - valueAt(ijk.offsetBy( 1, 0, 0)),
297 valueAt(ijk.offsetBy( 0, 2, 0)) - valueAt(ijk.offsetBy( 0, 1, 0)),
298 valueAt(ijk.offsetBy( 0, 0, 2)) - valueAt(ijk.offsetBy( 0, 0, 1)), 0),
299 v6(valueAt(ijk.offsetBy( 3, 0, 0)) - valueAt(ijk.offsetBy( 2, 0, 0)),
300 valueAt(ijk.offsetBy( 0, 3, 0)) - valueAt(ijk.offsetBy( 0, 2, 0)),
301 valueAt(ijk.offsetBy( 0, 0, 3)) - valueAt(ijk.offsetBy( 0, 0, 2)), 0),
309 template<
typename StencilT>
316 v1(F4Val(s.template getValue<-2, 0, 0>()) - F4Val(s.template getValue<-3, 0, 0>()),
317 F4Val(s.template getValue< 0,-2, 0>()) - F4Val(s.template getValue< 0,-3, 0>()),
318 F4Val(s.template getValue< 0, 0,-2>()) - F4Val(s.template getValue< 0, 0,-3>()), 0),
319 v2(F4Val(s.template getValue<-1, 0, 0>()) - F4Val(s.template getValue<-2, 0, 0>()),
320 F4Val(s.template getValue< 0,-1, 0>()) - F4Val(s.template getValue< 0,-2, 0>()),
321 F4Val(s.template getValue< 0, 0,-1>()) - F4Val(s.template getValue< 0, 0,-2>()), 0),
322 v3(F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue<-1, 0, 0>()),
323 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0,-1, 0>()),
324 F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0, 0,-1>()), 0),
325 v4(F4Val(s.template getValue< 1, 0, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
326 F4Val(s.template getValue< 0, 1, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
327 F4Val(s.template getValue< 0, 0, 1>()) - F4Val(s.template getValue< 0, 0, 0>()), 0),
328 v5(F4Val(s.template getValue< 2, 0, 0>()) - F4Val(s.template getValue< 1, 0, 0>()),
329 F4Val(s.template getValue< 0, 2, 0>()) - F4Val(s.template getValue< 0, 1, 0>()),
330 F4Val(s.template getValue< 0, 0, 2>()) - F4Val(s.template getValue< 0, 0, 1>()), 0),
331 v6(F4Val(s.template getValue< 3, 0, 0>()) - F4Val(s.template getValue< 2, 0, 0>()),
332 F4Val(s.template getValue< 0, 3, 0>()) - F4Val(s.template getValue< 0, 2, 0>()),
333 F4Val(s.template getValue< 0, 0, 3>()) - F4Val(s.template getValue< 0, 0, 2>()), 0),
340 #endif //DWA_OPENVDB // for SIMD - note will do the computations in float
346 template<DDScheme DiffScheme>
350 template<
typename Accessor>
354 template<
typename StencilT>
363 template<
typename Accessor>
366 return grid.getValue(ijk.offsetBy(1,0,0)) + grid.getValue(ijk.offsetBy(-1, 0, 0)) +
367 grid.getValue(ijk.offsetBy(0,1,0)) + grid.getValue(ijk.offsetBy(0, -1, 0)) +
368 grid.getValue(ijk.offsetBy(0,0,1)) + grid.getValue(ijk.offsetBy(0, 0,-1))
369 - 6*grid.getValue(ijk);
373 template<
typename StencilT>
376 return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
377 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
378 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
379 - 6*stencil.template getValue< 0, 0, 0>();
387 template<
typename Accessor>
391 return static_cast<ValueT
>(
393 grid.getValue(ijk.offsetBy(2,0,0)) + grid.getValue(ijk.offsetBy(-2, 0, 0)) +
394 grid.getValue(ijk.offsetBy(0,2,0)) + grid.getValue(ijk.offsetBy( 0,-2, 0)) +
395 grid.getValue(ijk.offsetBy(0,0,2)) + grid.getValue(ijk.offsetBy( 0, 0,-2)) )
397 grid.getValue(ijk.offsetBy(1,0,0)) + grid.getValue(ijk.offsetBy(-1, 0, 0)) +
398 grid.getValue(ijk.offsetBy(0,1,0)) + grid.getValue(ijk.offsetBy( 0,-1, 0)) +
399 grid.getValue(ijk.offsetBy(0,0,1)) + grid.getValue(ijk.offsetBy( 0, 0,-1)) )
400 - 7.5*grid.getValue(ijk));
404 template<
typename StencilT>
408 return static_cast<ValueT
>(
410 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
411 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
412 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
414 stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
415 stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
416 stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
417 - 7.5*stencil.template getValue< 0, 0, 0>());
425 template<
typename Accessor>
429 return static_cast<ValueT
>(
431 grid.getValue(ijk.offsetBy(3,0,0)) + grid.getValue(ijk.offsetBy(-3, 0, 0)) +
432 grid.getValue(ijk.offsetBy(0,3,0)) + grid.getValue(ijk.offsetBy( 0,-3, 0)) +
433 grid.getValue(ijk.offsetBy(0,0,3)) + grid.getValue(ijk.offsetBy( 0, 0,-3)) )
435 grid.getValue(ijk.offsetBy(2,0,0)) + grid.getValue(ijk.offsetBy(-2, 0, 0)) +
436 grid.getValue(ijk.offsetBy(0,2,0)) + grid.getValue(ijk.offsetBy( 0,-2, 0)) +
437 grid.getValue(ijk.offsetBy(0,0,2)) + grid.getValue(ijk.offsetBy( 0, 0,-2)) )
439 grid.getValue(ijk.offsetBy(1,0,0)) + grid.getValue(ijk.offsetBy(-1, 0, 0)) +
440 grid.getValue(ijk.offsetBy(0,1,0)) + grid.getValue(ijk.offsetBy( 0,-1, 0)) +
441 grid.getValue(ijk.offsetBy(0,0,1)) + grid.getValue(ijk.offsetBy( 0, 0,-1)) )
442 - (3*49/18.)*grid.getValue(ijk));
446 template<
typename StencilT>
450 return static_cast<ValueT
>(
452 stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
453 stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
454 stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
456 stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
457 stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
458 stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
460 stencil.template getValue< 1, 0, 0>() + stencil.template
getValue<-1, 0, 0>() +
461 stencil.template getValue< 0, 1, 0>() + stencil.template
getValue< 0,-1, 0>() +
462 stencil.template getValue< 0, 0, 1>() + stencil.template
getValue< 0, 0,-1>() )
463 - (3*49/18.)*stencil.template getValue< 0, 0, 0>());
471 template<DScheme DiffScheme>
497 template<DScheme DiffScheme>
501 template<
typename Accessor>
514 template<
typename StencilT>
531 template<DDScheme DiffScheme2, DScheme DiffScheme1>
538 template<
typename Accessor>
552 const ValueType normGrad = Dx2 + Dy2 + Dz2;
567 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
576 template<
typename StencilT>
589 const ValueType normGrad = Dx2 + Dy2 + Dz2;
604 alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
618 template<
typename MapType, DScheme DiffScheme>
622 template<
typename Accessor>
623 static typename internal::ReturnValue<Accessor>::Vec3Type
624 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
626 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
629 return Vec3Type(map.applyIJT(iGradient, ijk.asVec3d()));
633 template<
typename StencilT>
634 static typename internal::ReturnValue<StencilT>::Vec3Type
637 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
640 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
646 template<DScheme DiffScheme>
650 template<
typename Accessor>
651 static typename internal::ReturnValue<Accessor>::Vec3Type
658 template<
typename StencilT>
659 static typename internal::ReturnValue<StencilT>::Vec3Type
672 template<
typename Accessor>
673 static typename internal::ReturnValue<Accessor>::Vec3Type
677 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
681 return iGradient * inv2dx;
685 template<
typename StencilT>
686 static typename internal::ReturnValue<StencilT>::Vec3Type
690 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
694 return iGradient * inv2dx;
704 template<
typename Accessor>
705 static typename internal::ReturnValue<Accessor>::Vec3Type
709 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
713 return iGradient * inv2dx;
717 template<
typename StencilT>
718 static typename internal::ReturnValue<StencilT>::Vec3Type
722 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
726 return iGradient * inv2dx;
736 template<
typename Accessor>
737 static typename internal::ReturnValue<Accessor>::Vec3Type
741 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
755 template<
typename StencilT>
756 static typename internal::ReturnValue<StencilT>::Vec3Type
760 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
780 template<
typename Accessor>
781 static typename internal::ReturnValue<Accessor>::Vec3Type
785 using Vec3Type =
typename internal::ReturnValue<Accessor>::Vec3Type;
799 template<
typename StencilT>
800 static typename internal::ReturnValue<StencilT>::Vec3Type
804 using Vec3Type =
typename internal::ReturnValue<StencilT>::Vec3Type;
823 template<
typename MapType, BiasedGradientScheme GradScheme>
828 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
835 return Vec3Type(map.applyIJT(iGradient, ijk.asVec3d()));
847 return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
856 template<
typename MapType, BiasedGradientScheme GradScheme>
864 template<
typename Accessor>
866 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
877 template<
typename StencilT>
891 template<BiasedGradientScheme GradScheme>
895 template<
typename Accessor>
906 template<
typename StencilT>
918 template<BiasedGradientScheme GradScheme>
922 template<
typename Accessor>
933 template<
typename StencilT>
948 template<
typename MapType, DScheme DiffScheme>
953 result(
const MapType& map,
const Accessor& grid,
const Coord& ijk)
958 for (
int i=0; i < 3; i++) {
962 div +=
ValueType(map.applyIJT(vec, ijk.asVec3d())[i]);
974 for (
int i=0; i < 3; i++) {
978 div +=
ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
986 template<DScheme DiffScheme>
1014 template<DScheme DiffScheme>
1046 template<DScheme DiffScheme>
1090 return div * inv2dx;
1102 return div * inv2dx;
1121 return div * inv2dx;
1134 return div * inv2dx;
1140 template<DScheme DiffScheme>
1173 template<DScheme DiffScheme>
1273 template<
typename MapType, DScheme DiffScheme>
1282 for (
int i = 0; i < 3; i++) {
1288 mat[i] = Vec3Type(map.applyIJT(vec, ijk.asVec3d()));
1290 return Vec3Type(mat[2][1] - mat[1][2],
1291 mat[0][2] - mat[2][0],
1292 mat[1][0] - mat[0][1]);
1301 for (
int i = 0; i < 3; i++) {
1307 mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
1309 return Vec3Type(mat[2][1] - mat[1][2],
1310 mat[0][2] - mat[2][0],
1311 mat[1][0] - mat[0][1]);
1316 template<DScheme DiffScheme>
1339 template<DScheme DiffScheme>
1418 template<
typename MapType, DDScheme DiffScheme>
1422 template<
typename Accessor>
1424 const Accessor& grid,
const Coord& ijk)
1437 Mat3d d2_is(iddx, iddxy, iddxz,
1439 iddxz, iddyz, iddz);
1443 d2_rs = map.applyIJC(d2_is);
1450 d2_rs = map.applyIJC(d2_is, d1_is, ijk.asVec3d());
1454 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1458 template<
typename StencilT>
1472 Mat3d d2_is(iddx, iddxy, iddxz,
1474 iddxz, iddyz, iddz);
1478 d2_rs = map.applyIJC(d2_is);
1485 d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1489 return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
1494 template<DDScheme DiffScheme>
1498 template<
typename Accessor>
1500 const Accessor& grid,
const Coord& ijk)
1506 template<
typename StencilT>
1515 template<DDScheme DiffScheme>
1519 template<
typename Accessor>
1521 const Accessor& grid,
const Coord& ijk)
1527 template<
typename StencilT>
1535 template<DDScheme DiffScheme>
1558 template<DDScheme DiffScheme>
1581 template<DDScheme DiffScheme>
1597 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1615 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1622 template<DDScheme DiffScheme>
1637 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1654 const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
1664 template<
typename MapType, DScheme DiffScheme>
1680 Vec3d result = ijk.asVec3d() - map.applyInverseMap(vectorFromSurface);
1681 return Vec3Type(result);
1684 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1685 return Vec3Type(result);
1697 ValueType d = stencil.template getValue<0, 0, 0>();
1703 - map.applyInverseMap(vectorFromSurface);
1704 return Vec3Type(result);
1706 Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
1707 Vec3d result = map.applyInverseMap(location - vectorFromSurface);
1708 return Vec3Type(result);
1717 template<
typename MapType, DScheme DiffScheme>
1730 Vec3Type vectorFromSurface =
1732 Vec3d result = map.applyMap(ijk.asVec3d()) - vectorFromSurface;
1734 return Vec3Type(result);
1744 ValueType d = stencil.template getValue<0, 0, 0>();
1747 Vec3Type vectorFromSurface =
1749 Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
1751 return Vec3Type(result);
1760 template<
typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
1767 template<
typename Accessor>
1768 static bool compute(
const MapType& map,
const Accessor& grid,
const Coord& ijk,
1769 double&
alpha,
double& beta)
1778 d1_ws = map.applyIJT(d1_is);
1780 d1_ws = map.applyIJT(d1_is, ijk.asVec3d());
1782 const double Dx2 = d1_ws(0)*d1_ws(0);
1783 const double Dy2 = d1_ws(1)*d1_ws(1);
1784 const double Dz2 = d1_ws(2)*d1_ws(2);
1785 const double normGrad = Dx2 + Dy2 + Dz2;
1801 Mat3d d2_is(iddx, iddxy, iddxz,
1803 iddxz, iddyz, iddz);
1808 d2_ws = map.applyIJC(d2_is);
1810 d2_ws = map.applyIJC(d2_is, d1_is, ijk.asVec3d());
1814 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1815 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1816 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1817 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1822 template<
typename Accessor>
1824 const Accessor& grid,
const Coord& ijk)
1828 return compute(map, grid, ijk, alpha, beta) ?
1832 template<
typename Accessor>
1834 const Accessor& grid,
const Coord& ijk)
1838 return compute(map, grid, ijk, alpha, beta) ?
1846 template<
typename StencilT>
1848 double&
alpha,
double& beta)
1857 d1_ws = map.applyIJT(d1_is);
1859 d1_ws = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
1861 const double Dx2 = d1_ws(0)*d1_ws(0);
1862 const double Dy2 = d1_ws(1)*d1_ws(1);
1863 const double Dz2 = d1_ws(2)*d1_ws(2);
1864 const double normGrad = Dx2 + Dy2 + Dz2;
1880 Mat3d d2_is(iddx, iddxy, iddxz,
1882 iddxz, iddyz, iddz);
1887 d2_ws = map.applyIJC(d2_is);
1889 d2_ws = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
1893 alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
1894 +Dz2*(d2_ws(0,0)+d2_ws(1,1))
1895 -2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
1896 +d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
1901 template<
typename StencilT>
1907 return compute(map, stencil, alpha, beta) ?
1911 template<
typename StencilT>
1916 return compute(map, stencil, alpha, beta) ?
1922 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1926 template<
typename Accessor>
1928 const Accessor& grid,
const Coord& ijk)
1937 template<
typename Accessor>
1939 const Accessor& grid,
const Coord& ijk)
1949 template<
typename StencilT>
1959 template<
typename StencilT>
1971 template<DDScheme DiffScheme2, DScheme DiffScheme1>
1975 template<
typename Accessor>
1977 const Accessor& grid,
const Coord& ijk)
1989 template<
typename Accessor>
1991 const Accessor& grid,
const Coord& ijk)
2004 template<
typename StencilT>
2017 template<
typename StencilT>
2032 template<DDScheme DiffScheme2, DScheme DiffScheme1>
2098 template<
typename Gr
idType>
2113 {
return mMap->applyIJC(m,v,pos); }
2129 #endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Random access version.
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
GenericMap(MapBase::Ptr map)
GA_API const UT_StringHolder div
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType normGrad(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Adapter for vector-valued world-space operators to return the vector magnitude.
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
static StencilT::ValueType normGrad(const UniformScaleTranslateMap &map, const StencilT &stencil)
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const StencilT &stencil)
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
GenericMap(MapBase::ConstPtr map)
Type Pow2(Type x)
Return x2.
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
GridType
List of types that are currently supported by NanoVDB.
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
static StencilT::ValueType result(const StencilT &stencil)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
double determinant(const Vec3d &in) const
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
GLsizei const GLfloat * value
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType normGrad(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
ResultType result(const StencilType &stencil)
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
vfloat4 sqrt(const vfloat4 &a)
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
GenericMap(const GridType &g)
Curl operator defined in index space using various first derivative schemes.
GLuint GLsizei GLsizei * length
#define OPENVDB_USE_VERSION_NAMESPACE
Adapter for vector-valued index-space operators to return the vector magnitude.
SharedPtr< const MapBase > ConstPtr
Vec3d applyMap(const Vec3d &in) const
static double result(const MapT &map, const StencilType &stencil)
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Laplacian defined in index space, using various center-difference stencils.
**But if you need a result
Mat3d applyIJC(const Mat3d &m) const
GLfloat GLfloat GLfloat v2
Signed (x, y, z) 32-bit integer coordinates.
static double result(const StencilType &stencil)
GLfloat GLfloat GLfloat GLfloat v3
Tolerance for floating-point comparison.
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Vec3d applyInverseMap(const Vec3d &in) const
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...
__hostdev__ float getValue(uint32_t i) const
Compute the closest-point transform to a level set.
Vec3d applyIJT(const Vec3d &in) const
DScheme
Different discrete schemes used in the first derivatives.
static StencilT::ValueType result(const StencilT &stencil)
const Vec3d & getInvScale() const
Return 1/(scale)
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Compute the Laplacian at a given location in a grid using finite differencing of various orders...
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
static double result(const AccessorType &grid, const Coord &ijk)
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
double determinant() const
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
A wrapper that holds a MapBase::ConstPtr and exposes a reduced set of functionality needed by the mat...
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Stencil access version.
Compute the mean curvature.
static StencilT::ValueType result(const StencilT &stencil)
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Type Pow3(Type x)
Return x3.
static StencilT::ValueType normGrad(const UniformScaleMap &map, const StencilT &stencil)
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
GLfloat GLfloat GLfloat alpha
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
Center difference gradient operators, defined with respect to the range-space of the map...
GA_API const UT_StringHolder transform
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
GenericMap(const Transform &t)
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Biased gradient operators, defined with respect to the range-space of the map.
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
GA_API const UT_StringHolder up
Compute the mean curvature in index space.
ResultType result(const AccessorType &grid, const Coord &ijk)
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Random access version.
Adapter to associate a map with a world-space operator, giving it the same call signature as an index...
Compute the closest-point transform to a level set.
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Vec3d voxelSize(const Vec3d &v) const
MapAdapter(const MapType &m)
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
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.
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Stencil access version.
const Vec3d & getInvScale() const
Return 1/(scale)
static StencilT::ValueType result(const StencilT &stencil)
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Gradient operators defined in index space of various orders.
GLint GLfloat GLint stencil
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Divergence operator defined in index space using various first derivative schemes.
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
static StencilT::ValueType::value_type result(const StencilT &stencil)
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Abstract base class for maps.
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk, const Vec3< typename Accessor::ValueType > &V)
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Real GodunovsNormSqrd(bool isOutside, Real dP_xm, Real dP_xp, Real dP_ym, Real dP_yp, Real dP_zm, Real dP_zp)
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
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.
A specialized linear transform that performs a translation.
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)