Go to the documentation of this file.
10 #ifndef vtk_m_Particle_h
11 #define vtk_m_Particle_h
80 s <<
"[ok= " << status.
CheckOk();
240 return vtkm::RSqrt(1.0 + fMom2 * m2_c2_reci);
262 const vtkm::Vec3f t = 0.5 * QoM * length * bField * gamma_reci;
285 return this->
Position + translation;
334 struct Serialization<
vtkm::Particle>
340 vtkmdiy::save(bb, p.
GetID());
343 vtkmdiy::save(bb, p.
GetTime());
371 struct Serialization<
vtkm::ChargedParticle>
377 vtkmdiy::save(bb, e.
ID);
379 vtkmdiy::save(bb, e.
Status);
380 vtkmdiy::save(bb, e.
Time);
381 vtkmdiy::save(bb, e.
Mass);
382 vtkmdiy::save(bb, e.
Charge);
402 #endif // vtk_m_Particle_h
VTKM_EXEC_CONT void reset(vtkm::Id bitIndex)
Definition: Bitset.h:43
A bitmap to serve different needs.
Definition: Bitset.h:28
VTKM_EXEC_CONT vtkm::Float64 Gamma(vtkm::Vec3f momentum, bool reciprocal=false) const
Definition: Particle.h:233
VTKM_EXEC_CONT vtkm::Vec3f GetEvaluationPosition(const vtkm::FloatDefault &deltaT) const
Definition: Particle.h:280
VTKM_EXEC_CONT vtkm::Float32 Sqrt(vtkm::Float32 x)
Compute the square root of x.
Definition: Math.h:958
VTKM_EXEC_CONT void ClearInGhostCell()
Definition: Particle.h:55
VTKM_EXEC_CONT vtkm::ParticleStatus & GetStatus()
Definition: Particle.h:226
vtkm::Float64 Weighting
Definition: Particle.h:304
static VTKM_CONT void load(BinaryBuffer &bb, vtkm::ChargedParticle &e)
Definition: Particle.h:387
VTKM_CONT friend std::ostream & operator<<(std::ostream &out, const vtkm::ChargedParticle &p)
Definition: Particle.h:288
VTKM_EXEC_CONT detail::FloatingPointReturnType< T >::Type MagnitudeSquared(const T &x)
Returns the square of the magnitude of a vector.
Definition: VectorAnalysis.h:64
VTKM_EXEC_CONT bool CheckTerminate() const
Definition: Particle.h:40
vtkm::ParticleStatus Status
Definition: Particle.h:172
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC_CONT vtkm::Vec3f Velocity(const vtkm::VecVariable< vtkm::Vec3f, 2 > &vectors, const vtkm::FloatDefault &length)
Definition: Particle.h:246
VTKM_EXEC_CONT void ClearSpatialBounds()
Definition: Particle.h:43
vtkm::Id ID
Definition: Particle.h:298
VTKM_EXEC_CONT Particle(const vtkm::Vec3f &p, const vtkm::Id &id, const vtkm::Id &numSteps=0, const vtkm::ParticleStatus &status=vtkm::ParticleStatus(), const vtkm::FloatDefault &time=0)
Definition: Particle.h:97
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_EXEC_CONT vtkm::ParticleStatus GetStatus() const
Definition: Particle.h:225
Definition: Particle.h:90
VTKM_EXEC_CONT vtkm::Vec3f GetEvaluationPosition(const vtkm::FloatDefault &deltaT) const
Definition: Particle.h:155
VTKM_EXEC_CONT void SetTime(vtkm::FloatDefault time)
Definition: Particle.h:142
VTKM_EXEC_CONT bool test(vtkm::Id bitIndex) const
Definition: Bitset.h:53
vtkm::Particle & operator=(const vtkm::Particle &)=default
VTKM_EXEC_CONT detail::FloatingPointReturnType< T >::Type Magnitude(const T &x)
Returns the magnitude of a vector.
Definition: VectorAnalysis.h:100
vtkm::ParticleStatus Status
Definition: Particle.h:300
VTKM_EXEC_CONT void SetPosition(const vtkm::Vec3f &position)
Definition: Particle.h:217
vtkm::Vec3f Momentum
Definition: Particle.h:305
static constexpr vtkm::Id IN_GHOST_CELL_BIT
Definition: Particle.h:74
VTKM_EXEC_CONT void SetID(vtkm::Id id)
Definition: Particle.h:220
vtkm::Vec3f Position
Definition: Particle.h:297
static constexpr vtkm::Id TOOK_ANY_STEPS_BIT
Definition: Particle.h:73
VTKM_EXEC_CONT ParticleStatus()
Definition: Particle.h:26
VTKM_EXEC_CONT bool CheckSpatialBounds() const
Definition: Particle.h:44
static constexpr vtkm::Id TEMPORAL_BOUNDS_BIT
Definition: Particle.h:72
vtkm::Float64 Mass
Definition: Particle.h:302
Definition: Particle.h:331
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
VTKM_EXEC_CONT void SetTerminate()
Definition: Particle.h:38
VTKM_EXEC_CONT void ClearZeroVelocity()
Definition: Particle.h:59
VTKM_EXEC_CONT bool CheckInGhostCell() const
Definition: Particle.h:56
VTKM_EXEC_CONT bool CheckOk() const
Definition: Particle.h:33
const VTKM_EXEC_CONT vtkm::Vec3f & GetPosition() const
Definition: Particle.h:216
vtkm::Float64 Charge
Definition: Particle.h:303
VTKM_EXEC_CONT vtkm::IdComponent GetNumberOfComponents() const
Definition: VecVariable.h:53
Definition: Particle.h:188
VTKM_EXEC_CONT void ClearTerminate()
Definition: Particle.h:39
VTKM_EXEC_CONT void SetID(vtkm::Id id)
Definition: Particle.h:132
VTKM_EXEC_CONT vtkm::ParticleStatus & GetStatus()
Definition: Particle.h:138
static constexpr vtkm::Id ZERO_VELOCITY
Definition: Particle.h:75
VTKM_EXEC_CONT void SetTime(vtkm::FloatDefault time)
Definition: Particle.h:230
static size_t Sizeof()
Definition: Particle.h:312
A short variable-length array with maximum length.
Definition: VecVariable.h:30
VTKM_EXEC_CONT void SetFail()
Definition: Particle.h:35
VTKM_EXEC_CONT vtkm::Vec< typename detail::FloatingPointReturnType< T >::Type, 3 > Cross(const vtkm::Vec< T, 3 > &x, const vtkm::Vec< T, 3 > &y)
Find the cross product of two vectors.
Definition: VectorAnalysis.h:177
VTKM_EXEC_CONT void SetNumberOfSteps(vtkm::Id numSteps)
Definition: Particle.h:223
static VTKM_CONT void load(BinaryBuffer &bb, vtkm::Particle &p)
Definition: Particle.h:346
VTKM_EXEC_CONT vtkm::FloatDefault GetTime() const
Definition: Particle.h:141
VTKM_EXEC_CONT bool CheckFail() const
Definition: Particle.h:36
static size_t Sizeof()
Definition: Particle.h:176
VTKM_CONT std::ostream & operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
Helper function for printing bounds during testing.
Definition: Bounds.h:237
constexpr static vtkm::FloatDefault SPEED_OF_LIGHT
Definition: Particle.h:306
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_EXEC_CONT ~Particle() noexcept
Definition: Particle.h:122
VTKM_EXEC_CONT void SetInGhostCell()
Definition: Particle.h:54
VTKM_EXEC_CONT vtkm::Vec3f Velocity(const vtkm::VecVariable< vtkm::Vec3f, 2 > &vectors, const vtkm::FloatDefault &vtkmNotUsed(length))
Definition: Particle.h:145
uint8_t UInt8
Definition: Types.h:157
Definition: Particle.h:23
VTKM_EXEC_CONT vtkm::ParticleStatus GetStatus() const
Definition: Particle.h:137
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
VTKM_EXEC_CONT ChargedParticle(const vtkm::Vec3f &position, const vtkm::Id &id, const vtkm::Float64 &mass, const vtkm::Float64 &charge, const vtkm::Float64 &weighting, const vtkm::Vec3f &momentum, const vtkm::Id &numSteps=0, const vtkm::ParticleStatus &status=vtkm::ParticleStatus(), const vtkm::FloatDefault &time=0)
Definition: Particle.h:195
static constexpr vtkm::Id SUCCESS_BIT
Definition: Particle.h:69
VTKM_CONT friend std::ostream & operator<<(std::ostream &out, const vtkm::Particle &p)
Definition: Particle.h:161
vtkm::Vec3f Position
Definition: Particle.h:169
vtkm::FloatDefault Time
Definition: Particle.h:173
static VTKM_CONT void save(BinaryBuffer &bb, const vtkm::Particle &p)
Definition: Particle.h:337
VTKM_EXEC_CONT void SetNumberOfSteps(vtkm::Id numSteps)
Definition: Particle.h:135
VTKM_EXEC_CONT vtkm::Id GetNumberOfSteps() const
Definition: Particle.h:222
vtkm::Id NumSteps
Definition: Particle.h:299
VTKM_EXEC_CONT vtkm::FloatDefault GetTime() const
Definition: Particle.h:229
vtkm::Vec< vtkm::FloatDefault, 3 > Vec3f
Vec3f corresponds to a 3-dimensional vector of floating point values.
Definition: Types.h:1014
VTKM_EXEC_CONT bool CheckZeroVelocity() const
Definition: Particle.h:60
VTKM_EXEC_CONT void SetStatus(vtkm::ParticleStatus status)
Definition: Particle.h:139
VTKM_EXEC_CONT void ClearTookAnySteps()
Definition: Particle.h:51
VTKM_EXEC_CONT bool CheckTemporalBounds() const
Definition: Particle.h:48
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:198
vtkm::Id ID
Definition: Particle.h:170
static constexpr vtkm::Id SPATIAL_BOUNDS_BIT
Definition: Particle.h:71
static constexpr vtkm::Id TERMINATE_BIT
Definition: Particle.h:70
VTKM_EXEC_CONT Particle(const vtkm::Particle &p)
Definition: Particle.h:111
VTKM_EXEC_CONT vtkm::Id GetID() const
Definition: Particle.h:131
vtkm::FloatDefault Time
Definition: Particle.h:301
VTKM_EXEC_CONT void set(vtkm::Id bitIndex)
Definition: Bitset.h:30
const VTKM_EXEC_CONT vtkm::Vec3f & GetPosition() const
Definition: Particle.h:128
VTKM_EXEC_CONT vtkm::Id GetNumberOfSteps() const
Definition: Particle.h:134
double Float64
Definition: Types.h:155
VTKM_EXEC_CONT void SetTemporalBounds()
Definition: Particle.h:46
VTKM_EXEC_CONT void SetStatus(vtkm::ParticleStatus status)
Definition: Particle.h:227
VTKM_EXEC_CONT Particle()
Definition: Particle.h:94
VTKM_EXEC_CONT bool CanContinue() const
Definition: Particle.h:62
VTKM_EXEC_CONT void SetSpatialBounds()
Definition: Particle.h:42
VTKM_EXEC_CONT void SetOk()
Definition: Particle.h:32
VTKM_EXEC_CONT bool CheckTookAnySteps() const
Definition: Particle.h:52
VTKM_EXEC_CONT void SetPosition(const vtkm::Vec3f &position)
Definition: Particle.h:129
VTKM_EXEC_CONT ChargedParticle()
Definition: Particle.h:192
VTKM_EXEC_CONT void ClearTemporalBounds()
Definition: Particle.h:47
VTKM_EXEC_CONT void SetZeroVelocity()
Definition: Particle.h:58
VTKM_EXEC_CONT void SetTookAnySteps()
Definition: Particle.h:50
vtkm::Id NumSteps
Definition: Particle.h:171
static VTKM_CONT void save(BinaryBuffer &bb, const vtkm::ChargedParticle &e)
Definition: Particle.h:374
VTKM_EXEC_CONT vtkm::Id GetID() const
Definition: Particle.h:219