vtkAbstractInterpolatedVelocityField Class Reference

#include <vtkAbstractInterpolatedVelocityField.h>

Inheritance diagram for vtkAbstractInterpolatedVelocityField:

Inheritance graph
[legend]
Collaboration diagram for vtkAbstractInterpolatedVelocityField:

Collaboration graph
[legend]

List of all members.


Detailed Description

An abstract class for obtaining the interpolated velocity values at a point.

vtkAbstractInterpolatedVelocityField acts as a continuous velocity field by performing cell interpolation on the underlying vtkDataSet. This is an abstract sub-class of vtkFunctionSet, NumberOfIndependentVariables = 4 (x,y,z,t) and NumberOfFunctions = 3 (u,v,w). With a brute-force scheme, every time an evaluation is performed, the target cell containing point (x,y,z) needs to be found by calling FindCell(), via either vtkDataSet or vtkAbstractCelllocator's sub-classes (vtkCellLocator & vtkModifiedBSPTree). As it incurs a large cost, one (for vtkCellLocatorInterpolatedVelocityField via vtkAbstractCellLocator) or two (for vtkInterpolatedVelocityField via vtkDataSet that involves vtkPointLocator in addressing vtkPointSet) levels of cell caching may be exploited to increase the performance.

For vtkInterpolatedVelocityField, level #0 begins with intra-cell caching. Specifically if the previous cell is valid and the next point is still in it ( i.e., vtkCell::EvaluatePosition() returns 1, coupled with newly created parametric coordinates & weights ), the function values can be interpolated and only vtkCell::EvaluatePosition() is invoked. If this fails, then level #1 follows by inter-cell search for the target cell that contains the next point. By an inter-cell search, the previous cell provides an important clue or serves as an immediate neighbor to aid in locating the target cell via vtkPointSet:: FindCell(). If this still fails, a global cell location / search is invoked via vtkPointSet::FindCell(). Here regardless of either inter-cell or global search, vtkPointLocator is in fact employed (for datasets of type vtkPointSet only, note vtkImageData and vtkRectilinearGrid are able to provide rapid and robust cell location due to the simple mesh topology) as a crucial tool underlying the cell locator. However, the use of vtkPointLocator makes vtkInterpolatedVelocityField non-robust in cell location for vtkPointSet.

For vtkCellLocatorInterpolatedVelocityField, the only caching (level #0) works by intra-cell trial. In case of failure, a global search for the target cell is invoked via vtkAbstractCellLocator::FindCell() and the actual work is done by either vtkCellLocator or vtkModifiedBSPTree (for datasets of type vtkPointSet only, while vtkImageData and vtkRectilinearGrid themselves are able to provide fast robust cell location). Without the involvement of vtkPointLocator, robust cell location is achieved for vtkPointSet.

Warning:
vtkAbstractInterpolatedVelocityField is not thread safe. A new instance should be created by each thread.
See also:
vtkInterpolatedVelocityField vtkCellLocatorInterpolatedVelocityField vtkGenericInterpolatedVelocityField vtkCachingInterpolatedVelocityField vtkTemporalInterpolatedVelocityField vtkFunctionSet vtkStreamer vtkStreamTracer

Definition at line 82 of file vtkAbstractInterpolatedVelocityField.h.


Public Types

typedef vtkFunctionSet Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void SetLastCellId (vtkIdType c, int dataindex)=0
virtual void AddDataSet (vtkDataSet *dataset)=0
virtual int FunctionValues (double *x, double *f)=0
void ClearLastCellId ()
virtual void SetCaching (bool)
virtual bool GetCaching ()
virtual int GetCacheHit ()
virtual int GetCacheMiss ()
virtual int GetLastDataSetIndex ()
virtual vtkDataSetGetLastDataSet ()
virtual vtkIdType GetLastCellId ()
virtual void SetLastCellId (vtkIdType c)
virtual char * GetVectorsSelection ()
void SelectVectors (const char *fieldName)
virtual void SetNormalizeVector (bool)
virtual bool GetNormalizeVector ()
virtual void CopyParameters (vtkAbstractInterpolatedVelocityField *from)
int GetLastWeights (double *w)
int GetLastLocalCoordinates (double pcoords[3])

Static Public Member Functions

static int IsTypeOf (const char *type)
static
vtkAbstractInterpolatedVelocityField
SafeDownCast (vtkObject *o)

Protected Member Functions

 vtkAbstractInterpolatedVelocityField ()
 ~vtkAbstractInterpolatedVelocityField ()
virtual int FunctionValues (vtkDataSet *ds, double *x, double *f)
virtual void SetVectorsSelection (const char *)
void FastCompute (vtkDataArray *vectors, double f[3])
bool InterpolatePoint (vtkPointData *outPD, vtkIdType outIndex)
vtkGenericCellGetLastCell ()

Protected Attributes

int CacheHit
int CacheMiss
int WeightsSize
int LastDataSetIndex
bool Caching
bool NormalizeVector
char * VectorsSelection
double * Weights
double LastPCoords [3]
vtkIdType LastCellId
vtkDataSetLastDataSet
vtkGenericCellCell
vtkGenericCellGenCell
vtkAbstractInterpolatedVelocityFieldDataSetsTypeDataSets

Static Protected Attributes

static const double TOLERANCE_SCALE

Friends

class vtkTemporalInterpolatedVelocityField

Member Typedef Documentation


Constructor & Destructor Documentation

vtkAbstractInterpolatedVelocityField::vtkAbstractInterpolatedVelocityField (  )  [protected]

vtkAbstractInterpolatedVelocityField::~vtkAbstractInterpolatedVelocityField (  )  [protected]


Member Function Documentation

virtual const char* vtkAbstractInterpolatedVelocityField::GetClassName (  )  [virtual]

static int vtkAbstractInterpolatedVelocityField::IsTypeOf ( const char *  name  )  [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkFunctionSet.

Reimplemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

virtual int vtkAbstractInterpolatedVelocityField::IsA ( const char *  name  )  [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkFunctionSet.

Reimplemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

static vtkAbstractInterpolatedVelocityField* vtkAbstractInterpolatedVelocityField::SafeDownCast ( vtkObject o  )  [static]

void vtkAbstractInterpolatedVelocityField::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkFunctionSet.

Reimplemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

virtual void vtkAbstractInterpolatedVelocityField::SetCaching ( bool   )  [virtual]

Set/Get the caching flag. If this flag is turned ON, there are two levels of caching for derived concrete class vtkInterpolatedVelocityField and one level of caching for derived concrete class vtkCellLocatorInterpolatedVelocityField. Otherwise a global cell location is always invoked for evaluating the function values at any point.

virtual bool vtkAbstractInterpolatedVelocityField::GetCaching (  )  [virtual]

Set/Get the caching flag. If this flag is turned ON, there are two levels of caching for derived concrete class vtkInterpolatedVelocityField and one level of caching for derived concrete class vtkCellLocatorInterpolatedVelocityField. Otherwise a global cell location is always invoked for evaluating the function values at any point.

virtual int vtkAbstractInterpolatedVelocityField::GetCacheHit (  )  [virtual]

Get the caching statistics. CacheHit refers to the number of level #0 cache hits while CacheMiss is the number of level #0 cache misses.

virtual int vtkAbstractInterpolatedVelocityField::GetCacheMiss (  )  [virtual]

Get the caching statistics. CacheHit refers to the number of level #0 cache hits while CacheMiss is the number of level #0 cache misses.

virtual int vtkAbstractInterpolatedVelocityField::GetLastDataSetIndex (  )  [virtual]

Get the most recently visited dataset and it id. The dataset is used for a guess regarding where the next point will be, without searching through all datasets. When setting the last dataset, care is needed as no reference counting or checks are performed. This feature is intended for custom interpolators only that cache datasets independently.

virtual vtkDataSet* vtkAbstractInterpolatedVelocityField::GetLastDataSet (  )  [virtual]

Get the most recently visited dataset and it id. The dataset is used for a guess regarding where the next point will be, without searching through all datasets. When setting the last dataset, care is needed as no reference counting or checks are performed. This feature is intended for custom interpolators only that cache datasets independently.

virtual vtkIdType vtkAbstractInterpolatedVelocityField::GetLastCellId (  )  [virtual]

Get/Set the id of the cell cached from last evaluation.

virtual void vtkAbstractInterpolatedVelocityField::SetLastCellId ( vtkIdType  c  )  [inline, virtual]

Get/Set the id of the cell cached from last evaluation.

Reimplemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

Definition at line 120 of file vtkAbstractInterpolatedVelocityField.h.

virtual void vtkAbstractInterpolatedVelocityField::SetLastCellId ( vtkIdType  c,
int  dataindex 
) [pure virtual]

Set the id of the most recently visited cell of a dataset.

Implemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

virtual char* vtkAbstractInterpolatedVelocityField::GetVectorsSelection (  )  [virtual]

Get/Set the name of a spcified vector array. By default it is NULL, with the active vector array for use.

void vtkAbstractInterpolatedVelocityField::SelectVectors ( const char *  fieldName  )  [inline]

Get/Set the name of a spcified vector array. By default it is NULL, with the active vector array for use.

Definition at line 130 of file vtkAbstractInterpolatedVelocityField.h.

virtual void vtkAbstractInterpolatedVelocityField::SetNormalizeVector ( bool   )  [virtual]

Set/Get the flag indicating vector post-normalization (following vector interpolation). Vector post-normalization is required to avoid the 'curve-overshooting' problem (caused by high velocity magnitude) that occurs when Cell-Length is used as the step size unit (particularly the Minimum step size unit). Furthermore, it is required by RK45 to achieve, as expected, high numerical accuracy (or high smoothness of flow lines) through adaptive step sizing. Note this operation is performed (when NormalizeVector TRUE) right after vector interpolation such that the differing amount of contribution of each node (of a cell) to the resulting direction of the interpolated vector, due to the possibly significantly-differing velocity magnitude values at the nodes (which is the case with large cells), can be reflected as is. Also note that this flag needs to be turned to FALSE after vtkInitialValueProblemSolver:: ComputeNextStep() as subsequent operations, e.g., vorticity computation, may need non-normalized vectors.

virtual bool vtkAbstractInterpolatedVelocityField::GetNormalizeVector (  )  [virtual]

Set/Get the flag indicating vector post-normalization (following vector interpolation). Vector post-normalization is required to avoid the 'curve-overshooting' problem (caused by high velocity magnitude) that occurs when Cell-Length is used as the step size unit (particularly the Minimum step size unit). Furthermore, it is required by RK45 to achieve, as expected, high numerical accuracy (or high smoothness of flow lines) through adaptive step sizing. Note this operation is performed (when NormalizeVector TRUE) right after vector interpolation such that the differing amount of contribution of each node (of a cell) to the resulting direction of the interpolated vector, due to the possibly significantly-differing velocity magnitude values at the nodes (which is the case with large cells), can be reflected as is. Also note that this flag needs to be turned to FALSE after vtkInitialValueProblemSolver:: ComputeNextStep() as subsequent operations, e.g., vorticity computation, may need non-normalized vectors.

virtual void vtkAbstractInterpolatedVelocityField::CopyParameters ( vtkAbstractInterpolatedVelocityField from  )  [inline, virtual]

Import parameters. Sub-classes can add more after chaining.

Reimplemented in vtkCellLocatorInterpolatedVelocityField.

Definition at line 157 of file vtkAbstractInterpolatedVelocityField.h.

virtual void vtkAbstractInterpolatedVelocityField::AddDataSet ( vtkDataSet dataset  )  [pure virtual]

Add a dataset for implicit velocity function evaluation. If more than one dataset is added, the evaluation point is searched in all until a match is found. THIS FUNCTION DOES NOT CHANGE THE REFERENCE COUNT OF dataset FOR THREAD SAFETY REASONS.

Implemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

virtual int vtkAbstractInterpolatedVelocityField::FunctionValues ( double *  x,
double *  f 
) [pure virtual]

Evaluate the velocity field f at point (x, y, z).

Implements vtkFunctionSet.

Implemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

void vtkAbstractInterpolatedVelocityField::ClearLastCellId (  )  [inline]

Set the last cell id to -1 to incur a global cell search for the next point.

Definition at line 172 of file vtkAbstractInterpolatedVelocityField.h.

int vtkAbstractInterpolatedVelocityField::GetLastWeights ( double *  w  ) 

Get the interpolation weights cached from last evaluation. Return 1 if the cached cell is valid and 0 otherwise.

int vtkAbstractInterpolatedVelocityField::GetLastLocalCoordinates ( double  pcoords[3]  ) 

Get the interpolation weights cached from last evaluation. Return 1 if the cached cell is valid and 0 otherwise.

virtual void vtkAbstractInterpolatedVelocityField::SetVectorsSelection ( const char *   )  [protected, virtual]

Set the name of a specific vector to be interpolated.

virtual int vtkAbstractInterpolatedVelocityField::FunctionValues ( vtkDataSet ds,
double *  x,
double *  f 
) [protected, virtual]

Evaluate the velocity field f at point (x, y, z) in a specified dataset by invoking vtkDataSet::FindCell() to locate the next cell if the given point is outside the current cell. To address vtkPointSet, vtkPointLocator is involved via vtkPointSet::FindCell() in vtkInterpolatedVelocityField for cell location. In vtkCellLocatorInterpolatedVelocityField, this function is invoked just to handle vtkImageData and vtkRectilinearGrid that are not assigned with any vtkAbstractCellLocatot-type cell locator.

Reimplemented in vtkInterpolatedVelocityField, and vtkCellLocatorInterpolatedVelocityField.

void vtkAbstractInterpolatedVelocityField::FastCompute ( vtkDataArray vectors,
double  f[3] 
) [protected]

If all weights have been computed (parametric coords etc all valid), a scalar/vector can be quickly interpolated using the known weights and the cached generic cell. This function is primarily reserved for use by vtkTemporalInterpolatedVelocityField

bool vtkAbstractInterpolatedVelocityField::InterpolatePoint ( vtkPointData outPD,
vtkIdType  outIndex 
) [protected]

If all weights have been computed (parametric coords etc all valid), a scalar/vector can be quickly interpolated using the known weights and the cached generic cell. This function is primarily reserved for use by vtkTemporalInterpolatedVelocityField

vtkGenericCell* vtkAbstractInterpolatedVelocityField::GetLastCell (  )  [inline, protected]

If all weights have been computed (parametric coords etc all valid), a scalar/vector can be quickly interpolated using the known weights and the cached generic cell. This function is primarily reserved for use by vtkTemporalInterpolatedVelocityField

Definition at line 226 of file vtkAbstractInterpolatedVelocityField.h.


Friends And Related Function Documentation

friend class vtkTemporalInterpolatedVelocityField [friend]

Definition at line 218 of file vtkAbstractInterpolatedVelocityField.h.


Member Data Documentation

Definition at line 185 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 187 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 188 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 189 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 190 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 191 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 192 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 193 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 194 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 195 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 196 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 197 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 198 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 199 of file vtkAbstractInterpolatedVelocityField.h.

Definition at line 200 of file vtkAbstractInterpolatedVelocityField.h.


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

Generated on Wed Aug 24 11:28:06 2011 for VTK by  doxygen 1.5.6