Loading...
Searching...
No Matches
Operators.h
Go to the documentation of this file.
// Copyright Contributors to the OpenVDB Project
// SPDX-License-Identifier: MPL-2.0
/// @file math/Operators.h
#ifndef OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
#define OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
#include "FiniteDifference.h"
#include "Stencils.h"
#include "Maps.h"
#include "Transform.h"
#include <cmath> // for std::sqrt()
namespace openvdb {
OPENVDB_USE_VERSION_NAMESPACE
namespace OPENVDB_VERSION_NAME {
namespace math {
// Simple tools to help determine when type conversions are needed
template<typename Vec3T> struct is_vec3d { static const bool value = false; };
template<> struct is_vec3d<Vec3d> { static const bool value = true; };
template<typename T> struct is_double { static const bool value = false; };
template<> struct is_double<double> { static const bool value = true; };
/// @brief Adapter to associate a map with a world-space operator,
/// giving it the same call signature as an index-space operator
/// @todo For now, the operator's result type must be specified explicitly,
/// but eventually it should be possible, via traits, to derive the result type
/// from the operator type.
template<typename MapType, typename OpType, typename ResultType>
struct MapAdapter {
MapAdapter(const MapType& m): map(m) {}
template<typename AccessorType>
inline ResultType
result(const AccessorType& grid, const Coord& ijk) { return OpType::result(map, grid, ijk); }
template<typename StencilType>
inline ResultType
result(const StencilType& stencil) { return OpType::result(map, stencil); }
const MapType map;
};
/// Adapter for vector-valued index-space operators to return the vector magnitude
template<typename OpType>
struct ISOpMagnitude {
template<typename AccessorType>
static inline double result(const AccessorType& grid, const Coord& ijk) {
return double(OpType::result(grid, ijk).length());
}
template<typename StencilType>
static inline double result(const StencilType& stencil) {
return double(OpType::result(stencil).length());
}
};
/// Adapter for vector-valued world-space operators to return the vector magnitude
template<typename OpType, typename MapT>
struct OpMagnitude {
template<typename AccessorType>
static inline double result(const MapT& map, const AccessorType& grid, const Coord& ijk) {
return double(OpType::result(map, grid, ijk).length());
}
template<typename StencilType>
static inline double result(const MapT& map, const StencilType& stencil) {
return double(OpType::result(map, stencil).length());
}
};
/// @cond OPENVDB_DOCS_INTERNAL
namespace internal {
// This additional layer is necessary for Visual C++ to compile.
template<typename T>
struct ReturnValue {
using ValueType = typename T::ValueType;
using Vec3Type = math::Vec3<ValueType>;
};
} // namespace internal
/// @endcond
// ---- Operators defined in index space
//@{
/// @brief Gradient operators defined in index space of various orders
template<DScheme DiffScheme>
struct ISGradient
{
// random access version
template<typename Accessor> static Vec3<typename Accessor::ValueType>
result(const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
using Vec3Type = Vec3<ValueType>;
return Vec3Type( D1<DiffScheme>::inX(grid, ijk),
D1<DiffScheme>::inY(grid, ijk),
D1<DiffScheme>::inZ(grid, ijk) );
}
// stencil access version
template<typename StencilT> static Vec3<typename StencilT::ValueType>
result(const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
using Vec3Type = Vec3<ValueType>;
return Vec3Type( D1<DiffScheme>::inX(stencil),
D1<DiffScheme>::inY(stencil),
D1<DiffScheme>::inZ(stencil) );
}
};
//@}
/// struct that relates the BiasedGradientScheme to the
/// forward and backward difference methods used, as well as to
/// the correct stencil type for index space use
template<BiasedGradientScheme bgs>
struct BIAS_SCHEME {
static const DScheme FD = FD_1ST;
static const DScheme BD = BD_1ST;
template<typename GridType, bool IsSafe = true>
struct ISStencil {
using StencilType = SevenPointStencil<GridType, IsSafe>;
};
};
template<> struct BIAS_SCHEME<FIRST_BIAS>
{
static const DScheme FD = FD_1ST;
static const DScheme BD = BD_1ST;
template<typename GridType, bool IsSafe = true>
struct ISStencil {
using StencilType = SevenPointStencil<GridType, IsSafe>;
};
};
template<> struct BIAS_SCHEME<SECOND_BIAS>
{
static const DScheme FD = FD_2ND;
static const DScheme BD = BD_2ND;
template<typename GridType, bool IsSafe = true>
struct ISStencil {
using StencilType = ThirteenPointStencil<GridType, IsSafe>;
};
};
template<> struct BIAS_SCHEME<THIRD_BIAS>
{
static const DScheme FD = FD_3RD;
static const DScheme BD = BD_3RD;
template<typename GridType, bool IsSafe = true>
struct ISStencil {
using StencilType = NineteenPointStencil<GridType, IsSafe>;
};
};
template<> struct BIAS_SCHEME<WENO5_BIAS>
{
static const DScheme FD = FD_WENO5;
static const DScheme BD = BD_WENO5;
template<typename GridType, bool IsSafe = true>
struct ISStencil {
using StencilType = NineteenPointStencil<GridType, IsSafe>;
};
};
template<> struct BIAS_SCHEME<HJWENO5_BIAS>
{
static const DScheme FD = FD_HJWENO5;
static const DScheme BD = BD_HJWENO5;
template<typename GridType, bool IsSafe = true>
struct ISStencil {
using StencilType = NineteenPointStencil<GridType, IsSafe>;
};
};
//@{
/// @brief Biased Gradient Operators, using upwinding defined by the @c Vec3Bias input
template<BiasedGradientScheme GradScheme, typename Vec3Bias>
struct ISGradientBiased
{
static const DScheme FD = BIAS_SCHEME<GradScheme>::FD;
static const DScheme BD = BIAS_SCHEME<GradScheme>::BD;
// random access version
template<typename Accessor>
static Vec3<typename Accessor::ValueType>
result(const Accessor& grid, const Coord& ijk, const Vec3Bias& V)
{
using ValueType = typename Accessor::ValueType;
using Vec3Type = Vec3<ValueType>;
return Vec3Type(V[0]<0 ? D1<FD>::inX(grid,ijk) : D1<BD>::inX(grid,ijk),
V[1]<0 ? D1<FD>::inY(grid,ijk) : D1<BD>::inY(grid,ijk),
V[2]<0 ? D1<FD>::inZ(grid,ijk) : D1<BD>::inZ(grid,ijk) );
}
// stencil access version
template<typename StencilT>
static Vec3<typename StencilT::ValueType>
result(const StencilT& stencil, const Vec3Bias& V)
{
using ValueType = typename StencilT::ValueType;
using Vec3Type = Vec3<ValueType>;
return Vec3Type(V[0]<0 ? D1<FD>::inX(stencil) : D1<BD>::inX(stencil),
V[1]<0 ? D1<FD>::inY(stencil) : D1<BD>::inY(stencil),
V[2]<0 ? D1<FD>::inZ(stencil) : D1<BD>::inZ(stencil) );
}
};
template<BiasedGradientScheme GradScheme>
struct ISGradientNormSqrd
{
static const DScheme FD = BIAS_SCHEME<GradScheme>::FD;
static const DScheme BD = BIAS_SCHEME<GradScheme>::BD;
// random access version
template<typename Accessor>
static typename Accessor::ValueType
result(const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
using Vec3Type = math::Vec3<ValueType>;
Vec3Type up = ISGradient<FD>::result(grid, ijk);
Vec3Type down = ISGradient<BD>::result(grid, ijk);
return math::GodunovsNormSqrd(grid.getValue(ijk)>0, down, up);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType
result(const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
using Vec3Type = math::Vec3<ValueType>;
Vec3Type up = ISGradient<FD>::result(stencil);
Vec3Type down = ISGradient<BD>::result(stencil);
return math::GodunovsNormSqrd(stencil.template getValue<0, 0, 0>()>0, down, up);
}
};
#ifdef DWA_OPENVDB // for SIMD - note will do the computations in float
template<>
struct ISGradientNormSqrd<HJWENO5_BIAS>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const Accessor& grid, const Coord& ijk)
{
struct GetValue
{
const Accessor& acc;
GetValue(const Accessor& acc_): acc(acc_) {}
// Return the grid value at ijk converted to simd::Float4::value_type (= float).
inline simd::Float4::value_type operator()(const Coord& ijk_) {
return static_cast<simd::Float4::value_type>(acc.getValue(ijk_));
}
}
valueAt(grid);
// SSE optimized
const simd::Float4
v1(valueAt(ijk.offsetBy(-2, 0, 0)) - valueAt(ijk.offsetBy(-3, 0, 0)),
valueAt(ijk.offsetBy( 0,-2, 0)) - valueAt(ijk.offsetBy( 0,-3, 0)),
valueAt(ijk.offsetBy( 0, 0,-2)) - valueAt(ijk.offsetBy( 0, 0,-3)), 0),
v2(valueAt(ijk.offsetBy(-1, 0, 0)) - valueAt(ijk.offsetBy(-2, 0, 0)),
valueAt(ijk.offsetBy( 0,-1, 0)) - valueAt(ijk.offsetBy( 0,-2, 0)),
valueAt(ijk.offsetBy( 0, 0,-1)) - valueAt(ijk.offsetBy( 0, 0,-2)), 0),
v3(valueAt(ijk ) - valueAt(ijk.offsetBy(-1, 0, 0)),
valueAt(ijk ) - valueAt(ijk.offsetBy( 0,-1, 0)),
valueAt(ijk ) - valueAt(ijk.offsetBy( 0, 0,-1)), 0),
v4(valueAt(ijk.offsetBy( 1, 0, 0)) - valueAt(ijk ),
valueAt(ijk.offsetBy( 0, 1, 0)) - valueAt(ijk ),
valueAt(ijk.offsetBy( 0, 0, 1)) - valueAt(ijk ), 0),
v5(valueAt(ijk.offsetBy( 2, 0, 0)) - valueAt(ijk.offsetBy( 1, 0, 0)),
valueAt(ijk.offsetBy( 0, 2, 0)) - valueAt(ijk.offsetBy( 0, 1, 0)),
valueAt(ijk.offsetBy( 0, 0, 2)) - valueAt(ijk.offsetBy( 0, 0, 1)), 0),
v6(valueAt(ijk.offsetBy( 3, 0, 0)) - valueAt(ijk.offsetBy( 2, 0, 0)),
valueAt(ijk.offsetBy( 0, 3, 0)) - valueAt(ijk.offsetBy( 0, 2, 0)),
valueAt(ijk.offsetBy( 0, 0, 3)) - valueAt(ijk.offsetBy( 0, 0, 2)), 0),
down = math::WENO5(v1, v2, v3, v4, v5),
up = math::WENO5(v6, v5, v4, v3, v2);
return math::GodunovsNormSqrd(grid.getValue(ijk)>0, down, up);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const StencilT& s)
{
using F4Val = simd::Float4::value_type;
// SSE optimized
const simd::Float4
v1(F4Val(s.template getValue<-2, 0, 0>()) - F4Val(s.template getValue<-3, 0, 0>()),
F4Val(s.template getValue< 0,-2, 0>()) - F4Val(s.template getValue< 0,-3, 0>()),
F4Val(s.template getValue< 0, 0,-2>()) - F4Val(s.template getValue< 0, 0,-3>()), 0),
v2(F4Val(s.template getValue<-1, 0, 0>()) - F4Val(s.template getValue<-2, 0, 0>()),
F4Val(s.template getValue< 0,-1, 0>()) - F4Val(s.template getValue< 0,-2, 0>()),
F4Val(s.template getValue< 0, 0,-1>()) - F4Val(s.template getValue< 0, 0,-2>()), 0),
v3(F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue<-1, 0, 0>()),
F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0,-1, 0>()),
F4Val(s.template getValue< 0, 0, 0>()) - F4Val(s.template getValue< 0, 0,-1>()), 0),
v4(F4Val(s.template getValue< 1, 0, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
F4Val(s.template getValue< 0, 1, 0>()) - F4Val(s.template getValue< 0, 0, 0>()),
F4Val(s.template getValue< 0, 0, 1>()) - F4Val(s.template getValue< 0, 0, 0>()), 0),
v5(F4Val(s.template getValue< 2, 0, 0>()) - F4Val(s.template getValue< 1, 0, 0>()),
F4Val(s.template getValue< 0, 2, 0>()) - F4Val(s.template getValue< 0, 1, 0>()),
F4Val(s.template getValue< 0, 0, 2>()) - F4Val(s.template getValue< 0, 0, 1>()), 0),
v6(F4Val(s.template getValue< 3, 0, 0>()) - F4Val(s.template getValue< 2, 0, 0>()),
F4Val(s.template getValue< 0, 3, 0>()) - F4Val(s.template getValue< 0, 2, 0>()),
F4Val(s.template getValue< 0, 0, 3>()) - F4Val(s.template getValue< 0, 0, 2>()), 0),
down = math::WENO5(v1, v2, v3, v4, v5),
up = math::WENO5(v6, v5, v4, v3, v2);
return math::GodunovsNormSqrd(s.template getValue<0, 0, 0>()>0, down, up);
}
};
#endif //DWA_OPENVDB // for SIMD - note will do the computations in float
//@}
//@{
/// @brief Laplacian defined in index space, using various center-difference stencils
template<DDScheme DiffScheme>
struct ISLaplacian
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const Accessor& grid, const Coord& ijk);
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const StencilT& stencil);
};
template<>
struct ISLaplacian<CD_SECOND>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const Accessor& grid, const Coord& ijk)
{
return grid.getValue(ijk.offsetBy(1,0,0)) + grid.getValue(ijk.offsetBy(-1, 0, 0)) +
grid.getValue(ijk.offsetBy(0,1,0)) + grid.getValue(ijk.offsetBy(0, -1, 0)) +
grid.getValue(ijk.offsetBy(0,0,1)) + grid.getValue(ijk.offsetBy(0, 0,-1))
- 6*grid.getValue(ijk);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const StencilT& stencil)
{
return stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>()
- 6*stencil.template getValue< 0, 0, 0>();
}
};
template<>
struct ISLaplacian<CD_FOURTH>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const Accessor& grid, const Coord& ijk)
{
using ValueT = typename Accessor::ValueType;
return static_cast<ValueT>(
(-1./12.)*(
grid.getValue(ijk.offsetBy(2,0,0)) + grid.getValue(ijk.offsetBy(-2, 0, 0)) +
grid.getValue(ijk.offsetBy(0,2,0)) + grid.getValue(ijk.offsetBy( 0,-2, 0)) +
grid.getValue(ijk.offsetBy(0,0,2)) + grid.getValue(ijk.offsetBy( 0, 0,-2)) )
+ (4./3.)*(
grid.getValue(ijk.offsetBy(1,0,0)) + grid.getValue(ijk.offsetBy(-1, 0, 0)) +
grid.getValue(ijk.offsetBy(0,1,0)) + grid.getValue(ijk.offsetBy( 0,-1, 0)) +
grid.getValue(ijk.offsetBy(0,0,1)) + grid.getValue(ijk.offsetBy( 0, 0,-1)) )
- 7.5*grid.getValue(ijk));
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const StencilT& stencil)
{
using ValueT = typename StencilT::ValueType;
return static_cast<ValueT>(
(-1./12.)*(
stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
+ (4./3.)*(
stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
- 7.5*stencil.template getValue< 0, 0, 0>());
}
};
template<>
struct ISLaplacian<CD_SIXTH>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const Accessor& grid, const Coord& ijk)
{
using ValueT = typename Accessor::ValueType;
return static_cast<ValueT>(
(1./90.)*(
grid.getValue(ijk.offsetBy(3,0,0)) + grid.getValue(ijk.offsetBy(-3, 0, 0)) +
grid.getValue(ijk.offsetBy(0,3,0)) + grid.getValue(ijk.offsetBy( 0,-3, 0)) +
grid.getValue(ijk.offsetBy(0,0,3)) + grid.getValue(ijk.offsetBy( 0, 0,-3)) )
- (3./20.)*(
grid.getValue(ijk.offsetBy(2,0,0)) + grid.getValue(ijk.offsetBy(-2, 0, 0)) +
grid.getValue(ijk.offsetBy(0,2,0)) + grid.getValue(ijk.offsetBy( 0,-2, 0)) +
grid.getValue(ijk.offsetBy(0,0,2)) + grid.getValue(ijk.offsetBy( 0, 0,-2)) )
+ 1.5 *(
grid.getValue(ijk.offsetBy(1,0,0)) + grid.getValue(ijk.offsetBy(-1, 0, 0)) +
grid.getValue(ijk.offsetBy(0,1,0)) + grid.getValue(ijk.offsetBy( 0,-1, 0)) +
grid.getValue(ijk.offsetBy(0,0,1)) + grid.getValue(ijk.offsetBy( 0, 0,-1)) )
- (3*49/18.)*grid.getValue(ijk));
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const StencilT& stencil)
{
using ValueT = typename StencilT::ValueType;
return static_cast<ValueT>(
(1./90.)*(
stencil.template getValue< 3, 0, 0>() + stencil.template getValue<-3, 0, 0>() +
stencil.template getValue< 0, 3, 0>() + stencil.template getValue< 0,-3, 0>() +
stencil.template getValue< 0, 0, 3>() + stencil.template getValue< 0, 0,-3>() )
- (3./20.)*(
stencil.template getValue< 2, 0, 0>() + stencil.template getValue<-2, 0, 0>() +
stencil.template getValue< 0, 2, 0>() + stencil.template getValue< 0,-2, 0>() +
stencil.template getValue< 0, 0, 2>() + stencil.template getValue< 0, 0,-2>() )
+ 1.5 *(
stencil.template getValue< 1, 0, 0>() + stencil.template getValue<-1, 0, 0>() +
stencil.template getValue< 0, 1, 0>() + stencil.template getValue< 0,-1, 0>() +
stencil.template getValue< 0, 0, 1>() + stencil.template getValue< 0, 0,-1>() )
- (3*49/18.)*stencil.template getValue< 0, 0, 0>());
}
};
//@}
//@{
/// Divergence operator defined in index space using various first derivative schemes
template<DScheme DiffScheme>
struct ISDivergence
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const Accessor& grid, const Coord& ijk)
{
return D1Vec<DiffScheme>::inX(grid, ijk, 0) +
D1Vec<DiffScheme>::inY(grid, ijk, 1) +
D1Vec<DiffScheme>::inZ(grid, ijk, 2);
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const StencilT& stencil)
{
return D1Vec<DiffScheme>::inX(stencil, 0) +
D1Vec<DiffScheme>::inY(stencil, 1) +
D1Vec<DiffScheme>::inZ(stencil, 2);
}
};
//@}
//@{
/// Curl operator defined in index space using various first derivative schemes
template<DScheme DiffScheme>
struct ISCurl
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const Accessor& grid, const Coord& ijk)
{
using Vec3Type = typename Accessor::ValueType;
return Vec3Type( D1Vec<DiffScheme>::inY(grid, ijk, 2) - //dw/dy - dv/dz
D1Vec<DiffScheme>::inZ(grid, ijk, 1),
D1Vec<DiffScheme>::inZ(grid, ijk, 0) - //du/dz - dw/dx
D1Vec<DiffScheme>::inX(grid, ijk, 2),
D1Vec<DiffScheme>::inX(grid, ijk, 1) - //dv/dx - du/dy
D1Vec<DiffScheme>::inY(grid, ijk, 0) );
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const StencilT& stencil)
{
using Vec3Type = typename StencilT::ValueType;
return Vec3Type( D1Vec<DiffScheme>::inY(stencil, 2) - //dw/dy - dv/dz
D1Vec<DiffScheme>::inZ(stencil, 1),
D1Vec<DiffScheme>::inZ(stencil, 0) - //du/dz - dw/dx
D1Vec<DiffScheme>::inX(stencil, 2),
D1Vec<DiffScheme>::inX(stencil, 1) - //dv/dx - du/dy
D1Vec<DiffScheme>::inY(stencil, 0) );
}
};
//@}
//@{
/// Compute the mean curvature in index space
template<DDScheme DiffScheme2, DScheme DiffScheme1>
struct ISMeanCurvature
{
/// @brief Random access version
/// @return @c true if the gradient is nonzero, in which case the mean curvature
/// is returned in two parts, @a alpha and @a beta, where @a alpha is the numerator
/// in &nabla; &middot; (&nabla;&Phi; / |&nabla;&Phi;|) and @a beta is |&nabla;&Phi;|.
template<typename Accessor>
static bool result(const Accessor& grid, const Coord& ijk,
typename Accessor::ValueType& alpha,
typename Accessor::ValueType& beta)
{
using ValueType = typename Accessor::ValueType;
const ValueType Dx = D1<DiffScheme1>::inX(grid, ijk);
const ValueType Dy = D1<DiffScheme1>::inY(grid, ijk);
const ValueType Dz = D1<DiffScheme1>::inZ(grid, ijk);
const ValueType Dx2 = Dx*Dx;
const ValueType Dy2 = Dy*Dy;
const ValueType Dz2 = Dz*Dz;
const ValueType normGrad = Dx2 + Dy2 + Dz2;
if (normGrad <= math::Tolerance<ValueType>::value()) {
alpha = beta = 0;
return false;
}
const ValueType Dxx = D2<DiffScheme2>::inX(grid, ijk);
const ValueType Dyy = D2<DiffScheme2>::inY(grid, ijk);
const ValueType Dzz = D2<DiffScheme2>::inZ(grid, ijk);
const ValueType Dxy = D2<DiffScheme2>::inXandY(grid, ijk);
const ValueType Dyz = D2<DiffScheme2>::inYandZ(grid, ijk);
const ValueType Dxz = D2<DiffScheme2>::inXandZ(grid, ijk);
// for return
alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
beta = ValueType(std::sqrt(double(normGrad))); // * 1/dx
return true;
}
/// @brief Stencil access version
/// @return @c true if the gradient is nonzero, in which case the mean curvature
/// is returned in two parts, @a alpha and @a beta, where @a alpha is the numerator
/// in &nabla; &middot; (&nabla;&Phi; / |&nabla;&Phi;|) and @a beta is |&nabla;&Phi;|.
template<typename StencilT>
static bool result(const StencilT& stencil,
typename StencilT::ValueType& alpha,
typename StencilT::ValueType& beta)
{
using ValueType = typename StencilT::ValueType;
const ValueType Dx = D1<DiffScheme1>::inX(stencil);
const ValueType Dy = D1<DiffScheme1>::inY(stencil);
const ValueType Dz = D1<DiffScheme1>::inZ(stencil);
const ValueType Dx2 = Dx*Dx;
const ValueType Dy2 = Dy*Dy;
const ValueType Dz2 = Dz*Dz;
const ValueType normGrad = Dx2 + Dy2 + Dz2;
if (normGrad <= math::Tolerance<ValueType>::value()) {
alpha = beta = 0;
return false;
}
const ValueType Dxx = D2<DiffScheme2>::inX(stencil);
const ValueType Dyy = D2<DiffScheme2>::inY(stencil);
const ValueType Dzz = D2<DiffScheme2>::inZ(stencil);
const ValueType Dxy = D2<DiffScheme2>::inXandY(stencil);
const ValueType Dyz = D2<DiffScheme2>::inYandZ(stencil);
const ValueType Dxz = D2<DiffScheme2>::inXandZ(stencil);
// for return
alpha = (Dx2*(Dyy+Dzz)+Dy2*(Dxx+Dzz)+Dz2*(Dxx+Dyy)-2*(Dx*(Dy*Dxy+Dz*Dxz)+Dy*Dz*Dyz));
beta = ValueType(std::sqrt(double(normGrad))); // * 1/dx
return true;
}
};
////////////////////////////////////////////////////////
// --- Operators defined in the Range of a given map
//@{
/// @brief Center difference gradient operators, defined with respect to
/// the range-space of the @c map
/// @note This will need to be divided by two in the case of CD_2NDT
template<typename MapType, DScheme DiffScheme>
struct Gradient
{
// random access version
template<typename Accessor>
static typename internal::ReturnValue<Accessor>::Vec3Type
result(const MapType& map, const Accessor& grid, const Coord& ijk)
{
using Vec3Type = typename internal::ReturnValue<Accessor>::Vec3Type;
Vec3d iGradient( ISGradient<DiffScheme>::result(grid, ijk) );
return Vec3Type(map.applyIJT(iGradient, ijk.asVec3d()));
}
// stencil access version
template<typename StencilT>
static typename internal::ReturnValue<StencilT>::Vec3Type
result(const MapType& map, const StencilT& stencil)
{
using Vec3Type = typename internal::ReturnValue<StencilT>::Vec3Type;
Vec3d iGradient( ISGradient<DiffScheme>::result(stencil) );
return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
}
};
// Partial template specialization of Gradient
// translation, any order
template<DScheme DiffScheme>
struct Gradient<TranslationMap, DiffScheme>
{
// random access version
template<typename Accessor>
static typename internal::ReturnValue<Accessor>::Vec3Type
result(const TranslationMap&, const Accessor& grid, const Coord& ijk)
{
return ISGradient<DiffScheme>::result(grid, ijk);
}
// stencil access version
template<typename StencilT>
static typename internal::ReturnValue<StencilT>::Vec3Type
result(const TranslationMap&, const StencilT& stencil)
{
return ISGradient<DiffScheme>::result(stencil);
}
};
/// Full template specialization of Gradient
/// uniform scale, 2nd order
template<>
struct Gradient<UniformScaleMap, CD_2ND>
{
// random access version
template<typename Accessor>
static typename internal::ReturnValue<Accessor>::Vec3Type
result(const UniformScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename internal::ReturnValue<Accessor>::ValueType;
using Vec3Type = typename internal::ReturnValue<Accessor>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(grid, ijk) );
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return iGradient * inv2dx;
}
// stencil access version
template<typename StencilT>
static typename internal::ReturnValue<StencilT>::Vec3Type
result(const UniformScaleMap& map, const StencilT& stencil)
{
using ValueType = typename internal::ReturnValue<StencilT>::ValueType;
using Vec3Type = typename internal::ReturnValue<StencilT>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(stencil) );
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return iGradient * inv2dx;
}
};
/// Full template specialization of Gradient
/// uniform scale translate, 2nd order
template<>
struct Gradient<UniformScaleTranslateMap, CD_2ND>
{
// random access version
template<typename Accessor>
static typename internal::ReturnValue<Accessor>::Vec3Type
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename internal::ReturnValue<Accessor>::ValueType;
using Vec3Type = typename internal::ReturnValue<Accessor>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(grid, ijk) );
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return iGradient * inv2dx;
}
// stencil access version
template<typename StencilT>
static typename internal::ReturnValue<StencilT>::Vec3Type
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename internal::ReturnValue<StencilT>::ValueType;
using Vec3Type = typename internal::ReturnValue<StencilT>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(stencil) );
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return iGradient * inv2dx;
}
};
/// Full template specialization of Gradient
/// scale, 2nd order
template<>
struct Gradient<ScaleMap, CD_2ND>
{
// random access version
template<typename Accessor>
static typename internal::ReturnValue<Accessor>::Vec3Type
result(const ScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename internal::ReturnValue<Accessor>::ValueType;
using Vec3Type = typename internal::ReturnValue<Accessor>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(grid, ijk) );
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
const auto gradient0 = iGradient[0] * map.getInvTwiceScale()[0];
const auto gradient1 = iGradient[1] * map.getInvTwiceScale()[1];
const auto gradient2 = iGradient[2] * map.getInvTwiceScale()[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return Vec3Type(ValueType(gradient0),
ValueType(gradient1),
ValueType(gradient2));
}
// stencil access version
template<typename StencilT>
static typename internal::ReturnValue<StencilT>::Vec3Type
result(const ScaleMap& map, const StencilT& stencil)
{
using ValueType = typename internal::ReturnValue<StencilT>::ValueType;
using Vec3Type = typename internal::ReturnValue<StencilT>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(stencil) );
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
const auto gradient0 = iGradient[0] * map.getInvTwiceScale()[0];
const auto gradient1 = iGradient[1] * map.getInvTwiceScale()[1];
const auto gradient2 = iGradient[2] * map.getInvTwiceScale()[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return Vec3Type(ValueType(gradient0),
ValueType(gradient1),
ValueType(gradient2));
}
};
/// Full template specialization of Gradient
/// scale translate, 2nd order
template<>
struct Gradient<ScaleTranslateMap, CD_2ND>
{
// random access version
template<typename Accessor>
static typename internal::ReturnValue<Accessor>::Vec3Type
result(const ScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename internal::ReturnValue<Accessor>::ValueType;
using Vec3Type = typename internal::ReturnValue<Accessor>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(grid, ijk) );
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
const auto gradient0 = iGradient[0] * map.getInvTwiceScale()[0];
const auto gradient1 = iGradient[1] * map.getInvTwiceScale()[1];
const auto gradient2 = iGradient[2] * map.getInvTwiceScale()[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return Vec3Type(ValueType(gradient0),
ValueType(gradient1),
ValueType(gradient2));
}
// Stencil access version
template<typename StencilT>
static typename internal::ReturnValue<StencilT>::Vec3Type
result(const ScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename internal::ReturnValue<StencilT>::ValueType;
using Vec3Type = typename internal::ReturnValue<StencilT>::Vec3Type;
Vec3Type iGradient( ISGradient<CD_2NDT>::result(stencil) );
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
const auto gradient0 = iGradient[0] * map.getInvTwiceScale()[0];
const auto gradient1 = iGradient[1] * map.getInvTwiceScale()[1];
const auto gradient2 = iGradient[2] * map.getInvTwiceScale()[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return Vec3Type(ValueType(gradient0),
ValueType(gradient1),
ValueType(gradient2));
}
};
//@}
//@{
/// @brief Biased gradient operators, defined with respect to the range-space of the map
/// @note This will need to be divided by two in the case of CD_2NDT
template<typename MapType, BiasedGradientScheme GradScheme>
struct GradientBiased
{
// random access version
template<typename Accessor> static math::Vec3<typename Accessor::ValueType>
result(const MapType& map, const Accessor& grid, const Coord& ijk,
const Vec3<typename Accessor::ValueType>& V)
{
using ValueType = typename Accessor::ValueType;
using Vec3Type = math::Vec3<ValueType>;
Vec3d iGradient( ISGradientBiased<GradScheme, Vec3Type>::result(grid, ijk, V) );
return Vec3Type(map.applyIJT(iGradient, ijk.asVec3d()));
}
// stencil access version
template<typename StencilT> static math::Vec3<typename StencilT::ValueType>
result(const MapType& map, const StencilT& stencil,
const Vec3<typename StencilT::ValueType>& V)
{
using ValueType = typename StencilT::ValueType;
using Vec3Type = math::Vec3<ValueType>;
Vec3d iGradient( ISGradientBiased<GradScheme, Vec3Type>::result(stencil, V) );
return Vec3Type(map.applyIJT(iGradient, stencil.getCenterCoord().asVec3d()));
}
};
//@}
////////////////////////////////////////////////////////
// Computes |Grad[Phi]| using upwinding
template<typename MapType, BiasedGradientScheme GradScheme>
struct GradientNormSqrd
{
static const DScheme FD = BIAS_SCHEME<GradScheme>::FD;
static const DScheme BD = BIAS_SCHEME<GradScheme>::BD;
// random access version
template<typename Accessor>
static typename Accessor::ValueType
result(const MapType& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
using Vec3Type = math::Vec3<ValueType>;
Vec3Type up = Gradient<MapType, FD>::result(map, grid, ijk);
Vec3Type down = Gradient<MapType, BD>::result(map, grid, ijk);
return math::GodunovsNormSqrd(grid.getValue(ijk)>0, down, up);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType
result(const MapType& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
using Vec3Type = math::Vec3<ValueType>;
Vec3Type up = Gradient<MapType, FD>::result(map, stencil);
Vec3Type down = Gradient<MapType, BD>::result(map, stencil);
return math::GodunovsNormSqrd(stencil.template getValue<0, 0, 0>()>0, down, up);
}
};
/// Partial template specialization of GradientNormSqrd
template<BiasedGradientScheme GradScheme>
struct GradientNormSqrd<UniformScaleMap, GradScheme>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType
result(const UniformScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return invdxdx * ISGradientNormSqrd<GradScheme>::result(grid, ijk);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType
result(const UniformScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return invdxdx * ISGradientNormSqrd<GradScheme>::result(stencil);
}
};
/// Partial template specialization of GradientNormSqrd
template<BiasedGradientScheme GradScheme>
struct GradientNormSqrd<UniformScaleTranslateMap, GradScheme>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return invdxdx * ISGradientNormSqrd<GradScheme>::result(grid, ijk);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return invdxdx * ISGradientNormSqrd<GradScheme>::result(stencil);
}
};
//@{
/// @brief 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.
template<typename MapType, DScheme DiffScheme>
struct Divergence
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const MapType& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div(0);
for (int i=0; i < 3; i++) {
Vec3d vec( D1Vec<DiffScheme>::inX(grid, ijk, i),
D1Vec<DiffScheme>::inY(grid, ijk, i),
D1Vec<DiffScheme>::inZ(grid, ijk, i) );
div += ValueType(map.applyIJT(vec, ijk.asVec3d())[i]);
}
return div;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const MapType& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
for (int i=0; i < 3; i++) {
Vec3d vec( D1Vec<DiffScheme>::inX(stencil, i),
D1Vec<DiffScheme>::inY(stencil, i),
D1Vec<DiffScheme>::inZ(stencil, i) );
div += ValueType(map.applyIJT(vec, stencil.getCenterCoord().asVec3d())[i]);
}
return div;
}
};
/// Partial template specialization of Divergence
/// translation, any scheme
template<DScheme DiffScheme>
struct Divergence<TranslationMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const TranslationMap&, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div(0);
div =ISDivergence<DiffScheme>::result(grid, ijk);
return div;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const TranslationMap&, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
div =ISDivergence<DiffScheme>::result(stencil);
return div;
}
};
/// Partial template specialization of Divergence
/// uniform scale, any scheme
template<DScheme DiffScheme>
struct Divergence<UniformScaleMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const UniformScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div(0);
div =ISDivergence<DiffScheme>::result(grid, ijk);
ValueType invdx = ValueType(map.getInvScale()[0]);
return div * invdx;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const UniformScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
div =ISDivergence<DiffScheme>::result(stencil);
ValueType invdx = ValueType(map.getInvScale()[0]);
return div * invdx;
}
};
/// Partial template specialization of Divergence
/// uniform scale and translation, any scheme
template<DScheme DiffScheme>
struct Divergence<UniformScaleTranslateMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div(0);
div =ISDivergence<DiffScheme>::result(grid, ijk);
ValueType invdx = ValueType(map.getInvScale()[0]);
return div * invdx;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
div =ISDivergence<DiffScheme>::result(stencil);
ValueType invdx = ValueType(map.getInvScale()[0]);
return div * invdx;
}
};
/// Full template specialization of Divergence
/// uniform scale 2nd order
template<>
struct Divergence<UniformScaleMap, CD_2ND>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const UniformScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div(0);
div =ISDivergence<CD_2NDT>::result(grid, ijk);
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return div * inv2dx;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const UniformScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
div =ISDivergence<CD_2NDT>::result(stencil);
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return div * inv2dx;
}
};
/// Full template specialization of Divergence
/// uniform scale translate 2nd order
template<>
struct Divergence<UniformScaleTranslateMap, CD_2ND>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div(0);
div =ISDivergence<CD_2NDT>::result(grid, ijk);
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return div * inv2dx;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
div =ISDivergence<CD_2NDT>::result(stencil);
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return div * inv2dx;
}
};
/// Partial template specialization of Divergence
/// scale, any scheme
template<DScheme DiffScheme>
struct Divergence<ScaleMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const ScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div = ValueType(
D1Vec<DiffScheme>::inX(grid, ijk, 0) * (map.getInvScale()[0]) +
D1Vec<DiffScheme>::inY(grid, ijk, 1) * (map.getInvScale()[1]) +
D1Vec<DiffScheme>::inZ(grid, ijk, 2) * (map.getInvScale()[2]));
return div;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const ScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
div = ValueType(
D1Vec<DiffScheme>::inX(stencil, 0) * (map.getInvScale()[0]) +
D1Vec<DiffScheme>::inY(stencil, 1) * (map.getInvScale()[1]) +
D1Vec<DiffScheme>::inZ(stencil, 2) * (map.getInvScale()[2]) );
return div;
}
};
/// Partial template specialization of Divergence
/// scale translate, any scheme
template<DScheme DiffScheme>
struct Divergence<ScaleTranslateMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const ScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div = ValueType(
D1Vec<DiffScheme>::inX(grid, ijk, 0) * (map.getInvScale()[0]) +
D1Vec<DiffScheme>::inY(grid, ijk, 1) * (map.getInvScale()[1]) +
D1Vec<DiffScheme>::inZ(grid, ijk, 2) * (map.getInvScale()[2]));
return div;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const ScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div(0);
div = ValueType(
D1Vec<DiffScheme>::inX(stencil, 0) * (map.getInvScale()[0]) +
D1Vec<DiffScheme>::inY(stencil, 1) * (map.getInvScale()[1]) +
D1Vec<DiffScheme>::inZ(stencil, 2) * (map.getInvScale()[2]) );
return div;
}
};
/// Full template specialization Divergence
/// scale 2nd order
template<>
struct Divergence<ScaleMap, CD_2ND>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const ScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div = ValueType(
D1Vec<CD_2NDT>::inX(grid, ijk, 0) * (map.getInvTwiceScale()[0]) +
D1Vec<CD_2NDT>::inY(grid, ijk, 1) * (map.getInvTwiceScale()[1]) +
D1Vec<CD_2NDT>::inZ(grid, ijk, 2) * (map.getInvTwiceScale()[2]) );
return div;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const ScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div = ValueType(
D1Vec<CD_2NDT>::inX(stencil, 0) * (map.getInvTwiceScale()[0]) +
D1Vec<CD_2NDT>::inY(stencil, 1) * (map.getInvTwiceScale()[1]) +
D1Vec<CD_2NDT>::inZ(stencil, 2) * (map.getInvTwiceScale()[2]) );
return div;
}
};
/// Full template specialization of Divergence
/// scale and translate, 2nd order
template<>
struct Divergence<ScaleTranslateMap, CD_2ND>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType::value_type
result(const ScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType::value_type;
ValueType div = ValueType(
D1Vec<CD_2NDT>::inX(grid, ijk, 0) * (map.getInvTwiceScale()[0]) +
D1Vec<CD_2NDT>::inY(grid, ijk, 1) * (map.getInvTwiceScale()[1]) +
D1Vec<CD_2NDT>::inZ(grid, ijk, 2) * (map.getInvTwiceScale()[2]) );
return div;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType::value_type
result(const ScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType::value_type;
ValueType div = ValueType(
D1Vec<CD_2NDT>::inX(stencil, 0) * (map.getInvTwiceScale()[0]) +
D1Vec<CD_2NDT>::inY(stencil, 1) * (map.getInvTwiceScale()[1]) +
D1Vec<CD_2NDT>::inZ(stencil, 2) * (map.getInvTwiceScale()[2]) );
return div;
}
};
//@}
//@{
/// @brief Compute the curl of a vector-valued grid using differencing
/// of various orders in the space defined by the range of the map.
template<typename MapType, DScheme DiffScheme>
struct Curl
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const MapType& map, const Accessor& grid, const Coord& ijk)
{
using Vec3Type = typename Accessor::ValueType;
Vec3Type mat[3];
for (int i = 0; i < 3; i++) {
Vec3d vec(
D1Vec<DiffScheme>::inX(grid, ijk, i),
D1Vec<DiffScheme>::inY(grid, ijk, i),
D1Vec<DiffScheme>::inZ(grid, ijk, i));
// dF_i/dx_j (x_1 = x, x_2 = y, x_3 = z)
mat[i] = Vec3Type(map.applyIJT(vec, ijk.asVec3d()));
}
return Vec3Type(mat[2][1] - mat[1][2], // dF_3/dx_2 - dF_2/dx_3
mat[0][2] - mat[2][0], // dF_1/dx_3 - dF_3/dx_1
mat[1][0] - mat[0][1]); // dF_2/dx_1 - dF_1/dx_2
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const MapType& map, const StencilT& stencil)
{
using Vec3Type = typename StencilT::ValueType;
Vec3Type mat[3];
for (int i = 0; i < 3; i++) {
Vec3d vec(
D1Vec<DiffScheme>::inX(stencil, i),
D1Vec<DiffScheme>::inY(stencil, i),
D1Vec<DiffScheme>::inZ(stencil, i));
// dF_i/dx_j (x_1 = x, x_2 = y, x_3 = z)
mat[i] = Vec3Type(map.applyIJT(vec, stencil.getCenterCoord().asVec3d()));
}
return Vec3Type(mat[2][1] - mat[1][2], // dF_3/dx_2 - dF_2/dx_3
mat[0][2] - mat[2][0], // dF_1/dx_3 - dF_3/dx_1
mat[1][0] - mat[0][1]); // dF_2/dx_1 - dF_1/dx_2
}
};
/// Partial template specialization of Curl
template<DScheme DiffScheme>
struct Curl<UniformScaleMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const UniformScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using Vec3Type = typename Accessor::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<DiffScheme>::result(grid, ijk) * ValueType(map.getInvScale()[0]);
}
// Stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const UniformScaleMap& map, const StencilT& stencil)
{
using Vec3Type = typename StencilT::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<DiffScheme>::result(stencil) * ValueType(map.getInvScale()[0]);
}
};
/// Partial template specialization of Curl
template<DScheme DiffScheme>
struct Curl<UniformScaleTranslateMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using Vec3Type = typename Accessor::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<DiffScheme>::result(grid, ijk) * ValueType(map.getInvScale()[0]);
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using Vec3Type = typename StencilT::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<DiffScheme>::result(stencil) * ValueType(map.getInvScale()[0]);
}
};
/// Full template specialization of Curl
template<>
struct Curl<UniformScaleMap, CD_2ND>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const UniformScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using Vec3Type = typename Accessor::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<CD_2NDT>::result(grid, ijk) * ValueType(map.getInvTwiceScale()[0]);
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const UniformScaleMap& map, const StencilT& stencil)
{
using Vec3Type = typename StencilT::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<CD_2NDT>::result(stencil) * ValueType(map.getInvTwiceScale()[0]);
}
};
/// Full template specialization of Curl
template<>
struct Curl<UniformScaleTranslateMap, CD_2ND>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using Vec3Type = typename Accessor::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<CD_2NDT>::result(grid, ijk) * ValueType(map.getInvTwiceScale()[0]);
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using Vec3Type = typename StencilT::ValueType;
using ValueType = typename Vec3Type::value_type;
return ISCurl<CD_2NDT>::result(stencil) * ValueType(map.getInvTwiceScale()[0]);
}
};
//@}
//@{
/// @brief Compute the Laplacian at a given location in a grid using finite differencing
/// of various orders. The result is defined in the range of the map.
template<typename MapType, DDScheme DiffScheme>
struct Laplacian
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const MapType& map,
const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
// all the second derivatives in index space
ValueType iddx = D2<DiffScheme>::inX(grid, ijk);
ValueType iddy = D2<DiffScheme>::inY(grid, ijk);
ValueType iddz = D2<DiffScheme>::inZ(grid, ijk);
ValueType iddxy = D2<DiffScheme>::inXandY(grid, ijk);
ValueType iddyz = D2<DiffScheme>::inYandZ(grid, ijk);
ValueType iddxz = D2<DiffScheme>::inXandZ(grid, ijk);
// second derivatives in index space
Mat3d d2_is(iddx, iddxy, iddxz,
iddxy, iddy, iddyz,
iddxz, iddyz, iddz);
Mat3d d2_rs; // to hold the second derivative matrix in range space
if (is_linear<MapType>::value) {
d2_rs = map.applyIJC(d2_is);
} else {
// compute the first derivatives with 2nd order accuracy.
Vec3d d1_is(static_cast<double>(D1<CD_2ND>::inX(grid, ijk)),
static_cast<double>(D1<CD_2ND>::inY(grid, ijk)),
static_cast<double>(D1<CD_2ND>::inZ(grid, ijk)));
d2_rs = map.applyIJC(d2_is, d1_is, ijk.asVec3d());
}
// the trace of the second derivative (range space) matrix is laplacian
return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const MapType& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
// all the second derivatives in index space
ValueType iddx = D2<DiffScheme>::inX(stencil);
ValueType iddy = D2<DiffScheme>::inY(stencil);
ValueType iddz = D2<DiffScheme>::inZ(stencil);
ValueType iddxy = D2<DiffScheme>::inXandY(stencil);
ValueType iddyz = D2<DiffScheme>::inYandZ(stencil);
ValueType iddxz = D2<DiffScheme>::inXandZ(stencil);
// second derivatives in index space
Mat3d d2_is(iddx, iddxy, iddxz,
iddxy, iddy, iddyz,
iddxz, iddyz, iddz);
Mat3d d2_rs; // to hold the second derivative matrix in range space
if (is_linear<MapType>::value) {
d2_rs = map.applyIJC(d2_is);
} else {
// compute the first derivatives with 2nd order accuracy.
Vec3d d1_is(D1<CD_2ND>::inX(stencil),
D1<CD_2ND>::inY(stencil),
D1<CD_2ND>::inZ(stencil) );
d2_rs = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
}
// the trace of the second derivative (range space) matrix is laplacian
return ValueType(d2_rs(0,0) + d2_rs(1,1) + d2_rs(2,2));
}
};
template<DDScheme DiffScheme>
struct Laplacian<TranslationMap, DiffScheme>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const TranslationMap&,
const Accessor& grid, const Coord& ijk)
{
return ISLaplacian<DiffScheme>::result(grid, ijk);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const TranslationMap&, const StencilT& stencil)
{
return ISLaplacian<DiffScheme>::result(stencil);
}
};
// The Laplacian is invariant to rotation or reflection.
template<DDScheme DiffScheme>
struct Laplacian<UnitaryMap, DiffScheme>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const UnitaryMap&,
const Accessor& grid, const Coord& ijk)
{
return ISLaplacian<DiffScheme>::result(grid, ijk);
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const UnitaryMap&, const StencilT& stencil)
{
return ISLaplacian<DiffScheme>::result(stencil);
}
};
template<DDScheme DiffScheme>
struct Laplacian<UniformScaleMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const UniformScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ISLaplacian<DiffScheme>::result(grid, ijk) * invdxdx;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const UniformScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ISLaplacian<DiffScheme>::result(stencil) * invdxdx;
}
};
template<DDScheme DiffScheme>
struct Laplacian<UniformScaleTranslateMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ISLaplacian<DiffScheme>::result(grid, ijk) * invdxdx;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ISLaplacian<DiffScheme>::result(stencil) * invdxdx;
}
};
template<DDScheme DiffScheme>
struct Laplacian<ScaleMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const ScaleMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
// compute the second derivatives in index space
ValueType iddx = D2<DiffScheme>::inX(grid, ijk);
ValueType iddy = D2<DiffScheme>::inY(grid, ijk);
ValueType iddz = D2<DiffScheme>::inZ(grid, ijk);
const Vec3d& invScaleSqr = map.getInvScaleSqr();
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
// scale them by the appropriate 1/dx^2, 1/dy^2, 1/dz^2 and sum
const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return value;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const ScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
// compute the second derivatives in index space
ValueType iddx = D2<DiffScheme>::inX(stencil);
ValueType iddy = D2<DiffScheme>::inY(stencil);
ValueType iddz = D2<DiffScheme>::inZ(stencil);
const Vec3d& invScaleSqr = map.getInvScaleSqr();
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
// scale them by the appropriate 1/dx^2, 1/dy^2, 1/dz^2 and sum
const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return value;
}
};
template<DDScheme DiffScheme>
struct Laplacian<ScaleTranslateMap, DiffScheme>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const ScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
// compute the second derivatives in index space
ValueType iddx = D2<DiffScheme>::inX(grid, ijk);
ValueType iddy = D2<DiffScheme>::inY(grid, ijk);
ValueType iddz = D2<DiffScheme>::inZ(grid, ijk);
const Vec3d& invScaleSqr = map.getInvScaleSqr();
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
// scale them by the appropriate 1/dx^2, 1/dy^2, 1/dz^2 and sum
const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return value;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const ScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
// compute the second derivatives in index space
ValueType iddx = D2<DiffScheme>::inX(stencil);
ValueType iddy = D2<DiffScheme>::inY(stencil);
ValueType iddz = D2<DiffScheme>::inZ(stencil);
const Vec3d& invScaleSqr = map.getInvScaleSqr();
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
// scale them by the appropriate 1/dx^2, 1/dy^2, 1/dz^2 and sum
const ValueType value = iddx * invScaleSqr[0] + iddy * invScaleSqr[1] + iddz * invScaleSqr[2];
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
return value;
}
};
/// @brief Compute the closest-point transform to a level set.
/// @return the closest point to the surface from which the level set was derived,
/// in the domain space of the map (e.g., voxel space).
template<typename MapType, DScheme DiffScheme>
struct CPT
{
// random access version
template<typename Accessor> static math::Vec3<typename Accessor::ValueType>
result(const MapType& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
using Vec3Type = Vec3<ValueType>;
// current distance
ValueType d = grid.getValue(ijk);
// compute gradient in physical space where it is a unit normal
// since the grid holds a distance level set.
Vec3d vectorFromSurface(d*Gradient<MapType,DiffScheme>::result(map, grid, ijk));
if (is_linear<MapType>::value) {
Vec3d result = ijk.asVec3d() - map.applyInverseMap(vectorFromSurface);
return Vec3Type(result);
} else {
Vec3d location = map.applyMap(ijk.asVec3d());
Vec3d result = map.applyInverseMap(location - vectorFromSurface);
return Vec3Type(result);
}
}
// stencil access version
template<typename StencilT> static math::Vec3<typename StencilT::ValueType>
result(const MapType& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
using Vec3Type = Vec3<ValueType>;
// current distance
ValueType d = stencil.template getValue<0, 0, 0>();
// compute gradient in physical space where it is a unit normal
// since the grid holds a distance level set.
Vec3d vectorFromSurface(d*Gradient<MapType, DiffScheme>::result(map, stencil));
if (is_linear<MapType>::value) {
Vec3d result = stencil.getCenterCoord().asVec3d()
- map.applyInverseMap(vectorFromSurface);
return Vec3Type(result);
} else {
Vec3d location = map.applyMap(stencil.getCenterCoord().asVec3d());
Vec3d result = map.applyInverseMap(location - vectorFromSurface);
return Vec3Type(result);
}
}
};
/// @brief Compute the closest-point transform to a level set.
/// @return the closest point to the surface from which the level set was derived,
/// in the range space of the map (e.g., in world space)
template<typename MapType, DScheme DiffScheme>
struct CPT_RANGE
{
// random access version
template<typename Accessor> static Vec3<typename Accessor::ValueType>
result(const MapType& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
using Vec3Type = Vec3<ValueType>;
// current distance
ValueType d = grid.getValue(ijk);
// compute gradient in physical space where it is a unit normal
// since the grid holds a distance level set.
Vec3Type vectorFromSurface =
d*Gradient<MapType,DiffScheme>::result(map, grid, ijk);
Vec3d result = map.applyMap(ijk.asVec3d()) - vectorFromSurface;
return Vec3Type(result);
}
// stencil access version
template<typename StencilT> static Vec3<typename StencilT::ValueType>
result(const MapType& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
using Vec3Type = Vec3<ValueType>;
// current distance
ValueType d = stencil.template getValue<0, 0, 0>();
// compute gradient in physical space where it is a unit normal
// since the grid holds a distance level set.
Vec3Type vectorFromSurface =
d*Gradient<MapType, DiffScheme>::result(map, stencil);
Vec3d result = map.applyMap(stencil.getCenterCoord().asVec3d()) - vectorFromSurface;
return Vec3Type(result);
}
};
/// @brief Compute the mean curvature.
/// @details The mean curvature is returned in two parts, @a alpha and @a beta,
/// where @a alpha is the numerator in &nabla; &middot; (&nabla;&Phi; / |&nabla;&Phi;|)
/// and @a beta is |&nabla;&Phi;|.
template<typename MapType, DDScheme DiffScheme2, DScheme DiffScheme1>
struct MeanCurvature
{
/// @brief Random access version
/// @return @c true if the gradient is nonzero, in which case the mean curvature
/// is returned in two parts, @a alpha and @a beta, where @a alpha is the numerator
/// in &nabla; &middot; (&nabla;&Phi; / |&nabla;&Phi;|) and @a beta is |&nabla;&Phi;|.
template<typename Accessor>
static bool compute(const MapType& map, const Accessor& grid, const Coord& ijk,
double& alpha, double& beta)
{
using ValueType = typename Accessor::ValueType;
// compute the gradient in index and world space
Vec3d d1_is(static_cast<double>(D1<DiffScheme1>::inX(grid, ijk)),
static_cast<double>(D1<DiffScheme1>::inY(grid, ijk)),
static_cast<double>(D1<DiffScheme1>::inZ(grid, ijk))), d1_ws;
if (is_linear<MapType>::value) {//resolved at compiletime
d1_ws = map.applyIJT(d1_is);
} else {
d1_ws = map.applyIJT(d1_is, ijk.asVec3d());
}
const double Dx2 = d1_ws(0)*d1_ws(0);
const double Dy2 = d1_ws(1)*d1_ws(1);
const double Dz2 = d1_ws(2)*d1_ws(2);
const double normGrad = Dx2 + Dy2 + Dz2;
if (normGrad <= math::Tolerance<double>::value()) {
alpha = beta = 0;
return false;
}
// all the second derivatives in index space
ValueType iddx = D2<DiffScheme2>::inX(grid, ijk);
ValueType iddy = D2<DiffScheme2>::inY(grid, ijk);
ValueType iddz = D2<DiffScheme2>::inZ(grid, ijk);
ValueType iddxy = D2<DiffScheme2>::inXandY(grid, ijk);
ValueType iddyz = D2<DiffScheme2>::inYandZ(grid, ijk);
ValueType iddxz = D2<DiffScheme2>::inXandZ(grid, ijk);
// second derivatives in index space
Mat3d d2_is(iddx, iddxy, iddxz,
iddxy, iddy, iddyz,
iddxz, iddyz, iddz);
// convert second derivatives to world space
Mat3d d2_ws;
if (is_linear<MapType>::value) {//resolved at compiletime
d2_ws = map.applyIJC(d2_is);
} else {
d2_ws = map.applyIJC(d2_is, d1_is, ijk.asVec3d());
}
// assemble the nominator and denominator for mean curvature
alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
+Dz2*(d2_ws(0,0)+d2_ws(1,1))
-2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
+d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
beta = std::sqrt(normGrad); // * 1/dx
return true;
}
template<typename Accessor>
static typename Accessor::ValueType result(const MapType& map,
const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
double alpha, beta;
return compute(map, grid, ijk, alpha, beta) ?
ValueType(alpha/(2. *math::Pow3(beta))) : 0;
}
template<typename Accessor>
static typename Accessor::ValueType normGrad(const MapType& map,
const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
double alpha, beta;
return compute(map, grid, ijk, alpha, beta) ?
ValueType(alpha/(2. *math::Pow2(beta))) : 0;
}
/// @brief Stencil access version
/// @return @c true if the gradient is nonzero, in which case the mean curvature
/// is returned in two parts, @a alpha and @a beta, where @a alpha is the numerator
/// in &nabla; &middot; (&nabla;&Phi; / |&nabla;&Phi;|) and @a beta is |&nabla;&Phi;|.
template<typename StencilT>
static bool compute(const MapType& map, const StencilT& stencil,
double& alpha, double& beta)
{
using ValueType = typename StencilT::ValueType;
// compute the gradient in index and world space
Vec3d d1_is(D1<DiffScheme1>::inX(stencil),
D1<DiffScheme1>::inY(stencil),
D1<DiffScheme1>::inZ(stencil) ), d1_ws;
if (is_linear<MapType>::value) {//resolved at compiletime
d1_ws = map.applyIJT(d1_is);
} else {
d1_ws = map.applyIJT(d1_is, stencil.getCenterCoord().asVec3d());
}
const double Dx2 = d1_ws(0)*d1_ws(0);
const double Dy2 = d1_ws(1)*d1_ws(1);
const double Dz2 = d1_ws(2)*d1_ws(2);
const double normGrad = Dx2 + Dy2 + Dz2;
if (normGrad <= math::Tolerance<double>::value()) {
alpha = beta = 0;
return false;
}
// all the second derivatives in index space
ValueType iddx = D2<DiffScheme2>::inX(stencil);
ValueType iddy = D2<DiffScheme2>::inY(stencil);
ValueType iddz = D2<DiffScheme2>::inZ(stencil);
ValueType iddxy = D2<DiffScheme2>::inXandY(stencil);
ValueType iddyz = D2<DiffScheme2>::inYandZ(stencil);
ValueType iddxz = D2<DiffScheme2>::inXandZ(stencil);
// second derivatives in index space
Mat3d d2_is(iddx, iddxy, iddxz,
iddxy, iddy, iddyz,
iddxz, iddyz, iddz);
// convert second derivatives to world space
Mat3d d2_ws;
if (is_linear<MapType>::value) {//resolved at compiletime
d2_ws = map.applyIJC(d2_is);
} else {
d2_ws = map.applyIJC(d2_is, d1_is, stencil.getCenterCoord().asVec3d());
}
// for return
alpha = (Dx2*(d2_ws(1,1)+d2_ws(2,2))+Dy2*(d2_ws(0,0)+d2_ws(2,2))
+Dz2*(d2_ws(0,0)+d2_ws(1,1))
-2*(d1_ws(0)*(d1_ws(1)*d2_ws(0,1)+d1_ws(2)*d2_ws(0,2))
+d1_ws(1)*d1_ws(2)*d2_ws(1,2)));
beta = std::sqrt(normGrad); // * 1/dx
return true;
}
template<typename StencilT>
static typename StencilT::ValueType
result(const MapType& map, const StencilT stencil)
{
using ValueType = typename StencilT::ValueType;
double alpha, beta;
return compute(map, stencil, alpha, beta) ?
ValueType(alpha/(2*math::Pow3(beta))) : 0;
}
template<typename StencilT>
static typename StencilT::ValueType normGrad(const MapType& map, const StencilT stencil)
{
using ValueType = typename StencilT::ValueType;
double alpha, beta;
return compute(map, stencil, alpha, beta) ?
ValueType(alpha/(2*math::Pow2(beta))) : 0;
}
};
template<DDScheme DiffScheme2, DScheme DiffScheme1>
struct MeanCurvature<TranslationMap, DiffScheme2, DiffScheme1>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const TranslationMap&,
const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType alpha, beta;
return ISMeanCurvature<DiffScheme2, DiffScheme1>::result(grid, ijk, alpha, beta) ?
ValueType(alpha /(2*math::Pow3(beta))) : 0;
}
template<typename Accessor>
static typename Accessor::ValueType normGrad(const TranslationMap&,
const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType alpha, beta;
return ISMeanCurvature<DiffScheme2, DiffScheme1>::result(grid, ijk, alpha, beta) ?
ValueType(alpha/(2*math::Pow2(beta))) : 0;
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const TranslationMap&, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType alpha, beta;
return ISMeanCurvature<DiffScheme2, DiffScheme1>::result(stencil, alpha, beta) ?
ValueType(alpha /(2*math::Pow3(beta))) : 0;
}
template<typename StencilT>
static typename StencilT::ValueType normGrad(const TranslationMap&, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType alpha, beta;
return ISMeanCurvature<DiffScheme2, DiffScheme1>::result(stencil, alpha, beta) ?
ValueType(alpha/(2*math::Pow2(beta))) : 0;
}
};
template<DDScheme DiffScheme2, DScheme DiffScheme1>
struct MeanCurvature<UniformScaleMap, DiffScheme2, DiffScheme1>
{
// random access version
template<typename Accessor>
static typename Accessor::ValueType result(const UniformScaleMap& map,
const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(grid, ijk, alpha, beta)) {
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return ValueType(alpha*inv2dx/math::Pow3(beta));
}
return 0;
}
template<typename Accessor>
static typename Accessor::ValueType normGrad(const UniformScaleMap& map,
const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(grid, ijk, alpha, beta)) {
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ValueType(alpha*invdxdx/(2*math::Pow2(beta)));
}
return 0;
}
// stencil access version
template<typename StencilT>
static typename StencilT::ValueType result(const UniformScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(stencil, alpha, beta)) {
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return ValueType(alpha*inv2dx/math::Pow3(beta));
}
return 0;
}
template<typename StencilT>
static typename StencilT::ValueType normGrad(const UniformScaleMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(stencil, alpha, beta)) {
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ValueType(alpha*invdxdx/(2*math::Pow2(beta)));
}
return 0;
}
};
template<DDScheme DiffScheme2, DScheme DiffScheme1>
struct MeanCurvature<UniformScaleTranslateMap, DiffScheme2, DiffScheme1>
{
// random access version
template<typename Accessor> static typename Accessor::ValueType
result(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(grid, ijk, alpha, beta)) {
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return ValueType(alpha*inv2dx/math::Pow3(beta));
}
return 0;
}
template<typename Accessor> static typename Accessor::ValueType
normGrad(const UniformScaleTranslateMap& map, const Accessor& grid, const Coord& ijk)
{
using ValueType = typename Accessor::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(grid, ijk, alpha, beta)) {
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ValueType(alpha*invdxdx/(2*math::Pow2(beta)));
}
return 0;
}
// stencil access version
template<typename StencilT> static typename StencilT::ValueType
result(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(stencil, alpha, beta)) {
ValueType inv2dx = ValueType(map.getInvTwiceScale()[0]);
return ValueType(alpha*inv2dx/math::Pow3(beta));
}
return 0;
}
template<typename StencilT> static typename StencilT::ValueType
normGrad(const UniformScaleTranslateMap& map, const StencilT& stencil)
{
using ValueType = typename StencilT::ValueType;
ValueType alpha, beta;
if (ISMeanCurvature<DiffScheme2, DiffScheme1>::result(stencil, alpha, beta)) {
ValueType invdxdx = ValueType(map.getInvScaleSqr()[0]);
return ValueType(alpha*invdxdx/(2*math::Pow2(beta)));
}
return 0;
}
};
/// @brief A wrapper that holds a MapBase::ConstPtr and exposes a reduced set
/// of functionality needed by the mathematical operators
/// @details This may be used in some <tt>Map</tt>-templated code, when the overhead of
/// actually resolving the @c Map type is large compared to the map work to be done.
class GenericMap
{
public:
template<typename GridType>
GenericMap(const GridType& g): mMap(g.transform().baseMap()) {}
GenericMap(const Transform& t): mMap(t.baseMap()) {}
GenericMap(MapBase::Ptr map): mMap(ConstPtrCast<const MapBase>(map)) {}
GenericMap(MapBase::ConstPtr map): mMap(map) {}
~GenericMap() {}
Vec3d applyMap(const Vec3d& in) const { return mMap->applyMap(in); }
Vec3d applyInverseMap(const Vec3d& in) const { return mMap->applyInverseMap(in); }
Vec3d applyIJT(const Vec3d& in) const { return mMap->applyIJT(in); }
Vec3d applyIJT(const Vec3d& in, const Vec3d& pos) const { return mMap->applyIJT(in, pos); }
Mat3d applyIJC(const Mat3d& m) const { return mMap->applyIJC(m); }
Mat3d applyIJC(const Mat3d& m, const Vec3d& v, const Vec3d& pos) const
{ return mMap->applyIJC(m,v,pos); }
double determinant() const { return mMap->determinant(); }
double determinant(const Vec3d& in) const { return mMap->determinant(in); }
Vec3d voxelSize() const { return mMap->voxelSize(); }
Vec3d voxelSize(const Vec3d&v) const { return mMap->voxelSize(v); }
private:
MapBase::ConstPtr mMap;
};
} // end math namespace
} // namespace OPENVDB_VERSION_NAME
} // end openvdb namespace
#endif // OPENVDB_MATH_OPERATORS_HAS_BEEN_INCLUDED
FiniteDifference.h
value
ValueT value
Definition GridBuilder.h:1290
Maps.h
OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
#define OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
Bracket code with OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN/_END, to inhibit warnings about type conve...
Definition Platform.h:204
OPENVDB_NO_TYPE_CONVERSION_WARNING_END
#define OPENVDB_NO_TYPE_CONVERSION_WARNING_END
Definition Platform.h:205
Transform.h
openvdb::v10_0::math::Coord
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:25
openvdb::v10_0::math::Coord::asVec3d
Vec3d asVec3d() const
Definition Coord.h:143
openvdb::v10_0::math::Coord::offsetBy
Coord offsetBy(Int32 dx, Int32 dy, Int32 dz) const
Definition Coord.h:91
openvdb::v10_0::math::GenericMap::determinant
double determinant(const Vec3d &in) const
Definition Operators.h:2116
openvdb::v10_0::math::GenericMap::voxelSize
Vec3d voxelSize() const
Definition Operators.h:2118
openvdb::v10_0::math::GenericMap::GenericMap
GenericMap(const GridType &g)
Definition Operators.h:2099
openvdb::v10_0::math::GenericMap::determinant
double determinant() const
Definition Operators.h:2115
openvdb::v10_0::math::GenericMap::applyMap
Vec3d applyMap(const Vec3d &in) const
Definition Operators.h:2106
openvdb::v10_0::math::GenericMap::GenericMap
GenericMap(MapBase::ConstPtr map)
Definition Operators.h:2103
openvdb::v10_0::math::GenericMap::applyInverseMap
Vec3d applyInverseMap(const Vec3d &in) const
Definition Operators.h:2107
openvdb::v10_0::math::GenericMap::GenericMap
GenericMap(const Transform &t)
Definition Operators.h:2101
openvdb::v10_0::math::GenericMap::applyIJC
Mat3d applyIJC(const Mat3d &m) const
Definition Operators.h:2111
openvdb::v10_0::math::GenericMap::applyIJT
Vec3d applyIJT(const Vec3d &in, const Vec3d &pos) const
Definition Operators.h:2110
openvdb::v10_0::math::GenericMap::voxelSize
Vec3d voxelSize(const Vec3d &v) const
Definition Operators.h:2119
openvdb::v10_0::math::GenericMap::applyIJT
Vec3d applyIJT(const Vec3d &in) const
Definition Operators.h:2109
openvdb::v10_0::math::GenericMap::GenericMap
GenericMap(MapBase::Ptr map)
Definition Operators.h:2102
openvdb::v10_0::math::GenericMap::~GenericMap
~GenericMap()
Definition Operators.h:2104
openvdb::v10_0::math::GenericMap::applyIJC
Mat3d applyIJC(const Mat3d &m, const Vec3d &v, const Vec3d &pos) const
Definition Operators.h:2112
openvdb::v10_0::math::MapBase
Abstract base class for maps.
Definition Maps.h:135
openvdb::v10_0::math::MapBase::Ptr
SharedPtr< MapBase > Ptr
Definition Maps.h:137
openvdb::v10_0::math::MapBase::ConstPtr
SharedPtr< const MapBase > ConstPtr
Definition Maps.h:138
openvdb::v10_0::math::NineteenPointStencil
Definition Stencils.h:823
openvdb::v10_0::math::ScaleMap
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition Maps.h:659
openvdb::v10_0::math::ScaleMap::getInvScale
const Vec3d & getInvScale() const
Return 1/(scale).
Definition Maps.h:805
openvdb::v10_0::math::ScaleMap::getInvTwiceScale
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition Maps.h:803
openvdb::v10_0::math::ScaleMap::getInvScaleSqr
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition Maps.h:801
openvdb::v10_0::math::ScaleTranslateMap
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition Maps.h:1166
openvdb::v10_0::math::ScaleTranslateMap::getInvScale
const Vec3d & getInvScale() const
Return 1/(scale).
Definition Maps.h:1350
openvdb::v10_0::math::ScaleTranslateMap::getInvTwiceScale
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition Maps.h:1348
openvdb::v10_0::math::ScaleTranslateMap::getInvScaleSqr
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition Maps.h:1346
openvdb::v10_0::math::SevenPointStencil
Definition Stencils.h:248
openvdb::v10_0::math::ThirteenPointStencil
Definition Stencils.h:553
openvdb::v10_0::math::Transform
Definition Transform.h:40
openvdb::v10_0::math::TranslationMap
A specialized linear transform that performs a translation.
Definition Maps.h:981
openvdb::v10_0::math::UniformScaleMap
A specialized Affine transform that scales along the principal axis the scaling is uniform in the thr...
Definition Maps.h:909
openvdb::v10_0::math::UniformScaleTranslateMap
A specialized Affine transform that uniformaly scales along the principal axis and then translates th...
Definition Maps.h:1482
openvdb::v10_0::math::UnitaryMap
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection.
Definition Maps.h:1624
openvdb::v10_0::math::Vec3
Definition Vec3.h:24
openvdb::v10_0::internal
Definition openvdb.h:114
openvdb::v10_0::math::Mat3d
Mat3< double > Mat3d
Definition Mat3.h:834
openvdb::v10_0::math::GodunovsNormSqrd
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
openvdb::v10_0::math::DScheme
DScheme
Different discrete schemes used in the first derivatives.
Definition FiniteDifference.h:32
openvdb::v10_0::math::FD_2ND
@ FD_2ND
Definition FiniteDifference.h:39
openvdb::v10_0::math::BD_3RD
@ BD_3RD
Definition FiniteDifference.h:43
openvdb::v10_0::math::FD_HJWENO5
@ FD_HJWENO5
Definition FiniteDifference.h:46
openvdb::v10_0::math::FD_WENO5
@ FD_WENO5
Definition FiniteDifference.h:44
openvdb::v10_0::math::BD_2ND
@ BD_2ND
Definition FiniteDifference.h:42
openvdb::v10_0::math::FD_1ST
@ FD_1ST
Definition FiniteDifference.h:38
openvdb::v10_0::math::BD_HJWENO5
@ BD_HJWENO5
Definition FiniteDifference.h:47
openvdb::v10_0::math::CD_2ND
@ CD_2ND
Definition FiniteDifference.h:35
openvdb::v10_0::math::BD_WENO5
@ BD_WENO5
Definition FiniteDifference.h:45
openvdb::v10_0::math::BD_1ST
@ BD_1ST
Definition FiniteDifference.h:41
openvdb::v10_0::math::FD_3RD
@ FD_3RD
Definition FiniteDifference.h:40
openvdb::v10_0::math::CD_SIXTH
@ CD_SIXTH
Definition FiniteDifference.h:154
openvdb::v10_0::math::CD_FOURTH
@ CD_FOURTH
Definition FiniteDifference.h:153
openvdb::v10_0::math::CD_SECOND
@ CD_SECOND
Definition FiniteDifference.h:152
openvdb::v10_0::math::Vec3d
Vec3< double > Vec3d
Definition Vec3.h:664
openvdb::v10_0::math::FIRST_BIAS
@ FIRST_BIAS
Definition FiniteDifference.h:167
openvdb::v10_0::math::THIRD_BIAS
@ THIRD_BIAS
Definition FiniteDifference.h:169
openvdb::v10_0::math::WENO5_BIAS
@ WENO5_BIAS
Definition FiniteDifference.h:170
openvdb::v10_0::math::SECOND_BIAS
@ SECOND_BIAS
Definition FiniteDifference.h:168
openvdb::v10_0::math::HJWENO5_BIAS
@ HJWENO5_BIAS
Definition FiniteDifference.h:171
openvdb::v10_0::math::Pow3
Type Pow3(Type x)
Return x3.
Definition Math.h:552
openvdb::v10_0::math::Pow2
Type Pow2(Type x)
Return x2.
Definition Math.h:548
openvdb::v10_0::ConstPtrCast
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:126
openvdb
Definition Exceptions.h:13
Stencils.h
Defines various finite difference stencils by means of the "curiously recurring template pattern" on ...
openvdb::v10_0::math::BIAS_SCHEME::ISStencil
Definition Operators.h:134
openvdb::v10_0::math::BIAS_SCHEME::ISStencil::StencilType
SevenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:135
openvdb::v10_0::math::BIAS_SCHEME< FIRST_BIAS >::ISStencil
Definition Operators.h:145
openvdb::v10_0::math::BIAS_SCHEME< FIRST_BIAS >::ISStencil::StencilType
SevenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:146
openvdb::v10_0::math::BIAS_SCHEME< FIRST_BIAS >::FD
static const DScheme FD
Definition Operators.h:141
openvdb::v10_0::math::BIAS_SCHEME< FIRST_BIAS >::BD
static const DScheme BD
Definition Operators.h:142
openvdb::v10_0::math::BIAS_SCHEME< HJWENO5_BIAS >::ISStencil
Definition Operators.h:186
openvdb::v10_0::math::BIAS_SCHEME< HJWENO5_BIAS >::ISStencil::StencilType
NineteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:187
openvdb::v10_0::math::BIAS_SCHEME< HJWENO5_BIAS >::FD
static const DScheme FD
Definition Operators.h:182
openvdb::v10_0::math::BIAS_SCHEME< HJWENO5_BIAS >::BD
static const DScheme BD
Definition Operators.h:183
openvdb::v10_0::math::BIAS_SCHEME< SECOND_BIAS >::ISStencil
Definition Operators.h:156
openvdb::v10_0::math::BIAS_SCHEME< SECOND_BIAS >::ISStencil::StencilType
ThirteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:157
openvdb::v10_0::math::BIAS_SCHEME< SECOND_BIAS >::FD
static const DScheme FD
Definition Operators.h:152
openvdb::v10_0::math::BIAS_SCHEME< SECOND_BIAS >::BD
static const DScheme BD
Definition Operators.h:153
openvdb::v10_0::math::BIAS_SCHEME< THIRD_BIAS >::ISStencil
Definition Operators.h:166
openvdb::v10_0::math::BIAS_SCHEME< THIRD_BIAS >::ISStencil::StencilType
NineteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:167
openvdb::v10_0::math::BIAS_SCHEME< THIRD_BIAS >::FD
static const DScheme FD
Definition Operators.h:162
openvdb::v10_0::math::BIAS_SCHEME< THIRD_BIAS >::BD
static const DScheme BD
Definition Operators.h:163
openvdb::v10_0::math::BIAS_SCHEME< WENO5_BIAS >::ISStencil
Definition Operators.h:176
openvdb::v10_0::math::BIAS_SCHEME< WENO5_BIAS >::ISStencil::StencilType
NineteenPointStencil< GridType, IsSafe > StencilType
Definition Operators.h:177
openvdb::v10_0::math::BIAS_SCHEME< WENO5_BIAS >::FD
static const DScheme FD
Definition Operators.h:172
openvdb::v10_0::math::BIAS_SCHEME< WENO5_BIAS >::BD
static const DScheme BD
Definition Operators.h:173
openvdb::v10_0::math::BIAS_SCHEME
Definition Operators.h:129
openvdb::v10_0::math::BIAS_SCHEME< SpatialScheme >::FD
static const DScheme FD
Definition Operators.h:130
openvdb::v10_0::math::BIAS_SCHEME< SpatialScheme >::BD
static const DScheme BD
Definition Operators.h:131
openvdb::v10_0::math::CPT_RANGE
Compute the closest-point transform to a level set.
Definition Operators.h:1719
openvdb::v10_0::math::CPT_RANGE::result
static Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1739
openvdb::v10_0::math::CPT_RANGE::result
static Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1722
openvdb::v10_0::math::CPT
Compute the closest-point transform to a level set.
Definition Operators.h:1666
openvdb::v10_0::math::CPT::result
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1691
openvdb::v10_0::math::CPT::result
static math::Vec3< typename Accessor::ValueType > result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1669
openvdb::v10_0::math::Curl< UniformScaleMap, CD_2ND >::result
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:1379
openvdb::v10_0::math::Curl< UniformScaleMap, CD_2ND >::result
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1369
openvdb::v10_0::math::Curl< UniformScaleMap, DiffScheme >::result
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:1330
openvdb::v10_0::math::Curl< UniformScaleMap, DiffScheme >::result
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1321
openvdb::v10_0::math::Curl< UniformScaleTranslateMap, CD_2ND >::result
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1404
openvdb::v10_0::math::Curl< UniformScaleTranslateMap, CD_2ND >::result
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1394
openvdb::v10_0::math::Curl< UniformScaleTranslateMap, DiffScheme >::result
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1354
openvdb::v10_0::math::Curl< UniformScaleTranslateMap, DiffScheme >::result
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1344
openvdb::v10_0::math::Curl
Compute the curl of a vector-valued grid using differencing of various orders in the space defined by...
Definition Operators.h:1275
openvdb::v10_0::math::Curl::result
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1297
openvdb::v10_0::math::Curl::result
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1278
openvdb::v10_0::math::D1Vec::inZ
static Accessor::ValueType::value_type inZ(const Accessor &grid, const Coord &ijk, int n)
Definition FiniteDifference.h:1505
openvdb::v10_0::math::D1Vec::inX
static Accessor::ValueType::value_type inX(const Accessor &grid, const Coord &ijk, int n)
Definition FiniteDifference.h:1492
openvdb::v10_0::math::D1Vec::inY
static Accessor::ValueType::value_type inY(const Accessor &grid, const Coord &ijk, int n)
Definition FiniteDifference.h:1499
openvdb::v10_0::math::D1::inX
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D1::inZ
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D1::inY
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D2::inX
static Accessor::ValueType inX(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D2::inZ
static Accessor::ValueType inZ(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D2::inXandZ
static Accessor::ValueType inXandZ(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D2::inYandZ
static Accessor::ValueType inYandZ(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D2::inXandY
static Accessor::ValueType inXandY(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::D2::inY
static Accessor::ValueType inY(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::Divergence< ScaleMap, CD_2ND >::result
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1211
openvdb::v10_0::math::Divergence< ScaleMap, CD_2ND >::result
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:1224
openvdb::v10_0::math::Divergence< ScaleMap, DiffScheme >::result
static Accessor::ValueType::value_type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1145
openvdb::v10_0::math::Divergence< ScaleMap, DiffScheme >::result
static StencilT::ValueType::value_type result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:1158
openvdb::v10_0::math::Divergence< ScaleTranslateMap, CD_2ND >::result
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1256
openvdb::v10_0::math::Divergence< ScaleTranslateMap, CD_2ND >::result
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1243
openvdb::v10_0::math::Divergence< ScaleTranslateMap, DiffScheme >::result
static StencilT::ValueType::value_type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1191
openvdb::v10_0::math::Divergence< ScaleTranslateMap, DiffScheme >::result
static Accessor::ValueType::value_type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1178
openvdb::v10_0::math::Divergence< TranslationMap, DiffScheme >::result
static StencilT::ValueType::value_type result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1002
openvdb::v10_0::math::Divergence< TranslationMap, DiffScheme >::result
static Accessor::ValueType::value_type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:991
openvdb::v10_0::math::Divergence< UniformScaleMap, CD_2ND >::result
static Accessor::ValueType::value_type result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1083
openvdb::v10_0::math::Divergence< UniformScaleMap, CD_2ND >::result
static StencilT::ValueType::value_type result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:1095
openvdb::v10_0::math::Divergence< UniformScaleMap, DiffScheme >::result
static Accessor::ValueType::value_type result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1019
openvdb::v10_0::math::Divergence< UniformScaleMap, DiffScheme >::result
static StencilT::ValueType::value_type result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:1032
openvdb::v10_0::math::Divergence< UniformScaleTranslateMap, CD_2ND >::result
static StencilT::ValueType::value_type result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1126
openvdb::v10_0::math::Divergence< UniformScaleTranslateMap, CD_2ND >::result
static Accessor::ValueType::value_type result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1113
openvdb::v10_0::math::Divergence< UniformScaleTranslateMap, DiffScheme >::result
static StencilT::ValueType::value_type result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1064
openvdb::v10_0::math::Divergence< UniformScaleTranslateMap, DiffScheme >::result
static Accessor::ValueType::value_type result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1051
openvdb::v10_0::math::Divergence
Compute the divergence of a vector-valued grid using differencing of various orders,...
Definition Operators.h:950
openvdb::v10_0::math::Divergence::result
static Accessor::ValueType::value_type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:953
openvdb::v10_0::math::Divergence::result
static StencilT::ValueType::value_type result(const MapType &map, const StencilT &stencil)
Definition Operators.h:969
openvdb::v10_0::math::GradientBiased
Biased gradient operators, defined with respect to the range-space of the map.
Definition Operators.h:825
openvdb::v10_0::math::GradientBiased::result
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:828
openvdb::v10_0::math::GradientBiased::result
static math::Vec3< typename StencilT::ValueType > result(const MapType &map, const StencilT &stencil, const Vec3< typename StencilT::ValueType > &V)
Definition Operators.h:840
openvdb::v10_0::math::GradientNormSqrd< UniformScaleMap, GradScheme >::result
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:908
openvdb::v10_0::math::GradientNormSqrd< UniformScaleMap, GradScheme >::result
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:897
openvdb::v10_0::math::GradientNormSqrd< UniformScaleTranslateMap, GradScheme >::result
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:935
openvdb::v10_0::math::GradientNormSqrd< UniformScaleTranslateMap, GradScheme >::result
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:924
openvdb::v10_0::math::GradientNormSqrd
Definition Operators.h:858
openvdb::v10_0::math::GradientNormSqrd::FD
static const DScheme FD
Definition Operators.h:859
openvdb::v10_0::math::GradientNormSqrd::result
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition Operators.h:879
openvdb::v10_0::math::GradientNormSqrd::BD
static const DScheme BD
Definition Operators.h:860
openvdb::v10_0::math::GradientNormSqrd::result
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:866
openvdb::v10_0::math::Gradient< ScaleMap, CD_2ND >::result
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:757
openvdb::v10_0::math::Gradient< ScaleMap, CD_2ND >::result
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:738
openvdb::v10_0::math::Gradient< ScaleTranslateMap, CD_2ND >::result
static internal::ReturnValue< StencilT >::Vec3Type result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:801
openvdb::v10_0::math::Gradient< ScaleTranslateMap, CD_2ND >::result
static internal::ReturnValue< Accessor >::Vec3Type result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:782
openvdb::v10_0::math::Gradient< TranslationMap, DiffScheme >::result
static internal::ReturnValue< Accessor >::Vec3Type result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:652
openvdb::v10_0::math::Gradient< TranslationMap, DiffScheme >::result
static internal::ReturnValue< StencilT >::Vec3Type result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:660
openvdb::v10_0::math::Gradient< UniformScaleMap, CD_2ND >::result
static internal::ReturnValue< StencilT >::Vec3Type result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:687
openvdb::v10_0::math::Gradient< UniformScaleMap, CD_2ND >::result
static internal::ReturnValue< Accessor >::Vec3Type result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:674
openvdb::v10_0::math::Gradient< UniformScaleTranslateMap, CD_2ND >::result
static internal::ReturnValue< Accessor >::Vec3Type result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:706
openvdb::v10_0::math::Gradient< UniformScaleTranslateMap, CD_2ND >::result
static internal::ReturnValue< StencilT >::Vec3Type result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:719
openvdb::v10_0::math::Gradient
Center difference gradient operators, defined with respect to the range-space of the map.
Definition Operators.h:620
openvdb::v10_0::math::Gradient::result
static internal::ReturnValue< Accessor >::Vec3Type result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:624
openvdb::v10_0::math::Gradient::result
static internal::ReturnValue< StencilT >::Vec3Type result(const MapType &map, const StencilT &stencil)
Definition Operators.h:635
openvdb::v10_0::math::ISCurl
Curl operator defined in index space using various first derivative schemes.
Definition Operators.h:499
openvdb::v10_0::math::ISCurl::result
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:515
openvdb::v10_0::math::ISCurl::result
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:502
openvdb::v10_0::math::ISDivergence
Divergence operator defined in index space using various first derivative schemes.
Definition Operators.h:473
openvdb::v10_0::math::ISDivergence::result
static Accessor::ValueType::value_type result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:476
openvdb::v10_0::math::ISDivergence::result
static StencilT::ValueType::value_type result(const StencilT &stencil)
Definition Operators.h:485
openvdb::v10_0::math::ISGradientBiased
Biased Gradient Operators, using upwinding defined by the Vec3Bias input.
Definition Operators.h:197
openvdb::v10_0::math::ISGradientBiased::result
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk, const Vec3Bias &V)
Definition Operators.h:204
openvdb::v10_0::math::ISGradientBiased::FD
static const DScheme FD
Definition Operators.h:198
openvdb::v10_0::math::ISGradientBiased::BD
static const DScheme BD
Definition Operators.h:199
openvdb::v10_0::math::ISGradientBiased::result
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil, const Vec3Bias &V)
Definition Operators.h:217
openvdb::v10_0::math::ISGradientNormSqrd
Definition Operators.h:231
openvdb::v10_0::math::ISGradientNormSqrd::result
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:252
openvdb::v10_0::math::ISGradientNormSqrd::FD
static const DScheme FD
Definition Operators.h:232
openvdb::v10_0::math::ISGradientNormSqrd::result
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:239
openvdb::v10_0::math::ISGradientNormSqrd::BD
static const DScheme BD
Definition Operators.h:233
openvdb::v10_0::math::ISGradient
Gradient operators defined in index space of various orders.
Definition Operators.h:100
openvdb::v10_0::math::ISGradient::result
static Vec3< typename Accessor::ValueType > result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:103
openvdb::v10_0::math::ISGradient::result
static Vec3< typename StencilT::ValueType > result(const StencilT &stencil)
Definition Operators.h:114
openvdb::v10_0::math::ISLaplacian< CD_FOURTH >::result
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:405
openvdb::v10_0::math::ISLaplacian< CD_FOURTH >::result
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:388
openvdb::v10_0::math::ISLaplacian< CD_SECOND >::result
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:374
openvdb::v10_0::math::ISLaplacian< CD_SECOND >::result
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:364
openvdb::v10_0::math::ISLaplacian< CD_SIXTH >::result
static StencilT::ValueType result(const StencilT &stencil)
Definition Operators.h:447
openvdb::v10_0::math::ISLaplacian< CD_SIXTH >::result
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition Operators.h:426
openvdb::v10_0::math::ISLaplacian
Laplacian defined in index space, using various center-difference stencils.
Definition Operators.h:348
openvdb::v10_0::math::ISLaplacian::result
static StencilT::ValueType result(const StencilT &stencil)
openvdb::v10_0::math::ISLaplacian::result
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
openvdb::v10_0::math::ISMeanCurvature
Compute the mean curvature in index space.
Definition Operators.h:533
openvdb::v10_0::math::ISMeanCurvature::result
static bool result(const Accessor &grid, const Coord &ijk, typename Accessor::ValueType &alpha, typename Accessor::ValueType &beta)
Random access version.
Definition Operators.h:539
openvdb::v10_0::math::ISMeanCurvature::result
static bool result(const StencilT &stencil, typename StencilT::ValueType &alpha, typename StencilT::ValueType &beta)
Stencil access version.
Definition Operators.h:577
openvdb::v10_0::math::ISOpMagnitude
Adapter for vector-valued index-space operators to return the vector magnitude.
Definition Operators.h:52
openvdb::v10_0::math::ISOpMagnitude::result
static double result(const AccessorType &grid, const Coord &ijk)
Definition Operators.h:54
openvdb::v10_0::math::ISOpMagnitude::result
static double result(const StencilType &stencil)
Definition Operators.h:59
openvdb::v10_0::math::Laplacian< ScaleMap, DiffScheme >::result
static Accessor::ValueType result(const ScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1586
openvdb::v10_0::math::Laplacian< ScaleMap, DiffScheme >::result
static StencilT::ValueType result(const ScaleMap &map, const StencilT &stencil)
Definition Operators.h:1604
openvdb::v10_0::math::Laplacian< ScaleTranslateMap, DiffScheme >::result
static Accessor::ValueType result(const ScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1627
openvdb::v10_0::math::Laplacian< ScaleTranslateMap, DiffScheme >::result
static StencilT::ValueType result(const ScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1644
openvdb::v10_0::math::Laplacian< TranslationMap, DiffScheme >::result
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1499
openvdb::v10_0::math::Laplacian< TranslationMap, DiffScheme >::result
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1507
openvdb::v10_0::math::Laplacian< UniformScaleMap, DiffScheme >::result
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:1549
openvdb::v10_0::math::Laplacian< UniformScaleMap, DiffScheme >::result
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1540
openvdb::v10_0::math::Laplacian< UniformScaleTranslateMap, DiffScheme >::result
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:1572
openvdb::v10_0::math::Laplacian< UniformScaleTranslateMap, DiffScheme >::result
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1563
openvdb::v10_0::math::Laplacian< UnitaryMap, DiffScheme >::result
static Accessor::ValueType result(const UnitaryMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1520
openvdb::v10_0::math::Laplacian< UnitaryMap, DiffScheme >::result
static StencilT::ValueType result(const UnitaryMap &, const StencilT &stencil)
Definition Operators.h:1528
openvdb::v10_0::math::Laplacian
Compute the Laplacian at a given location in a grid using finite differencing of various orders....
Definition Operators.h:1420
openvdb::v10_0::math::Laplacian::result
static StencilT::ValueType result(const MapType &map, const StencilT &stencil)
Definition Operators.h:1459
openvdb::v10_0::math::Laplacian::result
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1423
openvdb::v10_0::math::MapAdapter::result
ResultType result(const StencilType &stencil)
Definition Operators.h:44
openvdb::v10_0::math::MapAdapter::result
ResultType result(const AccessorType &grid, const Coord &ijk)
Definition Operators.h:40
openvdb::v10_0::math::MapAdapter::map
const MapType map
Definition Operators.h:46
openvdb::v10_0::math::MapAdapter::MapAdapter
MapAdapter(const MapType &m)
Definition Operators.h:36
openvdb::v10_0::math::MeanCurvature< TranslationMap, DiffScheme2, DiffScheme1 >::result
static Accessor::ValueType result(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1927
openvdb::v10_0::math::MeanCurvature< TranslationMap, DiffScheme2, DiffScheme1 >::result
static StencilT::ValueType result(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1950
openvdb::v10_0::math::MeanCurvature< TranslationMap, DiffScheme2, DiffScheme1 >::normGrad
static StencilT::ValueType normGrad(const TranslationMap &, const StencilT &stencil)
Definition Operators.h:1960
openvdb::v10_0::math::MeanCurvature< TranslationMap, DiffScheme2, DiffScheme1 >::normGrad
static Accessor::ValueType normGrad(const TranslationMap &, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1938
openvdb::v10_0::math::MeanCurvature< UniformScaleMap, DiffScheme2, DiffScheme1 >::normGrad
static Accessor::ValueType normGrad(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1990
openvdb::v10_0::math::MeanCurvature< UniformScaleMap, DiffScheme2, DiffScheme1 >::normGrad
static StencilT::ValueType normGrad(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:2018
openvdb::v10_0::math::MeanCurvature< UniformScaleMap, DiffScheme2, DiffScheme1 >::result
static StencilT::ValueType result(const UniformScaleMap &map, const StencilT &stencil)
Definition Operators.h:2005
openvdb::v10_0::math::MeanCurvature< UniformScaleMap, DiffScheme2, DiffScheme1 >::result
static Accessor::ValueType result(const UniformScaleMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1976
openvdb::v10_0::math::MeanCurvature< UniformScaleTranslateMap, DiffScheme2, DiffScheme1 >::result
static StencilT::ValueType result(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:2064
openvdb::v10_0::math::MeanCurvature< UniformScaleTranslateMap, DiffScheme2, DiffScheme1 >::result
static Accessor::ValueType result(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:2037
openvdb::v10_0::math::MeanCurvature< UniformScaleTranslateMap, DiffScheme2, DiffScheme1 >::normGrad
static StencilT::ValueType normGrad(const UniformScaleTranslateMap &map, const StencilT &stencil)
Definition Operators.h:2077
openvdb::v10_0::math::MeanCurvature< UniformScaleTranslateMap, DiffScheme2, DiffScheme1 >::normGrad
static Accessor::ValueType normGrad(const UniformScaleTranslateMap &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:2050
openvdb::v10_0::math::MeanCurvature
Compute the mean curvature.
Definition Operators.h:1762
openvdb::v10_0::math::MeanCurvature::normGrad
static StencilT::ValueType normGrad(const MapType &map, const StencilT stencil)
Definition Operators.h:1912
openvdb::v10_0::math::MeanCurvature::compute
static bool compute(const MapType &map, const Accessor &grid, const Coord &ijk, double &alpha, double &beta)
Random access version.
Definition Operators.h:1768
openvdb::v10_0::math::MeanCurvature::normGrad
static Accessor::ValueType normGrad(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1833
openvdb::v10_0::math::MeanCurvature::compute
static bool compute(const MapType &map, const StencilT &stencil, double &alpha, double &beta)
Stencil access version.
Definition Operators.h:1847
openvdb::v10_0::math::MeanCurvature::result
static StencilT::ValueType result(const MapType &map, const StencilT stencil)
Definition Operators.h:1903
openvdb::v10_0::math::MeanCurvature::result
static Accessor::ValueType result(const MapType &map, const Accessor &grid, const Coord &ijk)
Definition Operators.h:1823
openvdb::v10_0::math::OpMagnitude
Adapter for vector-valued world-space operators to return the vector magnitude.
Definition Operators.h:66
openvdb::v10_0::math::OpMagnitude::result
static double result(const MapT &map, const StencilType &stencil)
Definition Operators.h:73
openvdb::v10_0::math::OpMagnitude::result
static double result(const MapT &map, const AccessorType &grid, const Coord &ijk)
Definition Operators.h:68
openvdb::v10_0::math::Tolerance::value
static T value()
Definition Math.h:148
openvdb::v10_0::math::is_double< double >::value
static const bool value
Definition Operators.h:26
openvdb::v10_0::math::is_double
Definition Operators.h:25
openvdb::v10_0::math::is_double::value
static const bool value
Definition Operators.h:25
openvdb::v10_0::math::is_linear::value
static const bool value
Definition Maps.h:55
openvdb::v10_0::math::is_vec3d< Vec3d >::value
static const bool value
Definition Operators.h:23
openvdb::v10_0::math::is_vec3d
Definition Operators.h:22
openvdb::v10_0::math::is_vec3d::value
static const bool value
Definition Operators.h:22
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212