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 =========================================================================*/
90 #ifndef vtkLagrangianParticleTracker_h
91 #define vtkLagrangianParticleTracker_h
92 
93 #include "vtkFiltersFlowPathsModule.h" // For export macro
94 #include "vtkDataObjectAlgorithm.h"
95 #include "vtkBoundingBox.h" // For cached bounds
96 
97 #include <queue> // for particle queue
98 
99 class vtkBoundingBox;
100 class vtkCellArray;
101 class vtkDataSet;
102 class vtkDoubleArray;
103 class vtkIdList;
104 class vtkInformation;
108 class vtkPointData;
109 class vtkPoints;
110 class vtkPolyData;
111 
112 class VTKFILTERSFLOWPATHS_EXPORT vtkLagrangianParticleTracker :
114 {
115 public:
116 
118  void PrintSelf(ostream& os, vtkIndent indent) override;
120 
121  typedef enum CellLengthComputation{
122  STEP_LAST_CELL_LENGTH = 0,
123  STEP_CUR_CELL_LENGTH = 1,
124  STEP_LAST_CELL_VEL_DIR = 2,
125  STEP_CUR_CELL_VEL_DIR = 3,
126  STEP_LAST_CELL_DIV_THEO = 4,
127  STEP_CUR_CELL_DIV_THEO = 5
129 
131 
135  void SetIntegrationModel(vtkLagrangianBasicIntegrationModel* integrationModel);
136  vtkGetObjectMacro(IntegrationModel, vtkLagrangianBasicIntegrationModel);
138 
140 
144  void SetIntegrator(vtkInitialValueProblemSolver* integrator);
145  vtkGetObjectMacro(Integrator, vtkInitialValueProblemSolver);
147 
149 
154  vtkSetMacro(GeneratePolyVertexInteractionOutput, bool);
155  vtkGetMacro(GeneratePolyVertexInteractionOutput, bool);
157 
159 
184  vtkSetMacro(CellLengthComputationMode, int);
185  vtkGetMacro(CellLengthComputationMode, int);
187 
189 
192  vtkSetMacro(StepFactor, double);
193  vtkGetMacro(StepFactor, double);
195 
197 
200  vtkSetMacro(StepFactorMin, double);
201  vtkGetMacro(StepFactorMin, double);
203 
205 
208  vtkSetMacro(StepFactorMax, double);
209  vtkGetMacro(StepFactorMax, double);
211 
213 
216  vtkSetMacro(MaximumNumberOfSteps, int);
217  vtkGetMacro(MaximumNumberOfSteps, int);
219 
221 
225  vtkSetMacro(MaximumIntegrationTime, double);
226  vtkGetMacro(MaximumIntegrationTime, double);
228 
230 
236  vtkSetMacro(AdaptiveStepReintegration, bool);
237  vtkGetMacro(AdaptiveStepReintegration, bool);
238  vtkBooleanMacro(AdaptiveStepReintegration, bool);
240 
242 
248  vtkSetMacro(UseParticlePathsRenderingThreshold, bool);
249  vtkGetMacro(UseParticlePathsRenderingThreshold, bool);
250  vtkBooleanMacro(UseParticlePathsRenderingThreshold, bool);
252 
254 
260  vtkSetMacro(ParticlePathsRenderingPointsThreshold, int);
261  vtkGetMacro(ParticlePathsRenderingPointsThreshold, int);
263 
265 
271  void SetSourceData(vtkDataObject* source);
272  vtkDataObject* GetSource();
274 
278  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
279 
281 
287  void SetSurfaceData(vtkDataObject *source);
288  vtkDataObject *GetSurface();
290 
294  void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
295 
299  int FillInputPortInformation(int port, vtkInformation* info) override;
300 
305 
311  vtkInformationVector*) override;
312 
316  int RequestData(vtkInformation *request,
317  vtkInformationVector **inputVector,
318  vtkInformationVector *outputVector) override;
319 
324  vtkMTimeType GetMTime() override;
325 
329  virtual vtkIdType GetNewParticleId();
330 
331 protected:
333  ~vtkLagrangianParticleTracker() override;
334 
335  virtual bool InitializeInputs(vtkInformationVector **inputVector,
336  vtkDataObject*& flow, vtkDataObject*& seeds, vtkDataObject*& surfaces,
337  std::queue<vtkLagrangianParticle*>& particleQueue, vtkPointData* seedData);
338  virtual bool InitializeFlow(vtkDataObject* flow, vtkBoundingBox* bounds);
339  virtual bool InitializeParticles(const vtkBoundingBox* bounds, vtkDataObject* seeds,
340  std::queue<vtkLagrangianParticle*>& particles, vtkPointData* seedData);
341  virtual void GenerateParticles(const vtkBoundingBox* bounds, vtkDataSet* seeds,
342  vtkDataArray* initialVelocities, vtkDataArray* initialIntegrationTimes,
343  vtkPointData* seedData, int nVar, std::queue<vtkLagrangianParticle*>& particles);
344  virtual bool UpdateSurfaceCacheIfNeeded(vtkDataObject*& surfaces);
345  virtual void InitializeSurface(vtkDataObject*& surfaces);
346  virtual bool InitializeOutputs(vtkInformationVector *outputVector, vtkPointData* seedData,
347  vtkIdType numberOfSeeds, vtkDataObject* surfaces,
348  vtkPolyData*& particlePathsOutput, vtkDataObject*& interactionOutput);
349 
350  virtual bool InitializePathsOutput(vtkInformationVector *outputVector,
351  vtkPointData* seedData, vtkIdType numberOfSeeds,
352  vtkPolyData*& particlePathsOutput);
353 
354  virtual bool InitializeInteractionOutput(vtkInformationVector *outputVector,
355  vtkPointData* seedData, vtkDataObject* surfaces, vtkDataObject*& interractionOutput);
356 
357  virtual void InitializeParticleData(vtkFieldData* particleData, int maxTuples = 0);
358  virtual void InitializePathData(vtkFieldData* data);
359  virtual void InitializeInteractionData(vtkFieldData* data);
360 
361  virtual bool FinalizeOutputs(vtkPolyData* particlePathsOutput,
362  vtkDataObject* interractionOutput);
363 
364  static void InsertPolyVertexCell(vtkPolyData* polydata);
365  static void InsertVertexCells(vtkPolyData* polydata);
366 
367  virtual void GetParticleFeed(std::queue<vtkLagrangianParticle*>& particleQueue);
368 
369  virtual int Integrate(vtkLagrangianParticle*, std::queue<vtkLagrangianParticle*>&,
370  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
371  vtkDataObject* interactionOutput);
372 
373  void InsertPathOutputPoint(vtkLagrangianParticle* particle,
374  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
375  bool prev = false);
376 
377  void InsertInteractionOutputPoint(vtkLagrangianParticle* particle,
378  unsigned int interactedSurfaceFlatIndex, vtkDataObject* interactionOutput);
379 
380  void InsertSeedData(vtkLagrangianParticle* particle, vtkFieldData* data);
381  void InsertPathData(vtkLagrangianParticle* particle, vtkFieldData* data);
382  void InsertInteractionData(vtkLagrangianParticle* particle, vtkFieldData* data);
383  void InsertParticleData(vtkLagrangianParticle* particle, vtkFieldData* data, int stepEnum);
384 
385  double ComputeCellLength(vtkLagrangianParticle* particle);
386 
387  bool ComputeNextStep(
388  double* xprev, double* xnext,
389  double t, double& delT, double& delTActual,
390  double minStep, double maxStep,
391  int& integrationRes);
392 
393  virtual bool CheckParticlePathsRenderingThreshold(vtkPolyData* particlePathsOutput);
394 
397 
399  double StepFactor;
409 
410  // internal parameters use for step computation
413 
414  // Cache related parameters
420 
421 private:
423  void operator=(const vtkLagrangianParticleTracker&) = delete;
424 };
425 
426 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
represent and manipulate point attribute data
Definition: vtkPointData.h:37
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
static vtkDataObjectAlgorithm * New()
vtkInitialValueProblemSolver * Integrator
int vtkIdType
Definition: vtkType.h:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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:39
vtkFunctionSet abstract implementation to be used in the vtkLagrangianParticleTracker integrator...
list of point or cell ids
Definition: vtkIdList.h:36
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual vtkMTimeType GetMTime()
Return this object&#39;s modified time.
Basis class for Lagrangian particles.
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:50
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkLagrangianBasicIntegrationModel * IntegrationModel
Store zero or more vtkInformation instances.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
general representation of visualization data
Definition: vtkDataObject.h:64
Filter to inject and track particles in a flow.
represent and manipulate 3D points
Definition: vtkPoints.h:39
Fast Simple Class for dealing with 3D bounds.
represent and manipulate fields of data
Definition: vtkFieldData.h:56
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.