15#ifndef NANOVDB_MATH_STENCILS_HAS_BEEN_INCLUDED
16#define NANOVDB_MATH_STENCILS_HAS_BEEN_INCLUDED
35template<
typename ValueType,
typename RealT = ValueType>
44 static const RealT C = 13.0 / 12.0;
49 const RealT eps = RealT(1.0e-6) * scale2;
51 const RealT A1 = RealT(0.1)/
Pow2(C*
Pow2(v1-2*v2+v3)+RealT(0.25)*
Pow2(v1-4*v2+3*v3)+eps),
52 A2 = RealT(0.6)/
Pow2(C*
Pow2(v2-2*v3+v4)+RealT(0.25)*
Pow2(v2-v4)+eps),
53 A3 = RealT(0.3)/
Pow2(C*
Pow2(v3-2*v4+v5)+RealT(0.25)*
Pow2(3*v3-4*v4+v5)+eps);
55 return static_cast<ValueType
>((A1*(2*v1 - 7*v2 + 11*v3) +
56 A2*(5*v3 - v2 + 2*v4) +
57 A3*(2*v3 + 5*v4 - v5))/(6*(A1+A2+A3)));
62template <
typename RealT>
65 RealT dP_xm, RealT dP_xp,
66 RealT dP_ym, RealT dP_yp,
67 RealT dP_zm, RealT dP_zp)
82template<
typename RealT>
89 gradient_m[0], gradient_p[0],
90 gradient_m[1], gradient_p[1],
91 gradient_m[2], gradient_p[2]);
97template<
typename DerivedType,
int SIZE,
typename Gr
idT>
113 static_cast<DerivedType&
>(*this).init(
mCenter);
125 static_cast<DerivedType&
>(*this).init(
mCenter);
133 template<
typename IterType>
138 static_cast<DerivedType&
>(*this).init(
mCenter);
147 template<
typename RealType>
166 template<
int i,
int j,
int k>
169 return mValues[
static_cast<const DerivedType&
>(*this).template pos<i,j,k>()];
173 template<
int i,
int j,
int k>
176 mValues[
static_cast<const DerivedType&
>(*this).template pos<i,j,k>()] = value;
186 for (
int i = 0; i < SIZE; ++i) sum +=
mValues[i];
194 for (
int i=1; i<SIZE; ++i) {
204 for (
int i=1; i<SIZE; ++i) {
293 template<
int i,
int j,
int k>
struct BoxPt {};
294 template<>
struct BoxPt< 0, 0, 0> {
enum { idx = 0 }; };
295 template<>
struct BoxPt< 0, 0, 1> {
enum { idx = 1 }; };
296 template<>
struct BoxPt< 0, 1, 1> {
enum { idx = 2 }; };
297 template<>
struct BoxPt< 0, 1, 0> {
enum { idx = 3 }; };
298 template<>
struct BoxPt< 1, 0, 0> {
enum { idx = 4 }; };
299 template<>
struct BoxPt< 1, 0, 1> {
enum { idx = 5 }; };
300 template<>
struct BoxPt< 1, 1, 1> {
enum { idx = 6 }; };
301 template<>
struct BoxPt< 1, 1, 0> {
enum { idx = 7 }; };
305template<
typename Gr
idT>
320 template<
int i,
int j,
int k>
327 const bool less = mValues[0] < isoValue;
328 return (less ^ (mValues[1] < isoValue)) ||
329 (less ^ (mValues[2] < isoValue)) ||
330 (less ^ (mValues[3] < isoValue)) ||
331 (less ^ (mValues[4] < isoValue)) ||
332 (less ^ (mValues[5] < isoValue)) ||
333 (less ^ (mValues[6] < isoValue)) ||
334 (less ^ (mValues[7] < isoValue)) ;
366 return C + (D - C) * u;
402 A = D[0] + (D[1] - D[0]) * v;
403 B = D[2] + (D[3] - D[2]) * v;
411 grad[1] = A + (B - A) * u;
439 template<
int i,
int j,
int k>
struct GradPt {};
440 template<>
struct GradPt< 0, 0, 0> {
enum { idx = 0 }; };
441 template<>
struct GradPt< 1, 0, 0> {
enum { idx = 2 }; };
442 template<>
struct GradPt< 0, 1, 0> {
enum { idx = 4 }; };
443 template<>
struct GradPt< 0, 0, 1> {
enum { idx = 6 }; };
444 template<>
struct GradPt<-1, 0, 0> {
enum { idx = 1 }; };
445 template<>
struct GradPt< 0,-1, 0> {
enum { idx = 3 }; };
446 template<>
struct GradPt< 0, 0,-1> {
enum { idx = 5 }; };
455template<
typename Gr
idT>
470 , mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
477 , mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
489 mValues[0] - mValues[1],
490 mValues[2] - mValues[0],
491 mValues[0] - mValues[3],
492 mValues[4] - mValues[0],
493 mValues[0] - mValues[5],
494 mValues[6] - mValues[0]);
505 mValues[4] - mValues[3],
506 mValues[6] - mValues[5])*mInv2Dx;
515 V[0]>0 ? mValues[0] - mValues[1] : mValues[2] - mValues[0],
516 V[1]>0 ? mValues[0] - mValues[3] : mValues[4] - mValues[0],
517 V[2]>0 ? mValues[0] - mValues[5] : mValues[6] - mValues[0])*2*mInv2Dx;
524 return mInvDx2 * (mValues[1] + mValues[2] +
525 mValues[3] + mValues[4] +
526 mValues[5] + mValues[6] - 6*mValues[0]);
533 return (mValues[0]>0 ? (mValues[1]<0 || mValues[2]<0 || mValues[3]<0 || mValues[4]<0 || mValues[5]<0 || mValues[6]<0)
534 : (mValues[1]>0 || mValues[2]>0 || mValues[3]>0 || mValues[4]>0 || mValues[5]>0 || mValues[6]>0));
548 const auto value =
Vec3<ValueType>(ijk[0] - d*(mValues[2] - mValues[1]),
549 ijk[1] - d*(mValues[4] - mValues[3]),
550 ijk[2] - d*(mValues[6] - mValues[5]));
555 template<
int i,
int j,
int k>
583 template<
int i,
int j,
int k>
struct WenoPt {};
584 template<>
struct WenoPt< 0, 0, 0> {
enum { idx = 0 }; };
586 template<>
struct WenoPt<-3, 0, 0> {
enum { idx = 1 }; };
587 template<>
struct WenoPt<-2, 0, 0> {
enum { idx = 2 }; };
588 template<>
struct WenoPt<-1, 0, 0> {
enum { idx = 3 }; };
589 template<>
struct WenoPt< 1, 0, 0> {
enum { idx = 4 }; };
590 template<>
struct WenoPt< 2, 0, 0> {
enum { idx = 5 }; };
591 template<>
struct WenoPt< 3, 0, 0> {
enum { idx = 6 }; };
593 template<>
struct WenoPt< 0,-3, 0> {
enum { idx = 7 }; };
594 template<>
struct WenoPt< 0,-2, 0> {
enum { idx = 8 }; };
595 template<>
struct WenoPt< 0,-1, 0> {
enum { idx = 9 }; };
596 template<>
struct WenoPt< 0, 1, 0> {
enum { idx =10 }; };
597 template<>
struct WenoPt< 0, 2, 0> {
enum { idx =11 }; };
598 template<>
struct WenoPt< 0, 3, 0> {
enum { idx =12 }; };
600 template<>
struct WenoPt< 0, 0,-3> {
enum { idx =13 }; };
601 template<>
struct WenoPt< 0, 0,-2> {
enum { idx =14 }; };
602 template<>
struct WenoPt< 0, 0,-1> {
enum { idx =15 }; };
603 template<>
struct WenoPt< 0, 0, 1> {
enum { idx =16 }; };
604 template<>
struct WenoPt< 0, 0, 2> {
enum { idx =17 }; };
605 template<>
struct WenoPt< 0, 0, 3> {
enum { idx =18 }; };
614template<
typename Gr
idT,
typename RealT =
typename Gr
idT::ValueType>
624 static constexpr int SIZE = 19;
651 dP_xm =
WENO5<RealT>(v[ 2]-v[ 1],v[ 3]-v[ 2],v[ 0]-v[ 3],v[ 4]-v[ 0],v[ 5]-v[ 4],mDx2),
652 dP_xp =
WENO5<RealT>(v[ 6]-v[ 5],v[ 5]-v[ 4],v[ 4]-v[ 0],v[ 0]-v[ 3],v[ 3]-v[ 2],mDx2),
653 dP_ym =
WENO5<RealT>(v[ 8]-v[ 7],v[ 9]-v[ 8],v[ 0]-v[ 9],v[10]-v[ 0],v[11]-v[10],mDx2),
654 dP_yp =
WENO5<RealT>(v[12]-v[11],v[11]-v[10],v[10]-v[ 0],v[ 0]-v[ 9],v[ 9]-v[ 8],mDx2),
655 dP_zm =
WENO5<RealT>(v[14]-v[13],v[15]-v[14],v[ 0]-v[15],v[16]-v[ 0],v[17]-v[16],mDx2),
656 dP_zp =
WENO5<RealT>(v[18]-v[17],v[17]-v[16],v[16]-v[ 0],v[ 0]-v[15],v[15]-v[14],mDx2);
670 V[0]>0 ?
WENO5<RealT>(v[ 2]-v[ 1],v[ 3]-v[ 2],v[ 0]-v[ 3], v[ 4]-v[ 0],v[ 5]-v[ 4],mDx2)
671 :
WENO5<RealT>(v[ 6]-v[ 5],v[ 5]-v[ 4],v[ 4]-v[ 0], v[ 0]-v[ 3],v[ 3]-v[ 2],mDx2),
672 V[1]>0 ?
WENO5<RealT>(v[ 8]-v[ 7],v[ 9]-v[ 8],v[ 0]-v[ 9], v[10]-v[ 0],v[11]-v[10],mDx2)
673 :
WENO5<RealT>(v[12]-v[11],v[11]-v[10],v[10]-v[ 0], v[ 0]-v[ 9],v[ 9]-v[ 8],mDx2),
674 V[2]>0 ?
WENO5<RealT>(v[14]-v[13],v[15]-v[14],v[ 0]-v[15], v[16]-v[ 0],v[17]-v[16],mDx2)
675 :
WENO5<RealT>(v[18]-v[17],v[17]-v[16],v[16]-v[ 0], v[ 0]-v[15],v[15]-v[14],mDx2));
685 mValues[10] - mValues[ 9],
686 mValues[16] - mValues[15]);
697 mValues[ 3] + mValues[ 4] +
698 mValues[ 9] + mValues[10] +
699 mValues[15] + mValues[16] - 6*mValues[0]);
707 return (v[ 0]>0 ? (v[ 3]<0 || v[ 4]<0 || v[ 9]<0 || v[10]<0 || v[15]<0 || v[16]<0)
708 : (v[ 3]>0 || v[ 4]>0 || v[ 9]>0 || v[10]>0 || v[15]>0 || v[16]>0));
712 template<
int i,
int j,
int k>
751 template<
int i,
int j,
int k>
struct CurvPt {};
752 template<>
struct CurvPt< 0, 0, 0> {
enum { idx = 0 }; };
754 template<>
struct CurvPt<-1, 0, 0> {
enum { idx = 1 }; };
755 template<>
struct CurvPt< 1, 0, 0> {
enum { idx = 2 }; };
757 template<>
struct CurvPt< 0,-1, 0> {
enum { idx = 3 }; };
758 template<>
struct CurvPt< 0, 1, 0> {
enum { idx = 4 }; };
760 template<>
struct CurvPt< 0, 0,-1> {
enum { idx = 5 }; };
761 template<>
struct CurvPt< 0, 0, 1> {
enum { idx = 6 }; };
763 template<>
struct CurvPt<-1,-1, 0> {
enum { idx = 7 }; };
764 template<>
struct CurvPt< 1,-1, 0> {
enum { idx = 8 }; };
765 template<>
struct CurvPt<-1, 1, 0> {
enum { idx = 9 }; };
766 template<>
struct CurvPt< 1, 1, 0> {
enum { idx =10 }; };
768 template<>
struct CurvPt<-1, 0,-1> {
enum { idx =11 }; };
769 template<>
struct CurvPt< 1, 0,-1> {
enum { idx =12 }; };
770 template<>
struct CurvPt<-1, 0, 1> {
enum { idx =13 }; };
771 template<>
struct CurvPt< 1, 0, 1> {
enum { idx =14 }; };
773 template<>
struct CurvPt< 0,-1,-1> {
enum { idx =15 }; };
774 template<>
struct CurvPt< 0, 1,-1> {
enum { idx =16 }; };
775 template<>
struct CurvPt< 0,-1, 1> {
enum { idx =17 }; };
776 template<>
struct CurvPt< 0, 1, 1> {
enum { idx =18 }; };
780template<
typename Gr
idT,
typename RealT =
typename Gr
idT::ValueType>
790 static constexpr int SIZE = 19;
795 , mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
802 , mInvDx2(
ValueType(4.0 * mInv2Dx * mInv2Dx))
812 RealT alpha, normGrad;
823 RealT alpha, normGrad;
835 RealT alphaM, alphaG, normGrad;
836 if (this->
curvatures(alphaM, alphaG, normGrad)) {
852 RealT alpha, normGrad;
864 RealT alpha, normGrad;
876 RealT alphaM, alphaG, normGrad;
877 if (this->
curvatures(alphaM, alphaG, normGrad)) {
893 RealT alphaM, alphaG, normGrad;
894 if (this->
curvatures(alphaM, alphaG, normGrad)) {
895 const RealT
mean = alphaM*mInv2Dx/
Pow3(normGrad);
910 mValues[1] + mValues[2] +
911 mValues[3] + mValues[4] +
912 mValues[5] + mValues[6] - 6*mValues[0]);
923 mValues[2] - mValues[1],
924 mValues[4] - mValues[3],
925 mValues[6] - mValues[5])*mInv2Dx;
929 template<
int i,
int j,
int k>
962 __hostdev__ inline RealT Dz()
const {
return 0.5*(mValues[6] - mValues[5]); }
963 __hostdev__ inline RealT Dxx()
const {
return mValues[2] - 2 * mValues[0] + mValues[1]; }
964 __hostdev__ inline RealT Dyy()
const {
return mValues[4] - 2 * mValues[0] + mValues[3]; }
965 __hostdev__ inline RealT Dzz()
const {
return mValues[6] - 2 * mValues[0] + mValues[5]; }
966 __hostdev__ inline RealT Dxy()
const {
return 0.25 * (mValues[10] - mValues[ 8] + mValues[ 7] - mValues[ 9]); }
967 __hostdev__ inline RealT Dxz()
const {
return 0.25 * (mValues[14] - mValues[12] + mValues[11] - mValues[13]); }
968 __hostdev__ inline RealT Dyz()
const {
return 0.25 * (mValues[18] - mValues[16] + mValues[15] - mValues[17]); }
973 const RealT Dx = this->Dx(), Dy = this->Dy(), Dz = this->Dz(),
974 Dx2 = Dx*Dx, Dy2 = Dy*Dy, Dz2 = Dz*Dz, normGrad2 = Dx2 + Dy2 + Dz2;
975 if (normGrad2 <= Tolerance<RealT>::value()) {
976 alpha = normGrad = 0;
979 const RealT Dxx = this->Dxx(), Dyy = this->Dyy(), Dzz = this->Dzz();
980 alpha = Dx2*(Dyy + Dzz) + Dy2*(Dxx + Dzz) + Dz2*(Dxx + Dyy) -
981 2*(Dx*(Dy*this->Dxy() + Dz*this->Dxz()) + Dy*Dz*this->Dyz());
982 normGrad =
Sqrt(normGrad2);
989 const RealT Dx = this->Dx(), Dy = this->Dy(), Dz = this->Dz(),
990 Dx2 = Dx*Dx, Dy2 = Dy*Dy, Dz2 = Dz*Dz, normGrad2 = Dx2 + Dy2 + Dz2;
991 if (normGrad2 <= Tolerance<RealT>::value()) {
992 alpha = normGrad = 0;
995 const RealT Dxx = this->Dxx(), Dyy = this->Dyy(), Dzz = this->Dzz(),
996 Dxy = this->Dxy(), Dxz = this->Dxz(), Dyz = this->Dyz();
997 alpha = Dx2*(Dyy*Dzz - Dyz*Dyz) + Dy2*(Dxx*Dzz - Dxz*Dxz) + Dz2*(Dxx*Dyy - Dxy*Dxy) +
998 2*( Dy*Dz*(Dxy*Dxz - Dyz*Dxx) + Dx*Dz*(Dxy*Dyz - Dxz*Dyy) + Dx*Dy*(Dxz*Dyz - Dxy*Dzz) );
999 normGrad =
Sqrt(normGrad2);
1006 const RealT Dx = this->Dx(), Dy = this->Dy(), Dz = this->Dz(),
1007 Dx2 = Dx*Dx, Dy2 = Dy*Dy, Dz2 = Dz*Dz, normGrad2 = Dx2 + Dy2 + Dz2;
1008 if (normGrad2 <= Tolerance<RealT>::value()) {
1009 alphaM = alphaG =normGrad = 0;
1012 const RealT Dxx = this->Dxx(), Dyy = this->Dyy(), Dzz = this->Dzz(),
1013 Dxy = this->Dxy(), Dxz = this->Dxz(), Dyz = this->Dyz();
1014 alphaM = Dx2*(Dyy + Dzz) + Dy2*(Dxx + Dzz) + Dz2*(Dxx + Dyy) -
1015 2*(Dx*(Dy*Dxy + Dz*Dxz) + Dy*Dz*Dyz);
1016 alphaG = Dx2*(Dyy*Dzz - Dyz*Dyz) + Dy2*(Dxx*Dzz - Dxz*Dxz) + Dz2*(Dxx*Dyy - Dxy*Dxy) +
1017 2*( Dy*Dz*(Dxy*Dxz - Dyz*Dxx) + Dx*Dz*(Dxy*Dyz - Dxz*Dyy) + Dx*Dy*(Dxz*Dyz - Dxy*Dzz) );
1018 normGrad =
Sqrt(normGrad2);
__hostdev__ const ValueType & getCenterValue() const
Return the value at the center of the stencil.
Definition Stencils.h:214
ValueType mValues[SIZE]
Definition Stencils.h:281
__hostdev__ const ValueType & getValue() const
Return the value at the specified location relative to the center of the stencil.
Definition Stencils.h:167
__hostdev__ void moveTo(const Coord &ijk, const ValueType ¢erValue)
Initialize the stencil buffer with the values of voxel (i, j, k) and its neighbors....
Definition Stencils.h:121
__hostdev__ void moveTo(const Vec3< RealType > &xyz)
Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors.
Definition Stencils.h:148
__hostdev__ const ValueType & getValue(unsigned int pos=0) const
Return the value from the stencil buffer with linear offset pos.
Definition Stencils.h:159
__hostdev__ void moveTo(const IterType &iter)
Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors.
Definition Stencils.h:134
__hostdev__ Mask intersectionMask(ValueType isoValue=ValueType(0)) const
Return true a bit-mask where the 6 lower bits indicates if the center of the stencil intersects the i...
Definition Stencils.h:249
__hostdev__ ValueType min() const
Return the smallest value in the stencil buffer.
Definition Stencils.h:191
typename GridT::AccessorType AccessorType
Definition Stencils.h:104
__hostdev__ bool intersects(const ValueType &isoValue=ValueType(0)) const
Return true if the center of the stencil intersects the iso-contour specified by the isoValue.
Definition Stencils.h:218
Coord mCenter
Definition Stencils.h:282
const GridType * mGrid
Definition Stencils.h:279
__hostdev__ void moveTo(const Coord &ijk)
Initialize the stencil buffer with the values of voxel (i, j, k) and its neighbors.
Definition Stencils.h:109
__hostdev__ const AccessorType & accessor() const
Return a const reference to the ValueAccessor associated with this Stencil.
Definition Stencils.h:268
typename GridT::TreeType TreeType
Definition Stencils.h:103
typename GridT::ValueType ValueType
Definition Stencils.h:101
__hostdev__ void setValue(const ValueType &value)
Set the value at the specified location relative to the center of the stencil.
Definition Stencils.h:174
__hostdev__ const GridType & grid() const
Return a const reference to the grid from which this stencil was constructed.
Definition Stencils.h:264
__hostdev__ ValueType max() const
Return the largest value in the stencil buffer.
Definition Stencils.h:201
__hostdev__ BaseStencil(const GridType &grid)
Definition Stencils.h:272
__hostdev__ const Coord & getCenterCoord() const
Return the coordinates of the center point of the stencil.
Definition Stencils.h:211
__hostdev__ ValueType mean() const
Return the mean value of the current stencil.
Definition Stencils.h:183
AccessorType mAcc
Definition Stencils.h:280
GridT GridType
Definition Stencils.h:102
static __hostdev__ int size()
Return the size of the stencil buffer.
Definition Stencils.h:180
static constexpr int SIZE
Definition Stencils.h:315
__hostdev__ BoxStencil(const GridType &grid)
Definition Stencils.h:317
__hostdev__ ValueType interpolation(const Vec3< ValueType > &xyz) const
Return the trilinear interpolation at the normalized position.
Definition Stencils.h:344
__hostdev__ bool intersects(ValueType isoValue=ValueType(0)) const
Return true if the center of the stencil intersects the.
Definition Stencils.h:325
__hostdev__ Vec3< ValueType > gradient(const Vec3< ValueType > &xyz) const
Return the gradient in world space of the trilinear interpolation kernel.
Definition Stencils.h:376
__hostdev__ unsigned int pos() const
Return linear offset for the specified stencil point relative to its center.
Definition Stencils.h:321
typename GridT::TreeType TreeType
Definition Stencils.h:312
typename GridT::ValueType ValueType
Definition Stencils.h:313
friend class BaseStencil
Definition Stencils.h:428
GridT GridType
Definition Stencils.h:311
Signed (i, j, k) 32-bit integer coordinate class, similar to openvdb::math::Coord.
Definition Math.h:346
__hostdev__ Coord offsetBy(ValueType dx, ValueType dy, ValueType dz) const
Definition Math.h:546
static constexpr int SIZE
Definition Stencils.h:790
__hostdev__ void principalCurvatures(ValueType &min, ValueType &max) const
Computes the minimum and maximum principal curvature at the previously buffered location.
Definition Stencils.h:890
__hostdev__ Vec3< ValueType > gradient() const
Definition Stencils.h:920
__hostdev__ ValueType gaussianCurvatureNormGrad() const
Definition Stencils.h:862
__hostdev__ CurvatureStencil(const GridType &grid)
Definition Stencils.h:792
__hostdev__ CurvatureStencil(const GridType &grid, double dx)
Definition Stencils.h:799
__hostdev__ ValueType meanCurvature() const
Return the mean curvature at the previously buffered location.
Definition Stencils.h:810
__hostdev__ void curvaturesNormGrad(ValueType &mean, ValueType &gauss) const
Return both the mean and the Gaussian curvature at the previously buffered location.
Definition Stencils.h:874
__hostdev__ void curvatures(ValueType &mean, ValueType &gauss) const
Return both the mean and the Gaussian curvature at the previously buffered location.
Definition Stencils.h:833
__hostdev__ ValueType gaussianCurvature() const
Return the Gaussian curvature at the previously buffered location.
Definition Stencils.h:821
__hostdev__ unsigned int pos() const
Return linear offset for the specified stencil point relative to its center.
Definition Stencils.h:930
typename GridT::TreeType TreeType
Definition Stencils.h:787
typename GridT::ValueType ValueType
Definition Stencils.h:788
friend class BaseStencil
Definition Stencils.h:1022
__hostdev__ ValueType meanCurvatureNormGrad() const
Definition Stencils.h:850
GridT GridType
Definition Stencils.h:786
__hostdev__ ValueType laplacian() const
Definition Stencils.h:907
__hostdev__ GradStencil(const GridType &grid, double dx)
Definition Stencils.h:474
static constexpr int SIZE
Definition Stencils.h:465
__hostdev__ Vec3< ValueType > gradient() const
Return the gradient computed at the previously buffered location by second order central differencing...
Definition Stencils.h:502
__hostdev__ ValueType normSqGrad() const
Return the norm square of the single-sided upwind gradient (computed via Godunov's scheme) at the pre...
Definition Stencils.h:486
__hostdev__ GradStencil(const GridType &grid)
Definition Stencils.h:467
__hostdev__ Vec3< ValueType > gradient(const Vec3< ValueType > &V) const
Return the first-order upwind gradient corresponding to the direction V.
Definition Stencils.h:512
__hostdev__ unsigned int pos() const
Return linear offset for the specified stencil point relative to its center.
Definition Stencils.h:556
__hostdev__ bool zeroCrossing() const
Definition Stencils.h:531
__hostdev__ Vec3< ValueType > cpt()
Compute the closest-point transform to a level set.
Definition Stencils.h:544
typename GridT::TreeType TreeType
Definition Stencils.h:462
typename GridT::ValueType ValueType
Definition Stencils.h:463
friend class BaseStencil
Definition Stencils.h:572
GridT GridType
Definition Stencils.h:461
__hostdev__ ValueType laplacian() const
Definition Stencils.h:522
A simple vector class with three components, similar to openvdb::math::Vec3.
Definition Math.h:1362
static constexpr int SIZE
Definition Stencils.h:624
__hostdev__ Vec3< ValueType > gradient() const
Definition Stencils.h:682
__hostdev__ Vec3< ValueType > gradient(const Vec3< ValueType > &V) const
Definition Stencils.h:666
__hostdev__ unsigned int pos() const
Return linear offset for the specified stencil point relative to its center.
Definition Stencils.h:713
__hostdev__ bool zeroCrossing() const
Definition Stencils.h:704
__hostdev__ ValueType normSqGrad(ValueType isoValue=ValueType(0)) const
Return the norm-square of the WENO upwind gradient (computed via WENO upwinding and Godunov's scheme)...
Definition Stencils.h:647
typename GridT::TreeType TreeType
Definition Stencils.h:621
typename GridT::ValueType ValueType
Definition Stencils.h:622
friend class BaseStencil
Definition Stencils.h:740
__hostdev__ WenoStencil(const GridType &grid, double dx)
Definition Stencils.h:634
__hostdev__ WenoStencil(const GridType &grid)
Definition Stencils.h:626
GridT GridType
Definition Stencils.h:620
__hostdev__ ValueType laplacian() const
Definition Stencils.h:694
#define __hostdev__
Definition SampleFromVoxels.h:29
Definition DitherLUT.h:19
__hostdev__ T Pow3(T x)
Definition Math.h:218
__hostdev__ RealT GodunovsNormSqrd(bool isOutside, RealT dP_xm, RealT dP_xp, RealT dP_ym, RealT dP_yp, RealT dP_zm, RealT dP_zp)
Definition Stencils.h:64
__hostdev__ ValueType WENO5(const ValueType &v1, const ValueType &v2, const ValueType &v3, const ValueType &v4, const ValueType &v5, RealT scale2=1.0)
Implementation of nominally fifth-order finite-difference WENO.
Definition Stencils.h:37
__hostdev__ T Pow2(T x)
Definition Math.h:212
__hostdev__ T Pow4(T x)
Definition Math.h:224
__hostdev__ CoordT RoundDown(const Vec3T< RealT > &xyz)
Definition Math.h:270
__hostdev__ Type Max(Type a, Type b)
Definition Math.h:154
__hostdev__ float Sqrt(float x)
Return the square root of a floating-point value.
Definition Math.h:277
__hostdev__ Type Min(Type a, Type b)
Definition Math.h:133
uint32_t countOn(uint64_t v)
Definition Util.h:668
Defines a simple memory pool used to call cub functions that use dynamic temporary storage.
Definition GridHandle.h:31
Math functions and classes.
#define NANOVDB_ASSERT(x)
Definition Util.h:53
__hostdev__ bool all() const
Definition Stencils.h:234
__hostdev__ bool none() const
Definition Stencils.h:235
uint8_t bits
Definition Stencils.h:229
__hostdev__ int count() const
Definition Stencils.h:236
__hostdev__ Mask()
Definition Stencils.h:230
__hostdev__ bool test(int i) const
Definition Stencils.h:232
__hostdev__ void set(int i)
Definition Stencils.h:231
__hostdev__ bool any() const
Definition Stencils.h:233