Go to the documentation of this file.
11 #ifndef vtk_m_filter_flow_worklet_Particles_h
12 #define vtk_m_filter_flow_worklet_Particles_h
24 template <
typename ParticleType>
52 const ParticleType& particle,
56 ParticleType newParticle(particle);
57 newParticle.SetPosition(pt);
58 newParticle.SetTime(time);
59 newParticle.SetNumberOfSteps(particle.GetNumberOfSteps() + 1);
70 if (p.GetNumberOfSteps() == maxSteps)
71 p.GetStatus().SetTerminate();
74 p.GetStatus().SetFail();
76 p.GetStatus().SetSpatialBounds();
78 p.GetStatus().SetTemporalBounds();
80 p.GetStatus().SetInGhostCell();
83 p.GetStatus().SetZeroVelocity();
84 p.GetStatus().SetTerminate();
98 p.GetStatus().SetTookAnySteps();
100 p.GetStatus().ClearTookAnySteps();
111 template <
typename ParticleType>
138 template <
typename ParticleType>
175 this->
History.Set(loc, p.GetPosition());
183 const ParticleType& particle,
206 template <
typename ParticleType>
213 template <
typename T>
280 #endif // vtk_m_filter_flow_worklet_Particles_h
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
VTKM_EXEC_CONT bool CheckZeroVelocity() const
Definition: IntegratorStatus.h:75
ParticleExecutionObject(vtkm::cont::ArrayHandle< ParticleType > particleArray, vtkm::Id maxSteps, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token)
Definition: Particles.h:35
VTKM_EXEC_CONT ParticleExecutionObject()
Definition: Particles.h:29
VTKM_EXEC void StatusUpdate(const vtkm::Id &idx, const vtkm::worklet::flow::IntegratorStatus &status, vtkm::Id maxSteps)
Definition: Particles.h:64
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC ParticleType GetParticle(const vtkm::Id &idx)
Definition: Particles.h:45
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_CONT vtkm::worklet::flow::StateRecordingParticleExecutionObject< ParticleType > PrepareForExecution(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Definition: Particles.h:222
VTKM_EXEC void PreStepUpdate(const vtkm::Id &vtkmNotUsed(idx))
Definition: Particles.h:48
VTKM_EXEC_CONT bool operator()(const T &x) const
Definition: Particles.h:214
Definition: Particles.h:112
typename vtkm::cont::ArrayHandle< vtkm::Id >::WritePortalType IdPortal
Definition: Particles.h:197
VTKM_EXEC void PreStepUpdate(const vtkm::Id &idx)
Definition: Particles.h:169
VTKM_EXEC_CONT bool CheckSpatialBounds() const
Definition: IntegratorStatus.h:67
StateRecordingParticleExecutionObject(vtkm::cont::ArrayHandle< ParticleType > pArray, vtkm::cont::ArrayHandle< vtkm::Vec3f > historyArray, vtkm::cont::ArrayHandle< vtkm::Id > validPointArray, vtkm::cont::ArrayHandle< vtkm::Id > stepCountArray, vtkm::Id maxSteps, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token)
Definition: Particles.h:152
vtkm::cont::ArrayHandle< ParticleType > ParticleArray
Definition: Particles.h:270
VTKM_CONT WritePortalType PrepareForInPlace(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this array to be used in an in-place operation (both as input and output) in the execution e...
Definition: ArrayHandle.h:593
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
HistoryPortal History
Definition: Particles.h:200
typename vtkm::cont::ArrayHandle< vtkm::Vec3f >::WritePortalType HistoryPortal
Definition: Particles.h:198
VTKM_CONT Particles(vtkm::cont::ArrayHandle< ParticleType > &pArray, vtkm::Id &maxSteps)
Definition: Particles.h:124
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::ArrayHandle< vtkm::Id > StepCountArray
Definition: Particles.h:271
VTKM_EXEC void StepUpdate(const vtkm::Id &idx, const ParticleType &particle, vtkm::FloatDefault time, const vtkm::Vec3f &pt)
Definition: Particles.h:51
VTKM_CONT vtkm::worklet::flow::ParticleExecutionObject< ParticleType > PrepareForExecution(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Definition: Particles.h:115
VTKM_EXEC_CONT bool CheckFail() const
Definition: IntegratorStatus.h:64
VTKM_EXEC_CONT StateRecordingParticleExecutionObject()
Definition: Particles.h:143
vtkm::cont::ArrayHandle< ParticleType > ParticleArray
Definition: Particles.h:133
VTKM_CONT StateRecordingParticles(vtkm::cont::ArrayHandle< ParticleType > &pArray, const vtkm::Id &maxSteps)
Definition: Particles.h:234
Definition: Particles.h:25
VTKM_EXEC void StepUpdate(const vtkm::Id &idx, const ParticleType &particle, vtkm::FloatDefault time, const vtkm::Vec3f &pt)
Definition: Particles.h:182
Definition: Particles.h:139
Definition: IntegratorStatus.h:33
VTKM_EXEC_CONT bool CheckInGhostCell() const
Definition: IntegratorStatus.h:73
void ArrayCopy(const SourceArrayType &source, DestArrayType &destination)
Does a deep copy from one array to another array.
Definition: ArrayCopy.h:142
static VTKM_CONT void CopyIf(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< U, CStencil > &stencil, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: Algorithm.h:435
vtkm::cont::ArrayHandle< vtkm::Id > ValidPointArray
Definition: Particles.h:272
#define VTKM_CONT
Definition: ExportMacros.h:57
typename StorageType::WritePortalType WritePortalType
Definition: ArrayHandle.h:295
An array handle with a constant value.
Definition: ArrayHandleConstant.h:63
IdPortal StepCount
Definition: Particles.h:202
Particles()
Definition: Particles.h:130
vtkm::Id MaxSteps
Definition: Particles.h:269
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
vtkm::Id Length
Definition: Particles.h:201
Definition: Particles.h:211
VTKM_EXEC bool CanContinue(const vtkm::Id &idx)
Definition: Particles.h:91
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
Definition: DeviceAdapterTag.h:52
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:198
vtkm::Id MaxSteps
Definition: Particles.h:134
vtkm::Id MaxSteps
Definition: Particles.h:108
VTKM_CONT WritePortalType PrepareForOutput(vtkm::Id numberOfValues, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares (allocates) this array to be used as an output from an operation in the execution environmen...
Definition: ArrayHandle.h:613
VTKM_EXEC_CONT bool CheckTemporalBounds() const
Definition: IntegratorStatus.h:70
typename vtkm::cont::ArrayHandle< ParticleType >::WritePortalType ParticlePortal
Definition: Particles.h:105
Definition: Particles.h:207
IdPortal ValidPoint
Definition: Particles.h:203
VTKM_EXEC void UpdateTookSteps(const vtkm::Id &idx, bool val)
Definition: Particles.h:94
VTKM_CONT void GetCompactedHistory(vtkm::cont::ArrayHandle< vtkm::Vec3f > &positions)
Definition: Particles.h:262
vtkm::cont::ArrayHandle< vtkm::Vec3f > HistoryArray
Definition: Particles.h:268
ParticlePortal Particles
Definition: Particles.h:107
VTKM_CONT StateRecordingParticles(vtkm::cont::ArrayHandle< ParticleType > &pArray, vtkm::cont::ArrayHandle< vtkm::Vec3f > &historyArray, vtkm::cont::ArrayHandle< vtkm::Id > &validPointArray, vtkm::Id &maxSteps)
Definition: Particles.h:250