VTK
vtkStreamTracer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStreamTracer.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 =========================================================================*/
85 #ifndef vtkStreamTracer_h
86 #define vtkStreamTracer_h
87 
88 #include "vtkFiltersFlowPathsModule.h" // For export macro
89 #include "vtkPolyDataAlgorithm.h"
90 
91 #include "vtkInitialValueProblemSolver.h" // Needed for constants
92 
94 class vtkDataArray;
95 class vtkDoubleArray;
96 class vtkExecutive;
97 class vtkGenericCell;
98 class vtkIdList;
99 class vtkIntArray;
101 
103 {
104 public:
106  void PrintSelf(ostream& os, vtkIndent indent);
107 
113  static vtkStreamTracer *New();
114 
116 
119  vtkSetVector3Macro(StartPosition, double);
120  vtkGetVector3Macro(StartPosition, double);
122 
124 
131 
135 
136 //BTX
137  // The previously-supported TIME_UNIT is excluded in this current
138  // enumeration definition because the underlying step size is ALWAYS in
139  // arc length unit (LENGTH_UNIT) while the 'real' time interval (virtual
140  // for steady flows) that a particle actually takes to trave in a single
141  // step is obtained by dividing the arc length by the LOCAL speed. The
142  // overall elapsed time (i.e., the life span) of the particle is the sum
143  // of those individual step-wise time intervals. The arc-length-to-time
144  // conversion only occurs for vorticity computation and for generating a
145  // point data array named 'IntegrationTime'.
146  enum Units
147  {
148  LENGTH_UNIT = 1,
149  CELL_LENGTH_UNIT = 2
150  };
151 
152  enum Solvers
153  {
158  UNKNOWN
159  };
160 
162  {
166  OUT_OF_LENGTH = 4,
167  OUT_OF_STEPS = 5,
168  STAGNATION = 6
169  };
170 //ETX
171 
173 
184  {this->SetIntegratorType(RUNGE_KUTTA2);};
186  {this->SetIntegratorType(RUNGE_KUTTA4);};
188  {this->SetIntegratorType(RUNGE_KUTTA45);};
190 
194 
198 
200 
201  vtkSetMacro(MaximumPropagation, double);
202  vtkGetMacro(MaximumPropagation, double);
204 
206 
210  void SetIntegrationStepUnit( int unit );
211  int GetIntegrationStepUnit() { return this->IntegrationStepUnit; }
213 
215 
219  vtkSetMacro(InitialIntegrationStep, double);
220  vtkGetMacro(InitialIntegrationStep, double);
222 
224 
227  vtkSetMacro(MinimumIntegrationStep, double);
228  vtkGetMacro(MinimumIntegrationStep, double);
230 
232 
235  vtkSetMacro(MaximumIntegrationStep, double);
236  vtkGetMacro(MaximumIntegrationStep, double);
238 
240 
242  vtkSetMacro(MaximumError, double);
243  vtkGetMacro(MaximumError, double);
245 
247 
248  vtkSetMacro(MaximumNumberOfSteps, vtkIdType);
249  vtkGetMacro(MaximumNumberOfSteps, vtkIdType);
251 
253 
255  vtkSetMacro(TerminalSpeed, double);
256  vtkGetMacro(TerminalSpeed, double);
258 
260 
261  vtkGetMacro(SurfaceStreamlines, bool);
262  vtkSetMacro(SurfaceStreamlines, bool);
263  vtkBooleanMacro(SurfaceStreamlines, bool);
265 
266 //BTX
267  enum
268  {
271  BOTH
272  };
273 
274  enum
275  {
277  INTERPOLATOR_WITH_CELL_LOCATOR
278  };
279 //ETX
280 
282 
284  vtkSetClampMacro(IntegrationDirection, int, FORWARD, BOTH);
285  vtkGetMacro(IntegrationDirection, int);
287  {this->SetIntegrationDirection(FORWARD);};
289  {this->SetIntegrationDirection(BACKWARD);};
291  {this->SetIntegrationDirection(BOTH);};
293 
295 
297  vtkSetMacro(ComputeVorticity, bool);
298  vtkGetMacro(ComputeVorticity, bool);
300 
302 
304  vtkSetMacro(RotationScale, double);
305  vtkGetMacro(RotationScale, double);
307 
311 
321  void SetInterpolatorType( int interpType );
322 
323 protected:
324 
327 
328  // Create a default executive.
330 
331  // hide the superclass' AddInput() from the user and the compiler
333  { vtkErrorMacro( << "AddInput() must be called with a vtkDataSet not a vtkDataObject."); };
334 
337 
338  void CalculateVorticity( vtkGenericCell* cell, double pcoords[3],
339  vtkDoubleArray* cellVectors, double vorticity[3] );
340  void Integrate(vtkPointData *inputData,
341  vtkPolyData* output,
342  vtkDataArray* seedSource,
343  vtkIdList* seedIds,
344  vtkIntArray* integrationDirections,
345  double lastPoint[3],
347  int maxCellSize,
348  int vecType,
349  const char *vecFieldName,
350  double& propagation,
351  vtkIdType& numSteps);
352  void SimpleIntegrate(double seed[3],
353  double lastPoint[3],
354  double stepSize,
357  int* maxCellSize);
358  void GenerateNormals(vtkPolyData* output, double* firstNormal, const char *vecName);
359 
361 
362  // starting from global x-y-z position
363  double StartPosition[3];
364 
365  static const double EPSILON;
367 
369 
370 //BTX
372  {
373  double Interval;
374  int Unit;
375  };
376 
381 
382  void ConvertIntervals( double& step, double& minStep, double& maxStep,
383  int direction, double cellLength );
384  static double ConvertToLength( double interval, int unit, double cellLength );
385  static double ConvertToLength( IntervalInformation& interval, double cellLength );
386 
387 //ETX
388 
390  vtkInformation* outInfo);
392  vtkIdList*& seedIds,
393  vtkIntArray*& integrationDirections,
394  vtkDataSet *source);
395 
398 
399  // Prototype showing the integrator type to be set by the user.
401 
402  double MaximumError;
404 
407 
408  // Compute streamlines only on surface.
410 
412 
414  bool HasMatchingPointAttributes; //does the point data in the multiblocks have the same attributes?
415 
416  friend class PStreamTracerUtils;
417 
418 private:
419  vtkStreamTracer(const vtkStreamTracer&); // Not implemented.
420  void operator=(const vtkStreamTracer&); // Not implemented.
421 };
422 
423 
424 #endif
vtkStreamTracer::ConvertToLength
static double ConvertToLength(double interval, int unit, double cellLength)
vtkStreamTracer::InputData
vtkCompositeDataSet * InputData
Definition: vtkStreamTracer.h:413
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkStreamTracer::SetIntegratorTypeToRungeKutta2
void SetIntegratorTypeToRungeKutta2()
Definition: vtkStreamTracer.h:183
vtkStreamTracer::TerminalSpeed
double TerminalSpeed
Definition: vtkStreamTracer.h:366
vtkStreamTracer::ConvertIntervals
void ConvertIntervals(double &step, double &minStep, double &maxStep, int direction, double cellLength)
vtkStreamTracer::HasMatchingPointAttributes
bool HasMatchingPointAttributes
Definition: vtkStreamTracer.h:414
vtkStreamTracer::GenerateNormalsInIntegrate
bool GenerateNormalsInIntegrate
Definition: vtkStreamTracer.h:360
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkStreamTracer::CalculateVorticity
void CalculateVorticity(vtkGenericCell *cell, double pcoords[3], vtkDoubleArray *cellVectors, double vorticity[3])
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkStreamTracer::GetIntegrationStepUnit
int GetIntegrationStepUnit()
Definition: vtkStreamTracer.h:211
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkStreamTracer::SetSourceData
void SetSourceData(vtkDataSet *source)
vtkStreamTracer::BACKWARD
@ BACKWARD
Definition: vtkStreamTracer.h:270
vtkStreamTracer::GenerateNormals
void GenerateNormals(vtkPolyData *output, double *firstNormal, const char *vecName)
vtkStreamTracer::Integrate
void Integrate(vtkPointData *inputData, vtkPolyData *output, vtkDataArray *seedSource, vtkIdList *seedIds, vtkIntArray *integrationDirections, double lastPoint[3], vtkAbstractInterpolatedVelocityField *func, int maxCellSize, int vecType, const char *vecFieldName, double &propagation, vtkIdType &numSteps)
vtkX3D::direction
@ direction
Definition: vtkX3D.h:260
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkStreamTracer::Integrator
vtkInitialValueProblemSolver * Integrator
Definition: vtkStreamTracer.h:400
vtkStreamTracer::MaximumPropagation
double MaximumPropagation
Definition: vtkStreamTracer.h:377
vtkStreamTracer::SimpleIntegrate
void SimpleIntegrate(double seed[3], double lastPoint[3], double stepSize, vtkAbstractInterpolatedVelocityField *func)
vtkStreamTracer::SetIntegrationStepUnit
void SetIntegrationStepUnit(int unit)
vtkStreamTracer::IntervalInformation::Interval
double Interval
Definition: vtkStreamTracer.h:373
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
VTKFILTERSFLOWPATHS_EXPORT
#define VTKFILTERSFLOWPATHS_EXPORT
Definition: vtkFiltersFlowPathsModule.h:15
vtkStreamTracer::SetIntegrationDirectionToForward
void SetIntegrationDirectionToForward()
Definition: vtkStreamTracer.h:286
vtkStreamTracer::MaximumError
double MaximumError
Definition: vtkStreamTracer.h:402
vtkFiltersFlowPathsModule.h
vtkStreamTracer::FORWARD
@ FORWARD
Definition: vtkStreamTracer.h:269
vtkgl::func
GLenum func
Definition: vtkgl.h:11980
vtkStreamTracer::InitializeSeeds
void InitializeSeeds(vtkDataArray *&seeds, vtkIdList *&seedIds, vtkIntArray *&integrationDirections, vtkDataSet *source)
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkStreamTracer::SetSourceConnection
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
vtkErrorMacro
#define vtkErrorMacro(x)
Definition: vtkSetGet.h:478
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:51
vtkStreamTracer::ConvertToLength
static double ConvertToLength(IntervalInformation &interval, double cellLength)
vtkStreamTracer::ComputeVorticity
bool ComputeVorticity
Definition: vtkStreamTracer.h:405
vtkPolyDataAlgorithm.h
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:821
vtkStreamTracer::SetInterpolatorTypeToCellLocator
void SetInterpolatorTypeToCellLocator()
vtkStreamTracer::INTERPOLATOR_WITH_DATASET_POINT_LOCATOR
@ INTERPOLATOR_WITH_DATASET_POINT_LOCATOR
Definition: vtkStreamTracer.h:276
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkExecutive
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:52
vtkStreamTracer::MaximumNumberOfSteps
vtkIdType MaximumNumberOfSteps
Definition: vtkStreamTracer.h:403
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkStreamTracer::SetIntegrator
void SetIntegrator(vtkInitialValueProblemSolver *)
vtkStreamTracer::SetIntegrationDirectionToBoth
void SetIntegrationDirectionToBoth()
Definition: vtkStreamTracer.h:290
vtkStreamTracer::vtkStreamTracer
vtkStreamTracer()
vtkStreamTracer::~vtkStreamTracer
~vtkStreamTracer()
vtkStreamTracer::LastUsedStepSize
double LastUsedStepSize
Definition: vtkStreamTracer.h:368
vtkStreamTracer::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkStreamTracer::NONE
@ NONE
Definition: vtkStreamTracer.h:157
vtkStreamTracer::SetIntegratorTypeToRungeKutta45
void SetIntegratorTypeToRungeKutta45()
Definition: vtkStreamTracer.h:187
vtkStreamTracer::MinimumIntegrationStep
double MinimumIntegrationStep
Definition: vtkStreamTracer.h:378
vtkStreamTracer::IntervalInformation
Definition: vtkStreamTracer.h:372
vtkStreamTracer::EPSILON
static const double EPSILON
Definition: vtkStreamTracer.h:365
vtkStreamTracer::RUNGE_KUTTA4
@ RUNGE_KUTTA4
Definition: vtkStreamTracer.h:155
vtkStreamTracer::SetupOutput
int SetupOutput(vtkInformation *inInfo, vtkInformation *outInfo)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInitialValueProblemSolver.h
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:53
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkStreamTracer::AddInput
void AddInput(vtkDataObject *)
Definition: vtkStreamTracer.h:332
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkStreamTracer
Streamline generator.
Definition: vtkStreamTracer.h:103
vtkStreamTracer::GetSource
vtkDataSet * GetSource()
vtkInitialValueProblemSolver::UNEXPECTED_VALUE
@ UNEXPECTED_VALUE
Definition: vtkInitialValueProblemSolver.h:108
vtkStreamTracer::GetIntegratorType
int GetIntegratorType()
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkAbstractInterpolatedVelocityField
An abstract class for obtaining the interpolated velocity values at a point.
Definition: vtkAbstractInterpolatedVelocityField.h:85
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkStreamTracer::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkStreamTracer::Units
Units
Definition: vtkStreamTracer.h:147
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkStreamTracer::RUNGE_KUTTA45
@ RUNGE_KUTTA45
Definition: vtkStreamTracer.h:156
vtkStreamTracer::CheckInputs
int CheckInputs(vtkAbstractInterpolatedVelocityField *&func, int *maxCellSize)
vtkStreamTracer::IntegrationStepUnit
int IntegrationStepUnit
Definition: vtkStreamTracer.h:396
vtkStreamTracer::InterpolatorPrototype
vtkAbstractInterpolatedVelocityField * InterpolatorPrototype
Definition: vtkStreamTracer.h:411
vtkStreamTracer::IntervalInformation::Unit
int Unit
Definition: vtkStreamTracer.h:374
vtkStreamTracer::IntegrationDirection
int IntegrationDirection
Definition: vtkStreamTracer.h:397
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkStreamTracer::CreateDefaultExecutive
virtual vtkExecutive * CreateDefaultExecutive()
vtkStreamTracer::SurfaceStreamlines
bool SurfaceStreamlines
Definition: vtkStreamTracer.h:409
vtkStreamTracer::InitialIntegrationStep
double InitialIntegrationStep
Definition: vtkStreamTracer.h:380
vtkStreamTracer::RUNGE_KUTTA2
@ RUNGE_KUTTA2
Definition: vtkStreamTracer.h:154
vtkStreamTracer::SetInterpolatorType
void SetInterpolatorType(int interpType)
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:42
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkStreamTracer::SetInterpolatorTypeToDataSetPointLocator
void SetInterpolatorTypeToDataSetPointLocator()
vtkStreamTracer::SetIntegrationDirectionToBackward
void SetIntegrationDirectionToBackward()
Definition: vtkStreamTracer.h:288
vtkStreamTracer::MaximumIntegrationStep
double MaximumIntegrationStep
Definition: vtkStreamTracer.h:379
vtkInitialValueProblemSolver
Integrate a set of ordinary differential equations (initial value problem) in time.
Definition: vtkInitialValueProblemSolver.h:40
vtkInitialValueProblemSolver::OUT_OF_DOMAIN
@ OUT_OF_DOMAIN
Definition: vtkInitialValueProblemSolver.h:106
vtkStreamTracer::Solvers
Solvers
Definition: vtkStreamTracer.h:153
vtkStreamTracer::ReasonForTermination
ReasonForTermination
Definition: vtkStreamTracer.h:162
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkgl::type
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkStreamTracer::RotationScale
double RotationScale
Definition: vtkStreamTracer.h:406
vtkStreamTracer::New
static vtkStreamTracer * New()
vtkStreamTracer::SetIntegratorTypeToRungeKutta4
void SetIntegratorTypeToRungeKutta4()
Definition: vtkStreamTracer.h:185
vtkStreamTracer::SetInterpolatorPrototype
void SetInterpolatorPrototype(vtkAbstractInterpolatedVelocityField *ivf)
vtkStreamTracer::FillInputPortInformation
virtual int FillInputPortInformation(int, vtkInformation *)
vtkInitialValueProblemSolver::NOT_INITIALIZED
@ NOT_INITIALIZED
Definition: vtkInitialValueProblemSolver.h:107
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44
vtkStreamTracer::SetIntegratorType
void SetIntegratorType(int type)