VTK  9.2.6
vtkLagrangianParticle.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLagrangianParticle.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 =========================================================================*/
32 #ifndef vtkLagrangianParticle_h
33 #define vtkLagrangianParticle_h
34 
35 #include "vtkFiltersFlowPathsModule.h" // For export macro
36 #include "vtkNew.h" // For vtkNew
37 #include "vtkSystemIncludes.h" // For PrintSelf signature and vtkType
38 
39 #include <vector>
40 
43 class vtkDataSet;
44 class vtkGenericCell;
45 class vtkIdList;
46 class vtkPointData;
48 
49 class VTKFILTERSFLOWPATHS_EXPORT vtkLagrangianParticle
50 {
51 public:
70  typedef enum ParticleTermination
71  {
72  PARTICLE_TERMINATION_NOT_TERMINATED = 0,
80  PARTICLE_TERMINATION_ABORTED
81  } ParticleTermination;
82 
94  typedef enum SurfaceInteraction
95  {
96  SURFACE_INTERACTION_NO_INTERACTION = 0,
101  SURFACE_INTERACTION_OTHER
102  } SurfaceInteraction;
103 
113  vtkLagrangianParticle(int numberOfVariables, vtkIdType seedId, vtkIdType particleId,
114  vtkIdType seedArrayTupleIndex, double integrationTime, vtkPointData* seedData,
115  int numberOfTrackedUserData);
116 
121  static vtkLagrangianParticle* NewInstance(int numberOfVariables, vtkIdType seedId,
122  vtkIdType particleId, vtkIdType seedArrayTupleIndex, double integrationTime,
123  vtkPointData* seedData, int numberOfTrackedUserData, vtkIdType numberOfSteps = 0,
124  double previousIntegrationTime = 0);
125 
132  vtkLagrangianParticle* NewParticle(vtkIdType particleId);
133 
137  vtkLagrangianParticle* CloneParticle();
138 
142  virtual ~vtkLagrangianParticle();
143 
145 
149  inline double* GetPrevEquationVariables() { return this->PrevEquationVariables.data(); }
151 
153 
165  inline double* GetEquationVariables() { return this->EquationVariables.data(); }
167 
169 
174  inline double* GetNextEquationVariables() { return this->NextEquationVariables.data(); }
176 
178 
183  inline double* GetPrevPosition() { return this->PrevEquationVariables.data(); }
185 
187 
192  inline double* GetPosition() { return this->EquationVariables.data(); }
194 
196 
201  inline double* GetNextPosition() { return this->NextEquationVariables.data(); }
203 
205 
210  inline double* GetPrevVelocity() { return this->PrevVelocity; }
212 
214 
219  inline double* GetVelocity() { return this->Velocity; }
221 
223 
228  inline double* GetNextVelocity() { return this->NextVelocity; }
230 
232 
237  inline double* GetPrevUserVariables() { return this->PrevUserVariables; }
239 
241 
246  inline double* GetUserVariables() { return this->UserVariables; }
248 
250 
255  inline double* GetNextUserVariables() { return this->NextUserVariables; }
257 
259 
263  inline std::vector<double>& GetPrevTrackedUserData() { return this->PrevTrackedUserData; }
265 
267 
277  inline std::vector<double>& GetTrackedUserData() { return this->TrackedUserData; }
279 
281 
285  inline std::vector<double>& GetNextTrackedUserData() { return this->NextTrackedUserData; }
287 
289 
296  inline vtkLagrangianThreadedData* GetThreadedData() { return this->ThreadedData; }
297  inline void SetThreadedData(vtkLagrangianThreadedData* threadedData)
298  {
299  this->ThreadedData = threadedData;
300  }
302 
309  virtual void MoveToNextPosition();
310 
314  virtual vtkIdType GetId();
315 
317 
321  virtual void SetParentId(vtkIdType parentId);
322  virtual vtkIdType GetParentId();
324 
329  virtual vtkIdType GetSeedId();
330 
334  virtual int GetNumberOfVariables();
335 
339  virtual int GetNumberOfUserVariables();
340 
344  virtual vtkPointData* GetSeedData();
345 
350  virtual vtkIdType GetSeedArrayTupleIndex() const;
351 
355  vtkIdType GetLastSurfaceCellId();
356 
360  vtkDataSet* GetLastSurfaceDataSet();
361 
365  void SetLastSurfaceCell(vtkDataSet* dataset, vtkIdType cellId);
366 
370  virtual vtkIdType GetNumberOfSteps();
371 
373 
378  virtual void SetTermination(int termination);
379  virtual int GetTermination();
381 
383 
388  virtual void SetInteraction(int interaction);
389  virtual int GetInteraction();
391 
393 
396  virtual void SetUserFlag(int flag);
397  virtual int GetUserFlag();
399 
401 
406  virtual void SetPInsertPreviousPosition(bool val);
407  virtual bool GetPInsertPreviousPosition();
409 
411 
416  virtual void SetPManualShift(bool val);
417  virtual bool GetPManualShift();
419 
423  virtual double& GetStepTimeRef();
424 
428  virtual double GetIntegrationTime();
429 
433  virtual double GetPrevIntegrationTime();
434 
443  virtual void SetIntegrationTime(double time);
444 
448  double GetPositionVectorMagnitude();
449 
453  virtual void PrintSelf(ostream& os, vtkIndent indent);
454 
455 protected:
457  vtkLagrangianParticle() = delete;
458  void operator=(const vtkLagrangianParticle&) = delete;
459 
460  std::vector<double> PrevEquationVariables;
461  double* PrevVelocity;
463 
464  std::vector<double> EquationVariables;
465  double* Velocity;
466  double* UserVariables;
467 
468  std::vector<double> NextEquationVariables;
469  double* NextVelocity;
471 
472  std::vector<double> PrevTrackedUserData;
473  std::vector<double> TrackedUserData;
474  std::vector<double> NextTrackedUserData;
475 
476  vtkLagrangianThreadedData* ThreadedData = nullptr;
477 
484 
485  double StepTime;
490  int UserFlag;
494 
495  // Parallel related flags
498 };
499 
500 #endif
501 // VTK-HeaderTest-Exclude: vtkLagrangianParticle.h
represent and manipulate point attribute data
Definition: vtkPointData.h:41
std::vector< double > & GetPrevTrackedUserData()
Get a reference to PrevTrackedUserData See GetTrackedUserData for an explanation on how to use it...
double * GetUserVariables()
Get a pointer to the user variables.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
an abstract base class for locators which find cells
struct to hold a user data
int vtkIdType
Definition: vtkType.h:332
vtkLagrangianThreadedData * GetThreadedData()
Get/Set a pointer to a vtkLagrangianThreadedData that is considered to be local to the thread...
provides thread-safe access to cells
double * GetNextVelocity()
Get a pointer to the next particle velocity.
a simple class to control print indentation
Definition: vtkIndent.h:39
double * GetNextEquationVariables()
Get a pointer to the particle variables array at its next position.
list of point or cell ids
Definition: vtkIdList.h:33
std::vector< double > & GetNextTrackedUserData()
Get a reference to NextTrackedUserData See GetTrackedUserData for an explanation on how to use it...
std::vector< double > PrevTrackedUserData
std::vector< double > EquationVariables
Basis class for Lagrangian particles.
double * GetPrevPosition()
Get a pointer to the previous particle position.
ParticleTermination
An enum to inform about a reason for termination PARTICLE_TERMINATION_NOT_TERMINATED = 0...
SurfaceInteraction
An enum to inform about a surface interaction SURFACE_INTERACTION_NO_INTERACTION = 0...
double * GetEquationVariables()
Get a pointer to the particle variables array.
double * GetPrevVelocity()
Get a pointer to the previous particle velocity.
void SetThreadedData(vtkLagrangianThreadedData *threadedData)
Get/Set a pointer to a vtkLagrangianThreadedData that is considered to be local to the thread...
std::vector< double > & GetTrackedUserData()
Get a reference to TrackedUserData.
std::vector< double > NextTrackedUserData
std::vector< double > NextEquationVariables
double * GetNextUserVariables()
Get a pointer to the next user variables.
double * GetNextPosition()
Get a pointer to the next particle position.
double * GetVelocity()
Get a pointer to the particle velocity.
Class to perform non planar quad intersection.
double * GetPosition()
Get a pointer to the particle position.
std::vector< double > PrevEquationVariables
double * GetPrevUserVariables()
Get a pointer to the previous user variables.
std::vector< double > TrackedUserData
double * GetPrevEquationVariables()
Get a pointer to Particle variables at its previous position See GetEquationVariables for content des...