Loading...
Searching...
No Matches
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.
virtual | ~LevelSetAdvection ()
math::BiasedGradientScheme | getSpatialScheme () const
| Return the spatial finite difference scheme.
void | setSpatialScheme (math::BiasedGradientScheme scheme)
| Set the spatial finite difference scheme.
math::TemporalIntegrationScheme | getTemporalScheme () const
| Return the temporal integration scheme.
void | setTemporalScheme (math::TemporalIntegrationScheme scheme)
| Set the spatial finite difference scheme.
math::BiasedGradientScheme | getTrackerSpatialScheme () const
| Return the spatial finite difference scheme.
void | setTrackerSpatialScheme (math::BiasedGradientScheme scheme)
| Set the spatial finite difference scheme.
math::TemporalIntegrationScheme | getTrackerTemporalScheme () const
| Return the temporal integration scheme.
void | setTrackerTemporalScheme (math::TemporalIntegrationScheme scheme)
| Set the spatial finite difference scheme.
int | getNormCount () const
| Return The number of normalizations performed per track or normalize call.
void | setNormCount (int n)
| Set the number of normalizations performed per track or normalize call.
int | getGrainSize () const
| Return the grain-size used for multi-threading.
void | setGrainSize (int grainsize)
| Set the grain-size used for multi-threading.
size_t | advect (ValueType time0, ValueType time1)

## Detailed Description

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>
class openvdb::v11_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;
...
};
openvdb::v11_0::math::Coord
Signed (x, y, z) 32-bit integer coordinates.
Definition Coord.h:25
openvdb::v11_0::tools::LevelSetAdvection::ValueType
typename TrackerT::ValueType ValueType
Definition LevelSetAdvect.h:81

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

## BufferType

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

using BufferType = typename TrackerT::BufferType

## GridType

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

using GridType = GridT

## LeafRange

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

using LeafRange = typename TrackerT::LeafRange

## LeafType

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

using LeafType = typename TrackerT::LeafType

## TrackerT

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

using TrackerT = LevelSetTracker<GridT, InterruptT>

## ValueType

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

using ValueType = typename TrackerT::ValueType

## VectorType

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

using VectorType = typename FieldT::VectorType

## Constructor & Destructor Documentation

## LevelSetAdvection()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

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

inline

Main constructor.

## ~LevelSetAdvection()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

virtual ~LevelSetAdvection | ( |  | ) |

inline virtual

## Member Function Documentation

## advect()

template<typename GridT, typename FieldT, typename InterruptT>

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

## getGrainSize()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

int getGrainSize | ( |  | ) | const

inline

Return the grain-size used for multi-threading.

## getNormCount()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

int getNormCount | ( |  | ) | const

inline

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

## getSpatialScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

math::BiasedGradientScheme getSpatialScheme | ( |  | ) | const

inline

Return the spatial finite difference scheme.

## getTemporalScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

math::TemporalIntegrationScheme getTemporalScheme | ( |  | ) | const

inline

Return the temporal integration scheme.

## getTrackerSpatialScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

math::BiasedGradientScheme getTrackerSpatialScheme | ( |  | ) | const

inline

Return the spatial finite difference scheme.

## getTrackerTemporalScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

math::TemporalIntegrationScheme getTrackerTemporalScheme | ( |  | ) | const

inline

Return the temporal integration scheme.

## setGrainSize()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

void setGrainSize | ( | int | grainsize | ) |

inline

Set the grain-size used for multi-threading.

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

## setNormCount()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

void setNormCount | ( | int | n | ) |

inline

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

## setSpatialScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

void setSpatialScheme | ( | math::BiasedGradientScheme | scheme | ) |

inline

Set the spatial finite difference scheme.

## setTemporalScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

void setTemporalScheme | ( | math::TemporalIntegrationScheme | scheme | ) |

inline

Set the spatial finite difference scheme.

## setTrackerSpatialScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

void setTrackerSpatialScheme | ( | math::BiasedGradientScheme | scheme | ) |

inline

Set the spatial finite difference scheme.

## setTrackerTemporalScheme()

template<typename GridT, typename FieldT = EnrightField<typename GridT::ValueType>, typename InterruptT = util::NullInterrupter>

void setTrackerTemporalScheme | ( | math::TemporalIntegrationScheme | scheme | ) |

inline

Set the spatial finite difference scheme.