VTK
vtkTemporalInterpolatedVelocityField.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTemporalInterpolatedVelocityField.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
47#ifndef vtkTemporalInterpolatedVelocityField_h
48#define vtkTemporalInterpolatedVelocityField_h
49
50#include "vtkFiltersFlowPathsModule.h" // For export macro
51#include "vtkFunctionSet.h"
52#include "vtkSmartPointer.h" // because it is good
53
54#include <vector> // Because they are good
55
56#define ID_INSIDE_ALL 00
57#define ID_OUTSIDE_ALL 01
58#define ID_OUTSIDE_T0 02
59#define ID_OUTSIDE_T1 03
60
61class vtkDataSet;
62class vtkDataArray;
63class vtkPointData;
64class vtkGenericCell;
65class vtkDoubleArray;
67
68class VTKFILTERSFLOWPATHS_EXPORT vtkTemporalInterpolatedVelocityField : public vtkFunctionSet
69{
70public:
72 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
73
79
81
85 virtual int FunctionValues(double* x, double* u);
86 int FunctionValuesAtT(int T, double* x, double* u);
88
94 void SelectVectors(const char *fieldName)
95 {this->SetVectorsSelection(fieldName);}
96
102 void SetDataSetAtTime(int I, int N, double T, vtkDataSet* dataset, bool staticdataset);
103
105
110 bool GetCachedCellIds(vtkIdType id[2], int ds[2]);
111 void SetCachedCellIds(vtkIdType id[2], int ds[2]);
113
119
121
125 int TestPoint(double* x);
126 int QuickTestPoint(double* x);
128
130
134 vtkGetVector3Macro(LastGoodVelocity,double);
136
138
141 vtkGetMacro(CurrentWeight,double);
143
145 vtkPointData *outPD2, vtkIdType outIndex);
146
147 bool InterpolatePoint(int T, vtkPointData *outPD1, vtkIdType outIndex);
148
150 int T, double pcoords[3], double *weights,
151 vtkGenericCell *&cell, vtkDoubleArray *cellVectors);
152
154 bool IsStatic(int datasetIndex);
155
157
158protected:
161
162 int FunctionValues(vtkDataSet* ds, double* x, double* f);
163 virtual void SetVectorsSelection(const char *v);
164
165 double Vals1[3];
166 double Vals2[3];
167 double Times[2];
168 double LastGoodVelocity[3];
169
170 // The weight (0.0->1.0) of the value of T between the two avaiable
171 // time values for the current computation
173 // One minus the CurrentWeight
175 // A scaling factor used when calculating the CurrentWeight { 1.0/(T2-T1) }
177
179 // we want to keep track of static datasets so we can optimize caching
180 std::vector<bool> StaticDataSets;
181
182private:
183 // Hide this since we need multiple time steps and are using a different
184 // function prototype
185 virtual void AddDataSet(vtkDataSet*) {}
186
187private:
189 void operator=(const vtkTemporalInterpolatedVelocityField&) VTK_DELETE_FUNCTION;
190};
191
192#endif
Interface for obtaining interpolated velocity values.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
dynamic, self-adjusting array of double
Abstract interface for sets of functions.
provides thread-safe access to cells
a simple class to control print indentation
Definition: vtkIndent.h:40
represent and manipulate point attribute data
Definition: vtkPointData.h:38
A helper class for interpolating between times during particle tracing.
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 ...
bool IsStatic(int datasetIndex)
bool InterpolatePoint(vtkPointData *outPD1, vtkPointData *outPD2, vtkIdType outIndex)
int FunctionValues(vtkDataSet *ds, double *x, double *f)
void SelectVectors(const char *fieldName)
If you want to work with an arbitrary vector array, then set its name here.
virtual void SetVectorsSelection(const char *v)
bool GetVorticityData(int T, double pcoords[3], double *weights, vtkGenericCell *&cell, vtkDoubleArray *cellVectors)
virtual int FunctionValues(double *x, double *u)
Evaluate the velocity field, f, at (x, y, z, t).
bool InterpolatePoint(int T, vtkPointData *outPD1, vtkIdType outIndex)
void SetCachedCellIds(vtkIdType id[2], int ds[2])
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 n...
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.
void ClearCache()
Set the last cell id to -1 so that the next search does not start from the previous cell.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FunctionValuesAtT(int T, double *x, double *u)
static vtkTemporalInterpolatedVelocityField * New()
Construct a vtkTemporalInterpolatedVelocityField with no initial data set.
int vtkIdType
Definition: vtkType.h:287