Performs advections of an arbitrary type of volume in a static velocity field. The advections are performed by means of various derivatives of SemiLagrangian integration, i.e. backwards tracking along the hyperbolic characteristics followed by interpolation.
More...
#include <VolumeAdvect.h>
template<typename VelocityGridT = Vec3fGrid, bool StaggeredVelocity = false, typename InterrupterType = util::NullInterrupter>
class openvdb::v6_2::tools::VolumeAdvection< VelocityGridT, StaggeredVelocity, InterrupterType >
Performs advections of an arbitrary type of volume in a static velocity field. The advections are performed by means of various derivatives of SemiLagrangian integration, i.e. backwards tracking along the hyperbolic characteristics followed by interpolation.
 Note
 Optionally a limiter can be combined with the higherorder integration schemes MacCormack and BFECC. There are two types of limiters (CLAMP and REVERT) that supress nonphysical oscillations by means of either claminging or reverting to a firstorder schemes when the function is not bounded by the cell values used for trilinear interpolation.
The supported integrations schemes:
///
/// ================================================================
///  Lable  Accuracy  Integration Scheme  Interpolations 
///  Time/Space  velocity/volume 
/// ================================================================
///  SEMI  1/1  SemiLagrangian  1/1 
///  MID  2/1  MidPoint  2/1 
///  RK3  3/1  3rd Order RungeKutta  3/1 
///  RK4  4/1  4th Order RungeKutta  4/1 
///  MAC  2/2  MacCormack  2/2 
///  BFECC  2/2  BFECC  3/2 
/// ================================================================
///
VolumeAdvection 
( 
const VelocityGridT & 
velGrid, 


InterrupterType * 
interrupter = nullptr 

) 
 

inline 
Constructor.
 Parameters

velGrid  Velocity grid responsible for the (passive) advection. 
interrupter  Optional interrupter used to prematurely end computations. 
 Note
 The velocity field is assumed to be constant for the duration of the advection.
VolumeGridT::Ptr advect 
( 
const VolumeGridT & 
inGrid, 


double 
timeStep 

) 
 

inline 
 Returns
 Returns a new grid that is the result of passive advection of all the active values the input grid by timeStep.
 Parameters

inGrid  The input grid to be advected (unmodified) 
timeStep  Timestep of the RungeKutta integrator. 
This method will advect all of the active values in the input inGrid. To achieve this a deepcopy is dilated to account for the material transport. This dilation step can be slow for large time steps dt or a velocity field with large magnitudes.
 Warning
 If the VolumeSamplerT is of higher order than one (i.e. trilinear interpolation) instabilities are known to occure. To suppress those monotonicity constrains or fluxlimiters need to be applies.
 Exceptions

VolumeGridT::Ptr advect 
( 
const VolumeGridT & 
inGrid, 


const MaskGridT & 
mask, 


double 
timeStep 

) 
 

inline 
 Returns
 Returns a new grid that is the result of passive advection of the active values in inGrid that intersect the active values in
mask
. The time of the output grid is incremented by timeStep.
 Parameters

inGrid  The input grid to be advected (unmodified). 
mask  The mask of active values defining the active voxels in inGrid on which to perform advection. Only if a value is active in both grids will it be modified. 
timeStep  Timestep for a single RungeKutta integration step. 
This method will advect all of the active values in the input inGrid that intersects with the active values in mask. To achieve this a deepcopy is dilated to account for the material transport and finally cropped to the intersection with mask. The dilation step can be slow for large time steps dt or fast moving velocity fields.
 Warning
 If the VolumeSamplerT is of higher order the one (i.e. trilinear interpolation) instabilities are known to occure. To suppress those monotonicity constrains or fluxlimiters need to be applies.
 Exceptions

RuntimeError  if inGrid is not aligned with mask or if its voxels are not uniform. 
size_t getGrainSize 
( 
 ) 
const 

inline 
 Returns
 the grainsize used for multithreading
 Note
 A grainsize of 0 implies serial execution
Return the integrator (see details in the table above)
Retrun the limiter (see details above)
int getMaxDistance 
( 
const VolumeGridT & 
inGrid, 


double 
dt 

) 
 const 

inline 
 Returns
 Returns the maximum distance in voxel units of inGrid that a particle can travel in the timestep dt when advected in the velocity field defined during construction.
This method is useful when dilating sparse volume grids to pad boundary regions. Excessive dilation can be computationally expensive so use this method to prevent or warn against runaway computation.
 Exceptions

double getMaxVelocity 
( 
 ) 
const 

inline 
Return the maximum magnitude of the velocity in the advection velocity field defined during construction.
int getSubSteps 
( 
 ) 
const 

inline 
 Returns
 the number of substeps per integration (always larger than or equal to 1).
bool isLimiterOn 
( 
 ) 
const 

inline 
Return true
if a limiter will be applied based on the current settings.
void setGrainSize 
( 
size_t 
grainsize  ) 


inline 
Set the grainsize used for multithreading.
 Note
 A grainsize of 0 disables multithreading
 Warning
 A small grainsize can degrade performance, both in terms of time and memory footprint!
Set the integrator (see details in the table above)
Set the limiter (see details above)
void setSubSteps 
( 
int 
substeps  ) 


inline 
Set the number of substeps per integration.
 Note
 The only reason to increase the substep above its default value of one is to reduce the memory footprint due to significant dilation. Values smaller than 1 will be clamped to 1!
int spatialOrder 
( 
 ) 
const 

inline 
Return the spatial order of accuracy of the advection scheme.
 Note
 This is the optimal order in smooth regions. In nonsmooth regions the fluxlimiter will drop the order of accuracy to add numerical dissipation.
int temporalOrder 
( 
 ) 
const 

inline 
Return the temporal order of accuracy of the advection scheme.
 Note
 This is the optimal order in smooth regions. In nonsmooth regions the fluxlimiter will drop the order of accuracy to add numerical dissipation.
The documentation for this class was generated from the following file: