VTK  9.1.0
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>

Inheritance diagram for vtkTemporalInterpolatedVelocityField:
[legend]
Collaboration diagram for vtkTemporalInterpolatedVelocityField:
[legend]

Public Types

typedef vtkFunctionSet Superclass
 
- Public Types inherited from vtkFunctionSet
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkTemporalInterpolatedVelocityFieldNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void SelectVectors (const char *fieldName)
 If you want to work with an arbitrary vector array, then set its name here. More...
 
void 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. More...
 
void ClearCache ()
 Set the last cell id to -1 so that the next search does not start from the previous cell. More...
 
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 ()
 
int FunctionValues (double *x, double *u) override
 Evaluate the velocity field, f, at (x, y, z, t). More...
 
int FunctionValuesAtT (int T, double *x, double *u)
 Evaluate the velocity field, f, at (x, y, z, t). More...
 
bool 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. More...
 
void 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. More...
 
int 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. More...
 
int 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. More...
 
virtual double * GetLastGoodVelocity ()
 If an interpolation was successful, we can retrieve the last computed value from here. More...
 
virtual void GetLastGoodVelocity (double &, double &, double &)
 If an interpolation was successful, we can retrieve the last computed value from here. More...
 
virtual void GetLastGoodVelocity (double[3])
 If an interpolation was successful, we can retrieve the last computed value from here. More...
 
virtual double GetCurrentWeight ()
 Get the most recent weight between 0->1 from T1->T2. More...
 
- Public Member Functions inherited from vtkFunctionSet
virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkFunctionSetNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual int FunctionValues (double *x, double *f)
 Evaluate functions at x_j. More...
 
virtual int FunctionValues (double *x, double *f, void *vtkNotUsed(userData))
 
virtual int GetNumberOfFunctions ()
 Return the number of functions. More...
 
virtual int GetNumberOfIndependentVariables ()
 Return the number of independent variables. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkTemporalInterpolatedVelocityFieldSafeDownCast (vtkObjectBase *o)
 
static vtkTemporalInterpolatedVelocityFieldNew ()
 Construct a vtkTemporalInterpolatedVelocityField with no initial data set. More...
 
- Static Public Member Functions inherited from vtkFunctionSet
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkFunctionSetSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkTemporalInterpolatedVelocityField ()
 
 ~vtkTemporalInterpolatedVelocityField () override
 
int FunctionValues (vtkDataSet *ds, double *x, double *f)
 
virtual void SetVectorsSelection (const char *v)
 
- Protected Member Functions inherited from vtkFunctionSet
virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkFunctionSet ()
 
 ~vtkFunctionSet () override=default
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

double Vals1 [3]
 
double Vals2 [3]
 
double Times [2]
 
double LastGoodVelocity [3]
 
double CurrentWeight
 
double OneMinusWeight
 
double ScaleCoeff
 
vtkSmartPointer< vtkCachingInterpolatedVelocityFieldIVF [2]
 
std::vector< bool > StaticDataSets
 
- Protected Attributes inherited from vtkFunctionSet
int NumFuncs
 
int NumIndepVars
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Detailed Description

A helper class for interpolating between times during particle tracing.

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

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 identical 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 vtkParticleTracerBase vtkParticleTracer vtkParticlePathFilter vtkStreaklineFilter

Definition at line 69 of file vtkTemporalInterpolatedVelocityField.h.

Member Typedef Documentation

◆ Superclass

Definition at line 72 of file vtkTemporalInterpolatedVelocityField.h.

Constructor & Destructor Documentation

◆ vtkTemporalInterpolatedVelocityField()

vtkTemporalInterpolatedVelocityField::vtkTemporalInterpolatedVelocityField ( )
protected

◆ ~vtkTemporalInterpolatedVelocityField()

vtkTemporalInterpolatedVelocityField::~vtkTemporalInterpolatedVelocityField ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkTemporalInterpolatedVelocityField::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool 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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkFunctionSet.

◆ SafeDownCast()

static vtkTemporalInterpolatedVelocityField * vtkTemporalInterpolatedVelocityField::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkTemporalInterpolatedVelocityField::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkFunctionSet.

◆ NewInstance()

vtkTemporalInterpolatedVelocityField * vtkTemporalInterpolatedVelocityField::NewInstance ( ) const

◆ PrintSelf()

void vtkTemporalInterpolatedVelocityField::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

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.

◆ New()

static vtkTemporalInterpolatedVelocityField * vtkTemporalInterpolatedVelocityField::New ( )
static

Construct a vtkTemporalInterpolatedVelocityField with no initial data set.

Caching is on. LastCellId is set to -1.

◆ FunctionValues() [1/2]

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

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

For now, t is ignored.

Reimplemented from vtkFunctionSet.

◆ FunctionValuesAtT()

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

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

For now, t is ignored.

◆ SelectVectors()

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 nullptr and the filter will use the active vector array.

Definition at line 96 of file vtkTemporalInterpolatedVelocityField.h.

◆ SetDataSetAtTime()

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.

◆ GetCachedCellIds()

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.

◆ SetCachedCellIds()

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.

◆ ClearCache()

void vtkTemporalInterpolatedVelocityField::ClearCache ( )

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

◆ TestPoint()

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.

◆ QuickTestPoint()

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.

◆ GetLastGoodVelocity() [1/3]

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)

◆ GetLastGoodVelocity() [2/3]

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)

◆ GetLastGoodVelocity() [3/3]

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)

◆ GetCurrentWeight()

virtual double vtkTemporalInterpolatedVelocityField::GetCurrentWeight ( )
virtual

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

Initial value is 0.

◆ InterpolatePoint() [1/2]

bool vtkTemporalInterpolatedVelocityField::InterpolatePoint ( vtkPointData outPD1,
vtkPointData outPD2,
vtkIdType  outIndex 
)

◆ InterpolatePoint() [2/2]

bool vtkTemporalInterpolatedVelocityField::InterpolatePoint ( int  T,
vtkPointData outPD1,
vtkIdType  outIndex 
)

◆ GetVorticityData()

bool vtkTemporalInterpolatedVelocityField::GetVorticityData ( int  T,
double  pcoords[3],
double *  weights,
vtkGenericCell *&  cell,
vtkDoubleArray cellVectors 
)

◆ ShowCacheResults()

void vtkTemporalInterpolatedVelocityField::ShowCacheResults ( )

◆ IsStatic()

bool vtkTemporalInterpolatedVelocityField::IsStatic ( int  datasetIndex)

◆ AdvanceOneTimeStep()

void vtkTemporalInterpolatedVelocityField::AdvanceOneTimeStep ( )

◆ FunctionValues() [2/2]

int vtkTemporalInterpolatedVelocityField::FunctionValues ( vtkDataSet ds,
double *  x,
double *  f 
)
protected

◆ SetVectorsSelection()

virtual void vtkTemporalInterpolatedVelocityField::SetVectorsSelection ( const char *  v)
protectedvirtual

Member Data Documentation

◆ Vals1

double vtkTemporalInterpolatedVelocityField::Vals1[3]
protected

Definition at line 164 of file vtkTemporalInterpolatedVelocityField.h.

◆ Vals2

double vtkTemporalInterpolatedVelocityField::Vals2[3]
protected

Definition at line 165 of file vtkTemporalInterpolatedVelocityField.h.

◆ Times

double vtkTemporalInterpolatedVelocityField::Times[2]
protected

Definition at line 166 of file vtkTemporalInterpolatedVelocityField.h.

◆ LastGoodVelocity

double vtkTemporalInterpolatedVelocityField::LastGoodVelocity[3]
protected

Definition at line 167 of file vtkTemporalInterpolatedVelocityField.h.

◆ CurrentWeight

double vtkTemporalInterpolatedVelocityField::CurrentWeight
protected

Definition at line 171 of file vtkTemporalInterpolatedVelocityField.h.

◆ OneMinusWeight

double vtkTemporalInterpolatedVelocityField::OneMinusWeight
protected

Definition at line 173 of file vtkTemporalInterpolatedVelocityField.h.

◆ ScaleCoeff

double vtkTemporalInterpolatedVelocityField::ScaleCoeff
protected

Definition at line 175 of file vtkTemporalInterpolatedVelocityField.h.

◆ IVF

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

Definition at line 177 of file vtkTemporalInterpolatedVelocityField.h.

◆ StaticDataSets

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

Definition at line 179 of file vtkTemporalInterpolatedVelocityField.h.


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