OpenVDB  12.0.0
Classes | Public Types | Public Member Functions | List of all members
LevelSetAdvection< GridT, FieldT, InterruptT > Class Template Reference

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

#include <openvdb/tools/LevelSetAdvect.h>

Public Types

using GridType = GridT
 
using TrackerT = LevelSetTracker< GridT, InterruptT >
 
using LeafRange = typename TrackerT::LeafRange
 
using LeafType = typename TrackerT::LeafType
 
using BufferType = typename TrackerT::BufferType
 
using ValueType = typename TrackerT::ValueType
 
using VectorType = typename FieldT::VectorType
 

Public Member Functions

 LevelSetAdvection (GridT &grid, const FieldT &field, InterruptT *interrupt=nullptr)
 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::v12_0::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 = nullptr) // 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).

Member Typedef Documentation

using BufferType = typename TrackerT::BufferType
using GridType = GridT
using LeafRange = typename TrackerT::LeafRange
using LeafType = typename TrackerT::LeafType
using TrackerT = LevelSetTracker<GridT, InterruptT>
using ValueType = typename TrackerT::ValueType
using VectorType = typename FieldT::VectorType

Constructor & Destructor Documentation

LevelSetAdvection ( GridT &  grid,
const FieldT &  field,
InterruptT *  interrupt = nullptr 
)
inline

Main constructor.

virtual ~LevelSetAdvection ( )
inlinevirtual

Member Function Documentation

size_t advect ( ValueType  time0,
ValueType  time1 
)

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
int getGrainSize ( ) const
inline

Return the grain-size used for multi-threading.

int getNormCount ( ) const
inline

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

math::BiasedGradientScheme getSpatialScheme ( ) const
inline

Return the spatial finite difference scheme.

math::TemporalIntegrationScheme getTemporalScheme ( ) const
inline

Return the temporal integration scheme.

math::BiasedGradientScheme getTrackerSpatialScheme ( ) const
inline

Return the spatial finite difference scheme.

math::TemporalIntegrationScheme getTrackerTemporalScheme ( ) const
inline

Return the temporal integration scheme.

void setGrainSize ( int  grainsize)
inline

Set the grain-size used for multi-threading.

Note
A grain size of 0 or less disables multi-threading!
void setNormCount ( int  n)
inline

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

void setSpatialScheme ( math::BiasedGradientScheme  scheme)
inline

Set the spatial finite difference scheme.

void setTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inline

Set the spatial finite difference scheme.

void setTrackerSpatialScheme ( math::BiasedGradientScheme  scheme)
inline

Set the spatial finite difference scheme.

void setTrackerTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inline

Set the spatial finite difference scheme.