VTK  9.1.0
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 =========================================================================*/
29 #ifndef vtkLagrangianParticle_h
30 #define vtkLagrangianParticle_h
31 
32 #include "vtkFiltersFlowPathsModule.h" // For export macro
33 #include "vtkNew.h" // For vtkNew
34 #include "vtkSystemIncludes.h" // For PrintSelf signature and vtkType
35 
36 #include <vector>
37 
40 class vtkDataSet;
41 class vtkGenericCell;
42 class vtkIdList;
43 class vtkPointData;
45 
46 class VTKFILTERSFLOWPATHS_EXPORT vtkLagrangianParticle
47 {
48 public:
67  typedef enum ParticleTermination
68  {
69  PARTICLE_TERMINATION_NOT_TERMINATED = 0,
77  PARTICLE_TERMINATION_ABORTED
78  } ParticleTermination;
79 
91  typedef enum SurfaceInteraction
92  {
93  SURFACE_INTERACTION_NO_INTERACTION = 0,
98  SURFACE_INTERACTION_OTHER
99  } SurfaceInteraction;
100 
110  vtkLagrangianParticle(int numberOfVariables, vtkIdType seedId, vtkIdType particleId,
111  vtkIdType seedArrayTupleIndex, double integrationTime, vtkPointData* seedData,
112  int numberOfTrackedUserData);
113 
118  static vtkLagrangianParticle* NewInstance(int numberOfVariables, vtkIdType seedId,
119  vtkIdType particleId, vtkIdType seedArrayTupleIndex, double integrationTime,
120  vtkPointData* seedData, int numberOfTrackedUserData, vtkIdType numberOfSteps = 0,
121  double previousIntegrationTime = 0);
122 
130 
135 
140 
142 
146  inline double* GetPrevEquationVariables() { return this->PrevEquationVariables.data(); }
148 
150 
162  inline double* GetEquationVariables() { return this->EquationVariables.data(); }
164 
166 
171  inline double* GetNextEquationVariables() { return this->NextEquationVariables.data(); }
173 
175 
180  inline double* GetPrevPosition() { return this->PrevEquationVariables.data(); }
182 
184 
189  inline double* GetPosition() { return this->EquationVariables.data(); }
191 
193 
198  inline double* GetNextPosition() { return this->NextEquationVariables.data(); }
200 
202 
207  inline double* GetPrevVelocity() { return this->PrevVelocity; }
209 
211 
216  inline double* GetVelocity() { return this->Velocity; }
218 
220 
225  inline double* GetNextVelocity() { return this->NextVelocity; }
227 
229 
234  inline double* GetPrevUserVariables() { return this->PrevUserVariables; }
236 
238 
243  inline double* GetUserVariables() { return this->UserVariables; }
245 
247 
252  inline double* GetNextUserVariables() { return this->NextUserVariables; }
254 
256 
260  inline std::vector<double>& GetPrevTrackedUserData() { return this->PrevTrackedUserData; }
262 
264 
274  inline std::vector<double>& GetTrackedUserData() { return this->TrackedUserData; }
276 
278 
282  inline std::vector<double>& GetNextTrackedUserData() { return this->NextTrackedUserData; }
284 
286 
293  inline vtkLagrangianThreadedData* GetThreadedData() { return this->ThreadedData; }
294  inline void SetThreadedData(vtkLagrangianThreadedData* threadedData)
295  {
296  this->ThreadedData = threadedData;
297  }
299 
306  virtual void MoveToNextPosition();
307 
311  virtual vtkIdType GetId();
312 
314 
318  virtual void SetParentId(vtkIdType parentId);
321 
326  virtual vtkIdType GetSeedId();
327 
331  virtual int GetNumberOfVariables();
332 
337 
342 
348 
353 
358 
362  void SetLastSurfaceCell(vtkDataSet* dataset, vtkIdType cellId);
363 
368 
370 
375  virtual void SetTermination(int termination);
376  virtual int GetTermination();
378 
380 
385  virtual void SetInteraction(int interaction);
386  virtual int GetInteraction();
388 
390 
393  virtual void SetUserFlag(int flag);
394  virtual int GetUserFlag();
396 
398 
403  virtual void SetPInsertPreviousPosition(bool val);
406 
408 
413  virtual void SetPManualShift(bool val);
414  virtual bool GetPManualShift();
416 
420  virtual double& GetStepTimeRef();
421 
425  virtual double GetIntegrationTime();
426 
430  virtual double GetPrevIntegrationTime();
431 
440  virtual void SetIntegrationTime(double time);
441 
446 
450  virtual void PrintSelf(ostream& os, vtkIndent indent);
451 
452 protected:
455  void operator=(const vtkLagrangianParticle&) = delete;
456 
457  std::vector<double> PrevEquationVariables;
458  double* PrevVelocity;
460 
461  std::vector<double> EquationVariables;
462  double* Velocity;
463  double* UserVariables;
464 
465  std::vector<double> NextEquationVariables;
466  double* NextVelocity;
468 
469  std::vector<double> PrevTrackedUserData;
470  std::vector<double> TrackedUserData;
471  std::vector<double> NextTrackedUserData;
472 
473  vtkLagrangianThreadedData* ThreadedData = nullptr;
474 
481 
482  double StepTime;
487  int UserFlag;
491 
492  // Parallel related flags
495 };
496 
497 #endif
498 // VTK-HeaderTest-Exclude: vtkLagrangianParticle.h
an abstract base class for locators which find cells
Class to perform non planar quad intersection.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:31
a simple class to control print indentation
Definition: vtkIndent.h:34
Basis class for Lagrangian particles.
double * GetNextUserVariables()
Get a pointer to the next user variables.
std::vector< double > TrackedUserData
std::vector< double > & GetPrevTrackedUserData()
Get a reference to PrevTrackedUserData See GetTrackedUserData for an explanation on how to use it.
std::vector< double > PrevTrackedUserData
virtual double GetPrevIntegrationTime()
Get the integration time at previous position.
virtual void MoveToNextPosition()
Move the particle to its next position by putting next equation variable to equation variable and cle...
virtual int GetUserFlag()
Set/Get user flag.
virtual int GetNumberOfVariables()
Get the number of variables used to initialize EquationVariables.
vtkIdType GetLastSurfaceCellId()
Get the last intersected surface cell id.
void SetThreadedData(vtkLagrangianThreadedData *threadedData)
Get/Set a pointer to a vtkLagrangianThreadedData that is considered to be local to the thread.
virtual vtkIdType GetSeedArrayTupleIndex() const
Get the index of the tuple for this particle in the point data returned by GetSeedData method.
double * GetEquationVariables()
Get a pointer to the particle variables array.
virtual void SetInteraction(int interaction)
Set/Get particle interaction.
vtkLagrangianParticle()=delete
double GetPositionVectorMagnitude()
Compute and return the position vector magnitude.
virtual void SetPInsertPreviousPosition(bool val)
Set/Get parallel specific flag, indication to insert or not the previous position after streaming.
virtual ~vtkLagrangianParticle()
Destructor.
virtual void SetPManualShift(bool val)
Set/Get parallel specific flag, indication that the particle may be manually shifted after streaming.
virtual void SetIntegrationTime(double time)
Convenience setter for integration time, do not use unless manual particle shifting One using this me...
double * GetNextVelocity()
Get a pointer to the next particle velocity.
ParticleTermination
An enum to inform about a reason for termination PARTICLE_TERMINATION_NOT_TERMINATED = 0,...
double * GetPrevVelocity()
Get a pointer to the previous particle velocity.
vtkLagrangianParticle * NewParticle(vtkIdType particleId)
method to create a particle from a parent particle.
vtkLagrangianParticle(const vtkLagrangianParticle &)=delete
double * GetPrevPosition()
Get a pointer to the previous particle position.
vtkDataSet * GetLastSurfaceDataSet()
Get the dataset containing the last intersected surface cell.
void operator=(const vtkLagrangianParticle &)=delete
virtual bool GetPInsertPreviousPosition()
Set/Get parallel specific flag, indication to insert or not the previous position after streaming.
virtual vtkIdType GetId()
Get particle id.
static vtkLagrangianParticle * NewInstance(int numberOfVariables, vtkIdType seedId, vtkIdType particleId, vtkIdType seedArrayTupleIndex, double integrationTime, vtkPointData *seedData, int numberOfTrackedUserData, vtkIdType numberOfSteps=0, double previousIntegrationTime=0)
Constructor wrapper to create a partially integrated particle in the domain.
std::vector< double > EquationVariables
virtual void SetUserFlag(int flag)
Set/Get user flag.
double * GetVelocity()
Get a pointer to the particle velocity.
virtual vtkPointData * GetSeedData()
Get the particle seed data, for reading only.
double * GetNextEquationVariables()
Get a pointer to the particle variables array at its next position.
virtual vtkIdType GetParentId()
Set/Get parent particle id.
std::vector< double > & GetTrackedUserData()
Get a reference to TrackedUserData.
double * GetPrevUserVariables()
Get a pointer to the previous user variables.
virtual double & GetStepTimeRef()
Get reference to step time of this particle.
double * GetUserVariables()
Get a pointer to the user variables.
SurfaceInteraction
An enum to inform about a surface interaction SURFACE_INTERACTION_NO_INTERACTION = 0,...
vtkLagrangianParticle(int numberOfVariables, vtkIdType seedId, vtkIdType particleId, vtkIdType seedArrayTupleIndex, double integrationTime, vtkPointData *seedData, int numberOfTrackedUserData)
Constructor to create a particle from a seed.
void SetLastSurfaceCell(vtkDataSet *dataset, vtkIdType cellId)
Set the last surface dataset and last surface cell id.
std::vector< double > PrevEquationVariables
double * GetNextPosition()
Get a pointer to the next particle position.
double * GetPosition()
Get a pointer to the particle position.
virtual int GetNumberOfUserVariables()
Get the number of variables specific to the user.
std::vector< double > NextTrackedUserData
virtual void SetTermination(int termination)
Set/Get particle termination.
vtkLagrangianParticle * CloneParticle()
method to create an exact clone of a particle.
virtual double GetIntegrationTime()
Get the integration time.
virtual bool GetPManualShift()
Set/Get parallel specific flag, indication that the particle may be manually shifted after streaming.
virtual int GetInteraction()
Set/Get particle interaction.
std::vector< double > NextEquationVariables
virtual vtkIdType GetNumberOfSteps()
Get particle current number of steps.
virtual void SetParentId(vtkIdType parentId)
Set/Get parent particle id.
virtual vtkIdType GetSeedId()
Get the particle original seed index in the seed dataset.
double * GetPrevEquationVariables()
Get a pointer to Particle variables at its previous position See GetEquationVariables for content des...
vtkLagrangianThreadedData * GetThreadedData()
Get/Set a pointer to a vtkLagrangianThreadedData that is considered to be local to the thread.
std::vector< double > & GetNextTrackedUserData()
Get a reference to NextTrackedUserData See GetTrackedUserData for an explanation on how to use it.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Print information about the particle.
virtual int GetTermination()
Set/Get particle termination.
represent and manipulate point attribute data
Definition: vtkPointData.h:33
@ time
Definition: vtkX3D.h:503
struct to hold a user data
int vtkIdType
Definition: vtkType.h:332