VTK
vtkLagrangianParticleTracker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLagrangianParticleTracker.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 =========================================================================*/
87 #ifndef vtkLagrangianParticleTracker_h
88 #define vtkLagrangianParticleTracker_h
89 
90 #include "vtkFiltersFlowPathsModule.h" // For export macro
91 #include "vtkDataObjectAlgorithm.h"
92 
93 #include <queue> // for particle queue
94 
95 class vtkBoundingBox;
96 class vtkCellArray;
97 class vtkDataSet;
98 class vtkDoubleArray;
99 class vtkIdList;
100 class vtkInformation;
104 class vtkPointData;
105 class vtkPoints;
106 class vtkPolyData;
107 
108 class VTKFILTERSFLOWPATHS_EXPORT vtkLagrangianParticleTracker :
110 {
111 public:
112 
114  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
116 
117  typedef enum CellLengthComputation{
118  STEP_LAST_CELL_LENGTH = 0,
119  STEP_CUR_CELL_LENGTH = 1,
120  STEP_LAST_CELL_VEL_DIR = 2,
121  STEP_CUR_CELL_VEL_DIR = 3,
122  STEP_LAST_CELL_DIV_THEO = 4,
123  STEP_CUR_CELL_DIV_THEO = 5
124  } CellLengthComputation;
125 
127 
130  void SetIntegrationModel(vtkLagrangianBasicIntegrationModel* integrationModel);
131  vtkGetObjectMacro(IntegrationModel, vtkLagrangianBasicIntegrationModel);
133 
135 
138  void SetIntegrator(vtkInitialValueProblemSolver* integrator);
139  vtkGetObjectMacro(Integrator, vtkInitialValueProblemSolver);
141 
143 
167  vtkSetMacro(CellLengthComputationMode, int);
168  vtkGetMacro(CellLengthComputationMode, int);
170 
172 
175  vtkSetMacro(StepFactor, double);
176  vtkGetMacro(StepFactor, double);
178 
180 
183  vtkSetMacro(StepFactorMin, double);
184  vtkGetMacro(StepFactorMin, double);
186 
188 
191  vtkSetMacro(StepFactorMax, double);
192  vtkGetMacro(StepFactorMax, double);
194 
196 
199  vtkSetMacro(MaximumNumberOfSteps, int);
200  vtkGetMacro(MaximumNumberOfSteps, int);
202 
204 
209  vtkSetMacro(AdaptiveStepReintegration, bool);
210  vtkGetMacro(AdaptiveStepReintegration, bool);
211  vtkBooleanMacro(AdaptiveStepReintegration, bool);
213 
215 
218  vtkSetMacro(UseParticlePathsRenderingThreshold, bool);
219  vtkGetMacro(UseParticlePathsRenderingThreshold, bool);
220  vtkBooleanMacro(UseParticlePathsRenderingThreshold, bool);
222 
224 
227  vtkSetMacro(ParticlePathsRenderingPointsThreshold, int);
228  vtkGetMacro(ParticlePathsRenderingPointsThreshold, int);
230 
232 
235  vtkSetMacro(CreateOutOfDomainParticle, bool);
236  vtkGetMacro(CreateOutOfDomainParticle, bool);
237  vtkBooleanMacro(CreateOutOfDomainParticle, bool);
239 
241 
247  void SetSourceData(vtkDataObject* source);
248  vtkDataObject* GetSource();
250 
254  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
255 
257 
263  void SetSurfaceData(vtkDataObject *source);
264  vtkDataObject *GetSurface();
266 
270  void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
271 
275  int FillInputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
276 
280  int FillOutputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
281 
287  vtkInformationVector*) VTK_OVERRIDE;
288 
292  int RequestData(vtkInformation *request,
293  vtkInformationVector **inputVector,
294  vtkInformationVector *outputVector) VTK_OVERRIDE;
295 
300  vtkMTimeType GetMTime() VTK_OVERRIDE;
301 
305  virtual vtkIdType GetNewParticleId();
306 
307 protected:
309  ~vtkLagrangianParticleTracker() VTK_OVERRIDE;
310 
311  virtual bool InitializeInputs(vtkInformationVector **inputVector,
312  vtkDataObject*& flow, vtkDataObject*& seeds, vtkDataObject*& surfaces,
313  std::queue<vtkLagrangianParticle*>& particleQueue, vtkPointData* seedData);
314  virtual bool InitializeFlow(vtkDataObject* flow, vtkBoundingBox* bounds);
315  virtual bool InitializeParticles(const vtkBoundingBox* bounds, vtkDataObject* seeds,
316  std::queue<vtkLagrangianParticle*>& particles, vtkPointData* seedData);
317  virtual void GenerateParticles(const vtkBoundingBox* bounds, vtkDataSet* seeds,
318  vtkDataArray* initialVelocities, vtkDataArray* initialIntegrationTimes,
319  vtkPointData* seedData, int nVar, std::queue<vtkLagrangianParticle*>& particles);
320  virtual void InitializeSurface(vtkDataObject*& surfaces);
321  virtual bool InitializeOutputs(vtkInformationVector *outputVector, vtkPointData* seedData,
322  vtkIdType numberOfSeeds, vtkDataObject* surfaces,
323  vtkPolyData*& particlePathsOutput, vtkDataObject*& interactionOutput);
324 
325  virtual bool InitializePathsOutput(vtkInformationVector *outputVector,
326  vtkPointData* seedData, vtkIdType numberOfSeeds,
327  vtkPolyData*& particlePathsOutput);
328 
329  virtual bool InitializeInteractionOutput(vtkInformationVector *outputVector,
330  vtkPointData* seedData, vtkDataObject* surfaces, vtkDataObject*& interractionOutput);
331 
332  virtual void InitializeParticleData(vtkFieldData* particleData, int maxTuples = 0);
333  virtual void InitializePathData(vtkFieldData* data);
334  virtual void InitializeInteractionData(vtkFieldData* data);
335 
336  virtual bool FinalizeOutputs(vtkPolyData* particlePathsOutput,
337  vtkDataObject* interractionOutput);
338 
339  static void InsertPolyVertexCell(vtkPolyData* polydata);
340 
341  virtual void GetParticleFeed(std::queue<vtkLagrangianParticle*>& particleQueue);
342 
343  virtual int Integrate(vtkLagrangianParticle*, std::queue<vtkLagrangianParticle*>&,
344  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
345  vtkDataObject* interactionOutput);
346 
347  void InsertPathOutputPoint(vtkLagrangianParticle* particle,
348  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
349  bool prev = false);
350 
351  void InsertInteractionOutputPoint(vtkLagrangianParticle* particle,
352  unsigned int interactedSurfaceFlatIndex, vtkDataObject* interactionOutput);
353 
354  void InsertSeedData(vtkLagrangianParticle* particle, vtkFieldData* data);
355  void InsertPathData(vtkLagrangianParticle* particle, vtkFieldData* data);
356  void InsertInteractionData(vtkLagrangianParticle* particle, vtkFieldData* data);
357  void InsertParticleData(vtkLagrangianParticle* particle, vtkFieldData* data, int stepEnum);
358 
359  double ComputeCellLength(vtkLagrangianParticle* particle);
360 
361  bool ComputeNextStep(
362  double* xprev, double* xnext,
363  double t, double& delT, double& delTActual,
364  double minStep, double maxStep,
365  int& integrationRes);
366 
367  virtual bool CheckParticlePathsRenderingThreshold(vtkPolyData* particlePathsOutput);
368 
371 
372  int CellLengthComputationMode;
373  double StepFactor;
374  double StepFactorMin;
375  double StepFactorMax;
376  int MaximumNumberOfSteps;
377  bool AdaptiveStepReintegration;
378  bool UseParticlePathsRenderingThreshold;
379  int ParticlePathsRenderingPointsThreshold;
380  bool CreateOutOfDomainParticle;
381  vtkIdType ParticleCounter;
382 
383  // internal parameters use for step computation
384  double MinimumVelocityMagnitude;
385  double MinimumReductionFactor;
386 private:
387  vtkLagrangianParticleTracker(const vtkLagrangianParticleTracker&) VTK_DELETE_FUNCTION;
388  void operator=(const vtkLagrangianParticleTracker&) VTK_DELETE_FUNCTION;
389 };
390 
391 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
represent and manipulate point attribute data
Definition: vtkPointData.h:31
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
static vtkDataObjectAlgorithm * New()
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Proxy object to connect input/output ports.
dynamic, self-adjusting array of double
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkFunctionSet abstract implementation to be used in the vtkLagrangianParticleTracker integrator...
list of point or cell ids
Definition: vtkIdList.h:30
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
Basis class for Lagrangian particles.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Superclass for algorithms that produce only data object as output.
object to represent cell connectivity
Definition: vtkCellArray.h:44
Store zero or more vtkInformation instances.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:58
Filter to inject and track particles in a flow.
represent and manipulate 3D points
Definition: vtkPoints.h:33
Fast Simple Class for dealing with 3D bounds.
represent and manipulate fields of data
Definition: vtkFieldData.h:53
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Integrate a set of ordinary differential equations (initial value problem) in time.