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 
96 #include <queue> // for particle queue
97 
98 class vtkBoundingBox;
99 class vtkCellArray;
100 class vtkDataSet;
101 class vtkDoubleArray;
102 class vtkIdList;
103 class vtkInformation;
107 class vtkPointData;
108 class vtkPoints;
109 class vtkPolyData;
110 
111 class VTKFILTERSFLOWPATHS_EXPORT vtkLagrangianParticleTracker :
113 {
114 public:
115 
117  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
119 
120  typedef enum CellLengthComputation{
121  STEP_LAST_CELL_LENGTH = 0,
122  STEP_CUR_CELL_LENGTH = 1,
123  STEP_LAST_CELL_VEL_DIR = 2,
124  STEP_CUR_CELL_VEL_DIR = 3,
125  STEP_LAST_CELL_DIV_THEO = 4,
126  STEP_CUR_CELL_DIV_THEO = 5
128 
130 
133  void SetIntegrationModel(vtkLagrangianBasicIntegrationModel* integrationModel);
134  vtkGetObjectMacro(IntegrationModel, vtkLagrangianBasicIntegrationModel);
136 
138 
141  void SetIntegrator(vtkInitialValueProblemSolver* integrator);
142  vtkGetObjectMacro(Integrator, vtkInitialValueProblemSolver);
144 
146 
170  vtkSetMacro(CellLengthComputationMode, int);
171  vtkGetMacro(CellLengthComputationMode, int);
173 
175 
178  vtkSetMacro(StepFactor, double);
179  vtkGetMacro(StepFactor, double);
181 
183 
186  vtkSetMacro(StepFactorMin, double);
187  vtkGetMacro(StepFactorMin, double);
189 
191 
194  vtkSetMacro(StepFactorMax, double);
195  vtkGetMacro(StepFactorMax, double);
197 
199 
202  vtkSetMacro(MaximumNumberOfSteps, int);
203  vtkGetMacro(MaximumNumberOfSteps, int);
205 
207 
212  vtkSetMacro(AdaptiveStepReintegration, bool);
213  vtkGetMacro(AdaptiveStepReintegration, bool);
214  vtkBooleanMacro(AdaptiveStepReintegration, bool);
216 
218 
221  vtkSetMacro(UseParticlePathsRenderingThreshold, bool);
222  vtkGetMacro(UseParticlePathsRenderingThreshold, bool);
223  vtkBooleanMacro(UseParticlePathsRenderingThreshold, bool);
225 
227 
230  vtkSetMacro(ParticlePathsRenderingPointsThreshold, int);
231  vtkGetMacro(ParticlePathsRenderingPointsThreshold, int);
233 
235 
238  vtkSetMacro(CreateOutOfDomainParticle, bool);
239  vtkGetMacro(CreateOutOfDomainParticle, bool);
240  vtkBooleanMacro(CreateOutOfDomainParticle, bool);
242 
244 
250  void SetSourceData(vtkDataObject* source);
251  vtkDataObject* GetSource();
253 
257  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
258 
260 
266  void SetSurfaceData(vtkDataObject *source);
267  vtkDataObject *GetSurface();
269 
273  void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
274 
278  int FillInputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
279 
283  int FillOutputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
284 
290  vtkInformationVector*) VTK_OVERRIDE;
291 
295  int RequestData(vtkInformation *request,
296  vtkInformationVector **inputVector,
297  vtkInformationVector *outputVector) VTK_OVERRIDE;
298 
303  vtkMTimeType GetMTime() VTK_OVERRIDE;
304 
308  virtual vtkIdType GetNewParticleId();
309 
310 protected:
312  ~vtkLagrangianParticleTracker() VTK_OVERRIDE;
313 
314  virtual bool InitializeInputs(vtkInformationVector **inputVector,
315  vtkDataObject*& flow, vtkDataObject*& seeds, vtkDataObject*& surfaces,
316  std::queue<vtkLagrangianParticle*>& particleQueue, vtkPointData* seedData);
317  virtual bool InitializeFlow(vtkDataObject* flow, vtkBoundingBox* bounds);
318  virtual bool InitializeParticles(const vtkBoundingBox* bounds, vtkDataObject* seeds,
319  std::queue<vtkLagrangianParticle*>& particles, vtkPointData* seedData);
320  virtual void GenerateParticles(const vtkBoundingBox* bounds, vtkDataSet* seeds,
321  vtkDataArray* initialVelocities, vtkDataArray* initialIntegrationTimes,
322  vtkPointData* seedData, int nVar, std::queue<vtkLagrangianParticle*>& particles);
323  virtual void InitializeSurface(vtkDataObject*& surfaces);
324  virtual bool InitializeOutputs(vtkInformationVector *outputVector, vtkPointData* seedData,
325  vtkIdType numberOfSeeds, vtkDataObject* surfaces,
326  vtkPolyData*& particlePathsOutput, vtkDataObject*& interactionOutput);
327 
328  virtual bool InitializePathsOutput(vtkInformationVector *outputVector,
329  vtkPointData* seedData, vtkIdType numberOfSeeds,
330  vtkPolyData*& particlePathsOutput);
331 
332  virtual bool InitializeInteractionOutput(vtkInformationVector *outputVector,
333  vtkPointData* seedData, vtkDataObject* surfaces, vtkDataObject*& interractionOutput);
334 
335  virtual void InitializeParticleData(vtkFieldData* particleData, int maxTuples = 0);
336  virtual void InitializePathData(vtkFieldData* data);
337  virtual void InitializeInteractionData(vtkFieldData* data);
338 
339  virtual bool FinalizeOutputs(vtkPolyData* particlePathsOutput,
340  vtkDataObject* interractionOutput);
341 
342  static void InsertPolyVertexCell(vtkPolyData* polydata);
343 
344  virtual void GetParticleFeed(std::queue<vtkLagrangianParticle*>& particleQueue);
345 
346  virtual int Integrate(vtkLagrangianParticle*, std::queue<vtkLagrangianParticle*>&,
347  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
348  vtkDataObject* interactionOutput);
349 
350  void InsertPathOutputPoint(vtkLagrangianParticle* particle,
351  vtkPolyData* particlePathsOutput, vtkIdList* particlePathPointId,
352  bool prev = false);
353 
354  void InsertInteractionOutputPoint(vtkLagrangianParticle* particle,
355  unsigned int interactedSurfaceFlatIndex, vtkDataObject* interactionOutput);
356 
357  void InsertSeedData(vtkLagrangianParticle* particle, vtkFieldData* data);
358  void InsertPathData(vtkLagrangianParticle* particle, vtkFieldData* data);
359  void InsertInteractionData(vtkLagrangianParticle* particle, vtkFieldData* data);
360  void InsertParticleData(vtkLagrangianParticle* particle, vtkFieldData* data, int stepEnum);
361 
362  double ComputeCellLength(vtkLagrangianParticle* particle);
363 
364  bool ComputeNextStep(
365  double* xprev, double* xnext,
366  double t, double& delT, double& delTActual,
367  double minStep, double maxStep,
368  int& integrationRes);
369 
370  virtual bool CheckParticlePathsRenderingThreshold(vtkPolyData* particlePathsOutput);
371 
374 
375  int CellLengthComputationMode;
376  double StepFactor;
377  double StepFactorMin;
378  double StepFactorMax;
379  int MaximumNumberOfSteps;
380  bool AdaptiveStepReintegration;
381  bool UseParticlePathsRenderingThreshold;
382  int ParticlePathsRenderingPointsThreshold;
383  bool CreateOutOfDomainParticle;
384  vtkIdType ParticleCounter;
385 
386  // internal parameters use for step computation
387  double MinimumVelocityMagnitude;
388  double MinimumReductionFactor;
389 private:
390  vtkLagrangianParticleTracker(const vtkLagrangianParticleTracker&) VTK_DELETE_FUNCTION;
391  void operator=(const vtkLagrangianParticleTracker&) VTK_DELETE_FUNCTION;
392 };
393 
394 #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()
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.
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:50
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
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: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.