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
128  } CellLengthComputation;
129 
131 
134  void SetIntegrationModel(vtkLagrangianBasicIntegrationModel* integrationModel);
135  vtkGetObjectMacro(IntegrationModel, vtkLagrangianBasicIntegrationModel);
137 
139 
142  void SetIntegrator(vtkInitialValueProblemSolver* integrator);
143  vtkGetObjectMacro(Integrator, vtkInitialValueProblemSolver);
145 
147 
152  vtkSetMacro(GeneratePolyVertexInteractionOutput, bool);
153  vtkGetMacro(GeneratePolyVertexInteractionOutput, bool);
155 
157 
181  vtkSetMacro(CellLengthComputationMode, int);
182  vtkGetMacro(CellLengthComputationMode, int);
184 
186 
189  vtkSetMacro(StepFactor, double);
190  vtkGetMacro(StepFactor, double);
192 
194 
197  vtkSetMacro(StepFactorMin, double);
198  vtkGetMacro(StepFactorMin, double);
200 
202 
205  vtkSetMacro(StepFactorMax, double);
206  vtkGetMacro(StepFactorMax, double);
208 
210 
213  vtkSetMacro(MaximumNumberOfSteps, int);
214  vtkGetMacro(MaximumNumberOfSteps, int);
216 
218 
223  vtkSetMacro(AdaptiveStepReintegration, bool);
224  vtkGetMacro(AdaptiveStepReintegration, bool);
225  vtkBooleanMacro(AdaptiveStepReintegration, bool);
227 
229 
232  vtkSetMacro(UseParticlePathsRenderingThreshold, bool);
233  vtkGetMacro(UseParticlePathsRenderingThreshold, bool);
234  vtkBooleanMacro(UseParticlePathsRenderingThreshold, bool);
236 
238 
241  vtkSetMacro(ParticlePathsRenderingPointsThreshold, int);
242  vtkGetMacro(ParticlePathsRenderingPointsThreshold, int);
244 
246 
249  vtkSetMacro(CreateOutOfDomainParticle, bool);
250  vtkGetMacro(CreateOutOfDomainParticle, bool);
251  vtkBooleanMacro(CreateOutOfDomainParticle, bool);
253 
255 
261  void SetSourceData(vtkDataObject* source);
262  vtkDataObject* GetSource();
264 
268  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
269 
271 
277  void SetSurfaceData(vtkDataObject *source);
278  vtkDataObject *GetSurface();
280 
284  void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
285 
289  int FillInputPortInformation(int port, vtkInformation* info) override;
290 
295 
301  vtkInformationVector*) override;
302 
306  int RequestData(vtkInformation *request,
307  vtkInformationVector **inputVector,
308  vtkInformationVector *outputVector) override;
309 
314  vtkMTimeType GetMTime() override;
315 
319  virtual vtkIdType GetNewParticleId();
320 
321 protected:
323  ~vtkLagrangianParticleTracker() override;
324 
325  virtual bool InitializeInputs(vtkInformationVector **inputVector,
326  vtkDataObject*& flow, vtkDataObject*& seeds, vtkDataObject*& surfaces,
327  std::queue<vtkLagrangianParticle*>& particleQueue, vtkPointData* seedData);
328  virtual bool InitializeFlow(vtkDataObject* flow, vtkBoundingBox* bounds);
329  virtual bool InitializeParticles(const vtkBoundingBox* bounds, vtkDataObject* seeds,
330  std::queue<vtkLagrangianParticle*>& particles, vtkPointData* seedData);
331  virtual void GenerateParticles(const vtkBoundingBox* bounds, vtkDataSet* seeds,
332  vtkDataArray* initialVelocities, vtkDataArray* initialIntegrationTimes,
333  vtkPointData* seedData, int nVar, std::queue<vtkLagrangianParticle*>& particles);
334  virtual bool UpdateSurfaceCacheIfNeeded(vtkDataObject*& surfaces);
335  virtual void InitializeSurface(vtkDataObject*& surfaces);
336  virtual bool InitializeOutputs(vtkInformationVector *outputVector, vtkPointData* seedData,
337  vtkIdType numberOfSeeds, vtkDataObject* surfaces,
338  vtkPolyData*& particlePathsOutput, vtkDataObject*& interactionOutput);
339 
340  virtual bool InitializePathsOutput(vtkInformationVector *outputVector,
341  vtkPointData* seedData, vtkIdType numberOfSeeds,
342  vtkPolyData*& particlePathsOutput);
343 
344  virtual bool InitializeInteractionOutput(vtkInformationVector *outputVector,
345  vtkPointData* seedData, vtkDataObject* surfaces, vtkDataObject*& interractionOutput);
346 
347  virtual void InitializeParticleData(vtkFieldData* particleData, int maxTuples = 0);
348  virtual void InitializePathData(vtkFieldData* data);
349  virtual void InitializeInteractionData(vtkFieldData* data);
350 
351  virtual bool FinalizeOutputs(vtkPolyData* particlePathsOutput,
352  vtkDataObject* interractionOutput);
353 
354  static void InsertPolyVertexCell(vtkPolyData* polydata);
355  static void InsertVertexCells(vtkPolyData* polydata);
356 
357  virtual void GetParticleFeed(std::queue<vtkLagrangianParticle*>& particleQueue);
358 
359  virtual int Integrate(vtkLagrangianParticle*, std::queue<vtkLagrangianParticle*>&,
360  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
361  vtkDataObject* interactionOutput);
362 
363  void InsertPathOutputPoint(vtkLagrangianParticle* particle,
364  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
365  bool prev = false);
366 
367  void InsertInteractionOutputPoint(vtkLagrangianParticle* particle,
368  unsigned int interactedSurfaceFlatIndex, vtkDataObject* interactionOutput);
369 
370  void InsertSeedData(vtkLagrangianParticle* particle, vtkFieldData* data);
371  void InsertPathData(vtkLagrangianParticle* particle, vtkFieldData* data);
372  void InsertInteractionData(vtkLagrangianParticle* particle, vtkFieldData* data);
373  void InsertParticleData(vtkLagrangianParticle* particle, vtkFieldData* data, int stepEnum);
374 
375  double ComputeCellLength(vtkLagrangianParticle* particle);
376 
377  bool ComputeNextStep(
378  double* xprev, double* xnext,
379  double t, double& delT, double& delTActual,
380  double minStep, double maxStep,
381  int& integrationRes);
382 
383  virtual bool CheckParticlePathsRenderingThreshold(vtkPolyData* particlePathsOutput);
384 
387 
389  double StepFactor;
399 
400  // internal parameters use for step computation
403 
404  // Cache related parameters
410 
411 private:
413  void operator=(const vtkLagrangianParticleTracker&) = delete;
414 };
415 
416 #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:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
static vtkDataObjectAlgorithm * New()
vtkInitialValueProblemSolver * Integrator
int vtkIdType
Definition: vtkType.h:345
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.