HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT > Class Template Reference

Hyperbolic advection of narrow-band level sets in an external velocity field. More...

#include <LevelSetAdvect.h>

Public Types

typedef GridT GridType
 
typedef LevelSetTracker< GridT,
InterruptT > 
TrackerT
 
typedef TrackerT::LeafRange LeafRange
 
typedef TrackerT::LeafType LeafType
 
typedef TrackerT::BufferType BufferType
 
typedef TrackerT::ValueType ValueType
 
typedef FieldT::VectorType VectorType
 

Public Member Functions

 LevelSetAdvection (GridT &grid, const FieldT &field, InterruptT *interrupt=NULL)
 Main constructor. More...
 
virtual ~LevelSetAdvection ()
 
math::BiasedGradientScheme getSpatialScheme () const
 Return the spatial finite difference scheme. More...
 
void setSpatialScheme (math::BiasedGradientScheme scheme)
 Set the spatial finite difference scheme. More...
 
math::TemporalIntegrationScheme getTemporalScheme () const
 Return the temporal integration scheme. More...
 
void setTemporalScheme (math::TemporalIntegrationScheme scheme)
 Set the spatial finite difference scheme. More...
 
math::BiasedGradientScheme getTrackerSpatialScheme () const
 Return the spatial finite difference scheme. More...
 
void setTrackerSpatialScheme (math::BiasedGradientScheme scheme)
 Set the spatial finite difference scheme. More...
 
math::TemporalIntegrationScheme getTrackerTemporalScheme () const
 Return the temporal integration scheme. More...
 
void setTrackerTemporalScheme (math::TemporalIntegrationScheme scheme)
 Set the spatial finite difference scheme. More...
 
int getNormCount () const
 Return The number of normalizations performed per track or normalize call. More...
 
void setNormCount (int n)
 Set the number of normalizations performed per track or normalize call. More...
 
int getGrainSize () const
 Return the grain-size used for multi-threading. More...
 
void setGrainSize (int grainsize)
 Set the grain-size used for multi-threading. More...
 
size_t advect (ValueType time0, ValueType time1)
 

Detailed Description

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
class openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >

Hyperbolic advection of narrow-band level sets in an external velocity field.

The FieldType template argument below refers to any functor with the following interface (see tools/VelocityFields.h for examples):

class VelocityField {
...
public:
openvdb::VectorType operator() (const openvdb::Coord& xyz, ValueType time) const;
...
};
Note
The functor method returns the velocity field at coordinate position xyz of the advection grid, and for the specified time. Note that since the velocity is returned in the local coordinate space of the grid that is being advected, the functor typically depends on the transformation of that grid. This design is chosen for performance reasons. Finally we will assume that the functor method is NOT threadsafe (typically uses a ValueAccessor) and that its lightweight enough that we can copy it per thread.

The InterruptType template argument below refers to any class with the following interface:

class Interrupter {
...
public:
void start(const char* name = NULL)// called when computations begin
void end() // called when computations end
bool wasInterrupted(int percent=-1)// return true to break computation
};
Note
If no template argument is provided for this InterruptType the util::NullInterrupter is used which implies that all interrupter calls are no-ops (i.e. incurs no computational overhead).

Definition at line 101 of file LevelSetAdvect.h.

Member Typedef Documentation

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
typedef TrackerT::BufferType openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::BufferType

Definition at line 108 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
typedef GridT openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::GridType

Definition at line 104 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
typedef TrackerT::LeafRange openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::LeafRange

Definition at line 106 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
typedef TrackerT::LeafType openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::LeafType

Definition at line 107 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
typedef LevelSetTracker<GridT, InterruptT> openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::TrackerT

Definition at line 105 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
typedef TrackerT::ValueType openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::ValueType

Definition at line 109 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
typedef FieldT::VectorType openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::VectorType

Definition at line 110 of file LevelSetAdvect.h.

Constructor & Destructor Documentation

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::LevelSetAdvection ( GridT &  grid,
const FieldT &  field,
InterruptT *  interrupt = NULL 
)
inline

Main constructor.

Definition at line 113 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
virtual openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::~LevelSetAdvection ( )
inlinevirtual

Definition at line 118 of file LevelSetAdvect.h.

Member Function Documentation

template<typename GridT , typename FieldT , typename InterruptT >
size_t openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::advect ( ValueType  time0,
ValueType  time1 
)
inline

Advect the level set from its current time, time0, to its final time, time1. If time0>time1 backward advection is performed.

Returns
number of CFL iterations used to advect from time0 to time1

Definition at line 245 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
int openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::getGrainSize ( ) const
inline

Return the grain-size used for multi-threading.

Definition at line 155 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
int openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::getNormCount ( ) const
inline

Return The number of normalizations performed per track or normalize call.

Definition at line 149 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
math::BiasedGradientScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::getSpatialScheme ( ) const
inline

Return the spatial finite difference scheme.

Definition at line 121 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
math::TemporalIntegrationScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::getTemporalScheme ( ) const
inline

Return the temporal integration scheme.

Definition at line 126 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
math::BiasedGradientScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::getTrackerSpatialScheme ( ) const
inline

Return the spatial finite difference scheme.

Definition at line 131 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
math::TemporalIntegrationScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::getTrackerTemporalScheme ( ) const
inline

Return the temporal integration scheme.

Definition at line 139 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::setGrainSize ( int  grainsize)
inline

Set the grain-size used for multi-threading.

Note
A grain size of 0 or less disables multi-threading!

Definition at line 158 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::setNormCount ( int  n)
inline

Set the number of normalizations performed per track or normalize call.

Definition at line 152 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::setSpatialScheme ( math::BiasedGradientScheme  scheme)
inline

Set the spatial finite difference scheme.

Definition at line 123 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::setTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inline

Set the spatial finite difference scheme.

Definition at line 128 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::setTrackerSpatialScheme ( math::BiasedGradientScheme  scheme)
inline

Set the spatial finite difference scheme.

Definition at line 135 of file LevelSetAdvect.h.

template<typename GridT , typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetAdvection< GridT, FieldT, InterruptT >::setTrackerTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inline

Set the spatial finite difference scheme.

Definition at line 143 of file LevelSetAdvect.h.


The documentation for this class was generated from the following file: