11 #ifndef vtk_m_filter_flow_worklet_ParticleAdvectionWorklets_h
12 #define vtk_m_filter_flow_worklet_ParticleAdvectionWorklets_h
38 ExecObject integrator,
39 ExecObject integralCurve,
44 template <
typename IntegratorType,
typename IntegralCurveType>
46 const IntegratorType& integrator,
47 IntegralCurveType& integralCurve,
50 auto particle = integralCurve.GetParticle(idx);
52 bool tookAnySteps =
false;
58 integralCurve.PreStepUpdate(idx);
61 particle = integralCurve.GetParticle(idx);
63 auto status = integrator.Step(particle, time, outpos);
66 integralCurve.StepUpdate(idx, particle, time, outpos);
72 else if (status.CheckSpatialBounds())
74 status = integrator.SmallStep(particle, time, outpos);
77 integralCurve.StepUpdate(idx, particle, time, outpos);
81 integralCurve.StatusUpdate(idx, status, maxSteps);
82 }
while (integralCurve.CanContinue(idx));
85 integralCurve.UpdateTookSteps(idx, tookAnySteps);
90 template <
typename IntegratorType,
typename ParticleType>
98 void Run(
const IntegratorType& integrator,
104 using ParticleWorkletDispatchType =
120 vtkm::cont::cuda::internal::ScopedCudaStackSize stack(16 * 1024);
124 ParticleArrayType particlesObj(particles, MaxSteps);
127 ParticleWorkletDispatchType particleWorkletDispatch;
129 particleWorkletDispatch.Invoke(idxArray, integrator, particlesObj, maxSteps);
140 using ControlSignature = void(FieldIn, FieldOut);
141 using ExecutionSignature = void(_1, _2);
143 template <
typename ParticleType>
146 numSteps = p.GetNumberOfSteps();
154 ComputeNumPoints() {}
155 using ControlSignature = void(FieldIn, FieldIn, FieldOut);
156 using ExecutionSignature = void(_1, _2, _3);
160 template <
typename ParticleType>
161 VTKM_EXEC void operator()(
const ParticleType& p,
165 diff = 1 + p.GetNumberOfSteps() - initialNumSteps;
171 template <
typename IntegratorType,
typename ParticleType>
175 template <
typename Po
intStorage,
typename Po
intStorage2>
176 void Run(
const IntegratorType& it,
183 using ParticleWorkletDispatchType =
193 getStepDispatcher.Invoke(particles, initialStepsTaken);
205 StreamlineArrayType streamlines(particles, MaxSteps);
206 ParticleWorkletDispatchType particleWorkletDispatch;
208 particleWorkletDispatch.Invoke(idxArray, it, streamlines, maxSteps);
211 streamlines.GetCompactedHistory(positions);
216 detail::ComputeNumPoints{}) };
217 computeNumPointsDispatcher.Invoke(particles, initialStepsTaken, numPoints);
239 #endif // vtk_m_filter_flow_worklet_ParticleAdvectionWorklets_h