#include <vtkTemporalInterpolatedVelocityField.h>
vtkTemporalInterpolatedVelocityField is a temporal version of vtk vtkInterpolatedVelocityField. I maintains two copies of vtkInterpolatedVelocityField internally and uses them to obtain velocity values at time T1 and T2. In fact the class does quite a bit more than this because when the geometry of the datasets is the same at T1 and T2, 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, so the class acts as a general purpose helper for the temporal particle tracing code (vtkTemporalStreamTracer)
Definition at line 56 of file vtkTemporalInterpolatedVelocityField.h.
Public Types | |
typedef vtkFunctionSet | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
virtual int | FunctionValues (double *x, double *u) |
void | AddDataSetAtTime (int N, double T, vtkDataSet *dataset) |
void | ClearCache () |
int | TestPoint (double *x) |
bool | InterpolatePoint (vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex) |
bool | InterpolatePointAtT (int T, vtkPointData *outPD, vtkIdType outIndex) |
bool | GetVorticityData (int T, double pcoords[3], double *weights, vtkGenericCell *&cell, vtkDoubleArray *cellVectors) |
void | SelectVectors (const char *fieldName) |
void | SetGeometryFixed (int g) |
int | GetGeometryFixed () |
bool | GetCachedCellIds (vtkIdType id[2], int ds[2]) |
void | SetCachedCellIds (vtkIdType id[2], int ds[2]) |
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 (vtkObject *o) |
static vtkTemporalInterpolatedVelocityField * | New () |
Protected Member Functions | |
vtkTemporalInterpolatedVelocityField () | |
~vtkTemporalInterpolatedVelocityField () | |
int | FunctionValues (vtkDataSet *ds, double *x, double *f) |
virtual void | SetVectorsSelection (const char *v) |
Protected Attributes | |
vtkInterpolatedVelocityField * | ivf [2] |
double | vals1 [3] |
double | vals2 [3] |
double | times [2] |
double | LastGoodVelocity [3] |
double | CurrentWeight |
double | OneMinusWeight |
double | ScaleCoeff |
int | GeometryFixed |
vtkTInterpolatedVelocityFieldDataSetsType * | DataSets [2] |
Reimplemented from vtkFunctionSet.
Definition at line 59 of file vtkTemporalInterpolatedVelocityField.h.
vtkTemporalInterpolatedVelocityField::vtkTemporalInterpolatedVelocityField | ( | ) | [protected] |
vtkTemporalInterpolatedVelocityField::~vtkTemporalInterpolatedVelocityField | ( | ) | [protected] |
virtual const char* vtkTemporalInterpolatedVelocityField::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkFunctionSet.
static int vtkTemporalInterpolatedVelocityField::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 vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkFunctionSet.
virtual int vtkTemporalInterpolatedVelocityField::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 vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkFunctionSet.
static vtkTemporalInterpolatedVelocityField* vtkTemporalInterpolatedVelocityField::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkFunctionSet.
virtual void vtkTemporalInterpolatedVelocityField::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.
static vtkTemporalInterpolatedVelocityField* vtkTemporalInterpolatedVelocityField::New | ( | ) | [static] |
Construct a vtkTemporalInterpolatedVelocityField with no initial data set. Caching is on. LastCellId is set to -1.
Reimplemented from vtkObject.
virtual int vtkTemporalInterpolatedVelocityField::FunctionValues | ( | double * | x, | |
double * | u | |||
) | [virtual] |
Evaluate the velocity field, f, at (x, y, z, t). For now, t is ignored.
Implements vtkFunctionSet.
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 74 of file vtkTemporalInterpolatedVelocityField.h.
void vtkTemporalInterpolatedVelocityField::AddDataSetAtTime | ( | int | N, | |
double | T, | |||
vtkDataSet * | dataset | |||
) |
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.
void vtkTemporalInterpolatedVelocityField::SetGeometryFixed | ( | int | g | ) | [inline] |
Allow the algorithm using us to turn on/off caching of CellIds between datasets. If true, then calculations on the second set of data (T2) use the weights from T1 without any error checking. Use with caution. We don't use a SetGetMacro to avoid calling Modified()
Definition at line 87 of file vtkTemporalInterpolatedVelocityField.h.
int vtkTemporalInterpolatedVelocityField::GetGeometryFixed | ( | ) | [inline] |
Allow the algorithm using us to turn on/off caching of CellIds between datasets. If true, then calculations on the second set of data (T2) use the weights from T1 without any error checking. Use with caution. We don't use a SetGetMacro to avoid calling Modified()
Definition at line 89 of file vtkTemporalInterpolatedVelocityField.h.
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.
virtual double* vtkTemporalInterpolatedVelocityField::GetLastGoodVelocity | ( | ) | [virtual] |
If an interpolation was successful, we can retrieve the last computed value from here.
virtual void vtkTemporalInterpolatedVelocityField::GetLastGoodVelocity | ( | double & | , | |
double & | , | |||
double & | ||||
) | [virtual] |
If an interpolation was successful, we can retrieve the last computed value from here.
virtual void vtkTemporalInterpolatedVelocityField::GetLastGoodVelocity | ( | double | [3] | ) | [virtual] |
If an interpolation was successful, we can retrieve the last computed value from here.
virtual double vtkTemporalInterpolatedVelocityField::GetCurrentWeight | ( | ) | [virtual] |
Get the most recent weight between 0->1 from T1->T2
bool vtkTemporalInterpolatedVelocityField::InterpolatePoint | ( | vtkPointData * | outPD1, | |
vtkPointData * | outPD2, | |||
vtkIdType | outIndex | |||
) |
bool vtkTemporalInterpolatedVelocityField::InterpolatePointAtT | ( | int | T, | |
vtkPointData * | outPD, | |||
vtkIdType | outIndex | |||
) |
bool vtkTemporalInterpolatedVelocityField::GetVorticityData | ( | int | T, | |
double | pcoords[3], | |||
double * | weights, | |||
vtkGenericCell *& | cell, | |||
vtkDoubleArray * | cellVectors | |||
) |
int vtkTemporalInterpolatedVelocityField::FunctionValues | ( | vtkDataSet * | ds, | |
double * | x, | |||
double * | f | |||
) | [protected] |
virtual void vtkTemporalInterpolatedVelocityField::SetVectorsSelection | ( | const char * | v | ) | [protected, virtual] |
Definition at line 133 of file vtkTemporalInterpolatedVelocityField.h.
double vtkTemporalInterpolatedVelocityField::vals1[3] [protected] |
Definition at line 138 of file vtkTemporalInterpolatedVelocityField.h.
double vtkTemporalInterpolatedVelocityField::vals2[3] [protected] |
Definition at line 139 of file vtkTemporalInterpolatedVelocityField.h.
double vtkTemporalInterpolatedVelocityField::times[2] [protected] |
Definition at line 140 of file vtkTemporalInterpolatedVelocityField.h.
double vtkTemporalInterpolatedVelocityField::LastGoodVelocity[3] [protected] |
Definition at line 141 of file vtkTemporalInterpolatedVelocityField.h.
double vtkTemporalInterpolatedVelocityField::CurrentWeight [protected] |
Definition at line 145 of file vtkTemporalInterpolatedVelocityField.h.
double vtkTemporalInterpolatedVelocityField::OneMinusWeight [protected] |
Definition at line 147 of file vtkTemporalInterpolatedVelocityField.h.
double vtkTemporalInterpolatedVelocityField::ScaleCoeff [protected] |
Definition at line 149 of file vtkTemporalInterpolatedVelocityField.h.
int vtkTemporalInterpolatedVelocityField::GeometryFixed [protected] |
Definition at line 152 of file vtkTemporalInterpolatedVelocityField.h.
vtkTInterpolatedVelocityFieldDataSetsType* vtkTemporalInterpolatedVelocityField::DataSets[2] [protected] |
Definition at line 155 of file vtkTemporalInterpolatedVelocityField.h.