Go to the documentation of this file.
13 #ifndef vtk_m_filter_flow_worklet_RK4Integrator_h
14 #define vtk_m_filter_flow_worklet_RK4Integrator_h
26 template <
typename ExecEvaluatorType>
36 template <
typename Particle>
44 if ((time + stepLength + vtkm::Epsilon<vtkm::FloatDefault>() - boundary) > 0.0)
45 stepLength = boundary - time;
63 evalStatus = this->
Evaluator.Evaluate(inpos, time, k1);
66 v1 = particle.
Velocity(k1, stepLength);
68 evalStatus = this->
Evaluator.Evaluate(inpos + var1 * v1, var2, k2);
71 v2 = particle.
Velocity(k2, stepLength);
73 evalStatus = this->
Evaluator.Evaluate(inpos + var1 * v2, var2, k3);
76 v3 = particle.
Velocity(k3, stepLength);
78 evalStatus = this->
Evaluator.Evaluate(inpos + stepLength * v3, var3, k4);
81 v4 = particle.
Velocity(k4, stepLength);
93 template <
typename EvaluatorType>
111 ->
ExecRK4Integrator<decltype(this->Evaluator.PrepareForExecution(device, token))>
113 auto evaluator = this->Evaluator.PrepareForExecution(device, token);
114 using ExecEvaluatorType = decltype(evaluator);
123 #endif // vtk_m_filter_flow_worklet_RK4Integrator_h
VTKM_EXEC_CONT detail::FloatingPointReturnType< T >::Type MagnitudeSquared(const T &x)
Returns the square of the magnitude of a vector.
Definition: VectorAnalysis.h:64
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
Definition: RK4Integrator.h:94
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
Definition: Particle.h:90
VTKM_EXEC_CONT vtkm::Vec3f GetEvaluationPosition(const vtkm::FloatDefault &deltaT) const
Definition: Particle.h:155
VTKM_CONT RK4Integrator()=default
VTKM_EXEC_CONT bool CheckFail() const
Definition: GridEvaluatorStatus.h:39
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
A short variable-length array with maximum length.
Definition: VecVariable.h:30
EvaluatorType Evaluator
Definition: RK4Integrator.h:97
Definition: IntegratorStatus.h:33
VTKM_EXEC_CONT vtkm::FloatDefault GetTime() const
Definition: Particle.h:141
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_EXEC_CONT ExecRK4Integrator(const ExecEvaluatorType &evaluator)
Definition: RK4Integrator.h:31
VTKM_EXEC_CONT vtkm::Vec3f Velocity(const vtkm::VecVariable< vtkm::Vec3f, 2 > &vectors, const vtkm::FloatDefault &vtkmNotUsed(length))
Definition: Particle.h:145
Definition: DeviceAdapterTag.h:52
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:198
VTKM_EXEC IntegratorStatus CheckStep(Particle &particle, vtkm::FloatDefault stepLength, vtkm::Vec3f &velocity) const
Definition: RK4Integrator.h:37
Definition: RK4Integrator.h:27
VTKM_CONT RK4Integrator(const EvaluatorType &evaluator)
Definition: RK4Integrator.h:104
VTKM_CONT auto PrepareForExecution(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const -> ExecRK4Integrator< decltype(this->Evaluator.PrepareForExecution(device, token))>
Definition: RK4Integrator.h:109
static VTKM_EXEC_CONT T ZeroInitialization()
Definition: TypeTraits.h:75
ExecEvaluatorType Evaluator
Definition: RK4Integrator.h:90
Definition: GridEvaluatorStatus.h:23