VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkTemporalInterpolatedVelocityField Class Reference

A helper class for interpolating between times during particle tracing. More...

#include <vtkTemporalInterpolatedVelocityField.h>

Inherits vtkFunctionSet.

Public Types

typedef vtkFunctionSet Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkTemporalInterpolatedVelocityFieldNewInstance () const
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 
void SetDataSetAtTime (int I, int N, double T, vtkDataSet *dataset, bool staticdataset)
 
void ClearCache ()
 
bool InterpolatePoint (vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex)
 
bool InterpolatePoint (int T, vtkPointData *outPD1, vtkIdType outIndex)
 
bool GetVorticityData (int T, double pcoords[3], double *weights, vtkGenericCell *&cell, vtkDoubleArray *cellVectors)
 
void ShowCacheResults ()
 
bool IsStatic (int datasetIndex)
 
void AdvanceOneTimeStep ()
 
virtual int FunctionValues (double *x, double *u)
 
int FunctionValuesAtT (int T, double *x, double *u)
 
void SelectVectors (const char *fieldName)
 
bool GetCachedCellIds (vtkIdType id[2], int ds[2])
 
void SetCachedCellIds (vtkIdType id[2], int ds[2])
 
int TestPoint (double *x)
 
int QuickTestPoint (double *x)
 
virtual double * GetLastGoodVelocity ()
 
virtual void GetLastGoodVelocity (double &, double &, double &)
 
virtual void GetLastGoodVelocity (double[3])
 
virtual double GetCurrentWeight ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static
vtkTemporalInterpolatedVelocityField
SafeDownCast (vtkObjectBase *o)
 
static
vtkTemporalInterpolatedVelocityField
New ()
 

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 
 vtkTemporalInterpolatedVelocityField ()
 
 ~vtkTemporalInterpolatedVelocityField ()
 
int FunctionValues (vtkDataSet *ds, double *x, double *f)
 
virtual void SetVectorsSelection (const char *v)
 

Protected Attributes

double vals1 [3]
 
double vals2 [3]
 
double times [2]
 
double LastGoodVelocity [3]
 
double CurrentWeight
 
double OneMinusWeight
 
double ScaleCoeff
 
vtkSmartPointer
< vtkCachingInterpolatedVelocityField
ivf [2]
 
std::vector< bool > StaticDataSets
 

Detailed Description

A helper class for interpolating between times during particle tracing.

vtkTemporalInterpolatedVelocityField is a general purpose helper for the temporal particle tracing code (vtkTemporalStreamTracer)

It maintains two copies of vtkCachingInterpolatedVelocityField internally and uses them to obtain velocity values at time T0 and T1.

In fact the class does quite a bit more than this because when the geometry of the datasets is the same at T0 and T1, we can re-use cached cell Ids and weights used in the cell interpolation routines. Additionally, the same weights can be used when interpolating (point) scalar values and computing vorticity etc.

Warning
vtkTemporalInterpolatedVelocityField is probably not thread safe. A new instance should be created by each thread.
Datasets are added in lists. The list for T1 must be idential to that for T0 in structure/topology and dataset order, and any datasets marked as static, must remain so for all T - changing a dataset from static to dynamic between time steps will result in undefined behaviour (=crash probably)
See Also
vtkCachingInterpolatedVelocityField vtkTemporalStreamTracer

Definition at line 68 of file vtkTemporalInterpolatedVelocityField.h.

Member Typedef Documentation

Definition at line 71 of file vtkTemporalInterpolatedVelocityField.h.

Constructor & Destructor Documentation

vtkTemporalInterpolatedVelocityField::vtkTemporalInterpolatedVelocityField ( )
protected
vtkTemporalInterpolatedVelocityField::~vtkTemporalInterpolatedVelocityField ( )
protected

Member Function Documentation

static int vtkTemporalInterpolatedVelocityField::IsTypeOf ( const char *  type)
static
virtual int vtkTemporalInterpolatedVelocityField::IsA ( const char *  type)
virtual
static vtkTemporalInterpolatedVelocityField* vtkTemporalInterpolatedVelocityField::SafeDownCast ( vtkObjectBase *  o)
static
virtual vtkObjectBase* vtkTemporalInterpolatedVelocityField::NewInstanceInternal ( ) const
protectedvirtual
vtkTemporalInterpolatedVelocityField* vtkTemporalInterpolatedVelocityField::NewInstance ( ) const
virtual void vtkTemporalInterpolatedVelocityField::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual
static vtkTemporalInterpolatedVelocityField* vtkTemporalInterpolatedVelocityField::New ( )
static

Construct a vtkTemporalInterpolatedVelocityField with no initial data set. Caching is on. LastCellId is set to -1.

virtual int vtkTemporalInterpolatedVelocityField::FunctionValues ( double *  x,
double *  u 
)
virtual

Evaluate the velocity field, f, at (x, y, z, t). For now, t is ignored.

int vtkTemporalInterpolatedVelocityField::FunctionValuesAtT ( int  T,
double *  x,
double *  u 
)

Evaluate the velocity field, f, at (x, y, z, t). For now, t is ignored.

void vtkTemporalInterpolatedVelocityField::SelectVectors ( const char *  fieldName)
inline

If you want to work with an arbitrary vector array, then set its name here. By default this is NULL and the filter will use the active vector array.

Definition at line 89 of file vtkTemporalInterpolatedVelocityField.h.

void vtkTemporalInterpolatedVelocityField::SetDataSetAtTime ( int  I,
int  N,
double  T,
vtkDataSet *  dataset,
bool  staticdataset 
)

In order to use this class, two sets of data must be supplied, corresponding to times T1 and T2. Data is added via this function.

bool vtkTemporalInterpolatedVelocityField::GetCachedCellIds ( vtkIdType  id[2],
int  ds[2] 
)

Between iterations of the Particle Tracer, Id's of the Cell are stored and then at the start of the next particle the Ids are set to 'pre-fill' the cache.

void vtkTemporalInterpolatedVelocityField::SetCachedCellIds ( vtkIdType  id[2],
int  ds[2] 
)

Between iterations of the Particle Tracer, Id's of the Cell are stored and then at the start of the next particle the Ids are set to 'pre-fill' the cache.

void vtkTemporalInterpolatedVelocityField::ClearCache ( )

Set the last cell id to -1 so that the next search does not start from the previous cell

int vtkTemporalInterpolatedVelocityField::TestPoint ( double *  x)

A utility function which evaluates the point at T1, T2 to see if it is inside the data at both times or only one.

int vtkTemporalInterpolatedVelocityField::QuickTestPoint ( double *  x)

A utility function which evaluates the point at T1, T2 to see if it is inside the data at both times or only one.

virtual double* vtkTemporalInterpolatedVelocityField::GetLastGoodVelocity ( )
virtual

If an interpolation was successful, we can retrieve the last computed value from here. Initial value is (0.0,0.0,0.0)

virtual void vtkTemporalInterpolatedVelocityField::GetLastGoodVelocity ( double &  ,
double &  ,
double &   
)
virtual

If an interpolation was successful, we can retrieve the last computed value from here. Initial value is (0.0,0.0,0.0)

virtual void vtkTemporalInterpolatedVelocityField::GetLastGoodVelocity ( double  [3])
virtual

If an interpolation was successful, we can retrieve the last computed value from here. Initial value is (0.0,0.0,0.0)

virtual double vtkTemporalInterpolatedVelocityField::GetCurrentWeight ( )
virtual

Get the most recent weight between 0->1 from T1->T2. Initial value is 0.

bool vtkTemporalInterpolatedVelocityField::InterpolatePoint ( vtkPointData *  outPD1,
vtkPointData *  outPD2,
vtkIdType  outIndex 
)
bool vtkTemporalInterpolatedVelocityField::InterpolatePoint ( int  T,
vtkPointData *  outPD1,
vtkIdType  outIndex 
)
bool vtkTemporalInterpolatedVelocityField::GetVorticityData ( int  T,
double  pcoords[3],
double *  weights,
vtkGenericCell *&  cell,
vtkDoubleArray *  cellVectors 
)
void vtkTemporalInterpolatedVelocityField::ShowCacheResults ( )
bool vtkTemporalInterpolatedVelocityField::IsStatic ( int  datasetIndex)
void vtkTemporalInterpolatedVelocityField::AdvanceOneTimeStep ( )
int vtkTemporalInterpolatedVelocityField::FunctionValues ( vtkDataSet *  ds,
double *  x,
double *  f 
)
protected
virtual void vtkTemporalInterpolatedVelocityField::SetVectorsSelection ( const char *  v)
protectedvirtual

Member Data Documentation

double vtkTemporalInterpolatedVelocityField::vals1[3]
protected

Definition at line 149 of file vtkTemporalInterpolatedVelocityField.h.

double vtkTemporalInterpolatedVelocityField::vals2[3]
protected

Definition at line 150 of file vtkTemporalInterpolatedVelocityField.h.

double vtkTemporalInterpolatedVelocityField::times[2]
protected

Definition at line 151 of file vtkTemporalInterpolatedVelocityField.h.

double vtkTemporalInterpolatedVelocityField::LastGoodVelocity[3]
protected

Definition at line 152 of file vtkTemporalInterpolatedVelocityField.h.

double vtkTemporalInterpolatedVelocityField::CurrentWeight
protected

Definition at line 156 of file vtkTemporalInterpolatedVelocityField.h.

double vtkTemporalInterpolatedVelocityField::OneMinusWeight
protected

Definition at line 158 of file vtkTemporalInterpolatedVelocityField.h.

double vtkTemporalInterpolatedVelocityField::ScaleCoeff
protected

Definition at line 160 of file vtkTemporalInterpolatedVelocityField.h.

vtkSmartPointer<vtkCachingInterpolatedVelocityField> vtkTemporalInterpolatedVelocityField::ivf[2]
protected

Definition at line 162 of file vtkTemporalInterpolatedVelocityField.h.

std::vector<bool> vtkTemporalInterpolatedVelocityField::StaticDataSets
protected

Definition at line 164 of file vtkTemporalInterpolatedVelocityField.h.


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