Go to the documentation of this file.
10 #ifndef vtk_m_Particle_h
11 #define vtk_m_Particle_h
80 s <<
"[ok= " << status.
CheckOk();
263 return vtkm::RSqrt(1.0 + fMom2 * m2_c2_reci);
285 const vtkm::Vec3f t = 0.5 * QoM * length * bField * gamma_reci;
306 return this->
Position + translation;
354 struct Serialization<
vtkm::Particle>
360 vtkmdiy::save(bb, p.
GetID());
363 vtkmdiy::save(bb, p.
GetTime());
391 struct Serialization<
vtkm::ChargedParticle>
397 vtkmdiy::save(bb, e.
ID);
399 vtkmdiy::save(bb, e.
Status);
400 vtkmdiy::save(bb, e.
Time);
401 vtkmdiy::save(bb, e.
Mass);
402 vtkmdiy::save(bb, e.
Charge);
422 #endif // vtk_m_Particle_h
A bitmap to serve different needs.
Definition: Bitset.h:28
vtkm::Float64 Weighting
Definition: Particle.h:325
friend std::ostream & operator<<(std::ostream &out, const vtkm::ChargedParticle &p)
Definition: Particle.h:309
bool CheckTerminate() const
Definition: Particle.h:40
T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
bool CanContinue() const
Definition: Particle.h:62
vtkm::ParticleStatus Status
Definition: Particle.h:172
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Float32 Sqrt(vtkm::Float32 x)
Definition: Math.h:943
const vtkm::Vec3f & GetPosition() const
Definition: Particle.h:239
void SetStatus(vtkm::ParticleStatus status)
Definition: Particle.h:139
vtkm::Id ID
Definition: Particle.h:319
void SetPosition(const vtkm::Vec3f &position)
Definition: Particle.h:240
void ClearTemporalBounds()
Definition: Particle.h:47
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
void SetTime(vtkm::FloatDefault time)
Definition: Particle.h:142
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
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
void SetPosition(const vtkm::Vec3f &position)
Definition: Particle.h:129
void ClearZeroVelocity()
Definition: Particle.h:59
Definition: Particle.h:90
vtkm::Particle & operator=(const vtkm::Particle &)=default
vtkm::ParticleStatus Status
Definition: Particle.h:321
bool CheckFail() const
Definition: Particle.h:36
void SetFail()
Definition: Particle.h:35
void SetZeroVelocity()
Definition: Particle.h:58
vtkm::Id GetNumberOfSteps() const
Definition: Particle.h:245
std::ostream & operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
Helper function for printing bounds during testing.
Definition: Bounds.h:248
static void load(BinaryBuffer &bb, vtkm::ChargedParticle &e)
Definition: Particle.h:407
void SetTerminate()
Definition: Particle.h:38
vtkm::Vec3f Momentum
Definition: Particle.h:326
static constexpr vtkm::Id IN_GHOST_CELL_BIT
Definition: Particle.h:74
~Particle() noexcept
Definition: Particle.h:122
vtkm::Vec3f Position
Definition: Particle.h:318
static constexpr vtkm::Id TOOK_ANY_STEPS_BIT
Definition: Particle.h:73
vtkm::ParticleStatus GetStatus() const
Definition: Particle.h:137
bool CheckSpatialBounds() const
Definition: Particle.h:44
const vtkm::Vec3f & GetPosition() const
Definition: Particle.h:128
bool CheckOk() const
Definition: Particle.h:33
static constexpr vtkm::Id TEMPORAL_BOUNDS_BIT
Definition: Particle.h:72
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:180
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
vtkm::Float64 Mass
Definition: Particle.h:323
Definition: Particle.h:351
vtkm::IdComponent GetNumberOfComponents() const
Definition: VecVariable.h:53
void SetTime(vtkm::FloatDefault time)
Definition: Particle.h:253
ChargedParticle()
Definition: Particle.h:192
vtkm::Vec3f GetEvaluationPosition(const vtkm::FloatDefault &deltaT) const
Definition: Particle.h:301
vtkm::Float64 Charge
Definition: Particle.h:324
void SetTookAnySteps()
Definition: Particle.h:50
vtkm::Float64 Gamma(const vtkm::Vec3f &momentum, bool reciprocal=false) const
Definition: Particle.h:256
detail::FloatingPointReturnType< T >::Type MagnitudeSquared(const T &x)
Returns the square of the magnitude of a vector.
Definition: VectorAnalysis.h:64
bool test(vtkm::Id bitIndex) const
Definition: Bitset.h:53
void SetOk()
Definition: Particle.h:32
void reset(vtkm::Id bitIndex)
Definition: Bitset.h:43
Definition: Particle.h:188
static constexpr vtkm::Id ZERO_VELOCITY
Definition: Particle.h:75
vtkm::Vec3f Velocity(const vtkm::VecVariable< vtkm::Vec3f, 2 > &vectors, const vtkm::FloatDefault &length) const
Definition: Particle.h:269
static size_t Sizeof()
Definition: Particle.h:333
void ClearTookAnySteps()
Definition: Particle.h:51
A short variable-length array with maximum length.
Definition: VecVariable.h:30
void SetNumberOfSteps(vtkm::Id numSteps)
Definition: Particle.h:246
vtkm::FloatDefault GetTime() const
Definition: Particle.h:252
static void save(BinaryBuffer &bb, const vtkm::Particle &p)
Definition: Particle.h:357
void ClearInGhostCell()
Definition: Particle.h:55
vtkm::ChargedParticle & operator=(const vtkm::ChargedParticle &)=default
void ClearTerminate()
Definition: Particle.h:39
vtkm::FloatDefault GetTime() const
Definition: Particle.h:141
static void load(BinaryBuffer &bb, vtkm::Particle &p)
Definition: Particle.h:366
vtkm::ParticleStatus GetStatus() const
Definition: Particle.h:248
Particle()
Definition: Particle.h:94
static size_t Sizeof()
Definition: Particle.h:176
void SetID(vtkm::Id id)
Definition: Particle.h:243
constexpr static vtkm::FloatDefault SPEED_OF_LIGHT
Definition: Particle.h:327
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
bool CheckInGhostCell() const
Definition: Particle.h:56
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:169
Definition: Particle.h:23
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
bool CheckTookAnySteps() const
Definition: Particle.h:52
static constexpr vtkm::Id SUCCESS_BIT
Definition: Particle.h:69
vtkm::Vec3f Position
Definition: Particle.h:169
vtkm::FloatDefault Time
Definition: Particle.h:173
ParticleStatus()
Definition: Particle.h:26
void SetStatus(vtkm::ParticleStatus status)
Definition: Particle.h:250
vtkm::Id NumSteps
Definition: Particle.h:320
vtkm::Vec< vtkm::FloatDefault, 3 > Vec3f
Vec3f corresponds to a 3-dimensional vector of floating point values.
Definition: Types.h:1052
bool CheckZeroVelocity() const
Definition: Particle.h:60
detail::FloatingPointReturnType< T >::Type Magnitude(const T &x)
Returns the magnitude of a vector.
Definition: VectorAnalysis.h:100
static void save(BinaryBuffer &bb, const vtkm::ChargedParticle &e)
Definition: Particle.h:394
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
vtkm::Id ID
Definition: Particle.h:170
void ClearSpatialBounds()
Definition: Particle.h:43
static constexpr vtkm::Id SPATIAL_BOUNDS_BIT
Definition: Particle.h:71
vtkm::Id GetID() const
Definition: Particle.h:242
static constexpr vtkm::Id TERMINATE_BIT
Definition: Particle.h:70
vtkm::Vec3f Velocity(const vtkm::VecVariable< vtkm::Vec3f, 2 > &vectors, const vtkm::FloatDefault &) const
Definition: Particle.h:145
ChargedParticle(const vtkm::ChargedParticle &other)
Definition: Particle.h:217
vtkm::Vec3f GetEvaluationPosition(const vtkm::FloatDefault &deltaT) const
Definition: Particle.h:155
vtkm::FloatDefault Time
Definition: Particle.h:322
void SetInGhostCell()
Definition: Particle.h:54
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
vtkm::ParticleStatus & GetStatus()
Definition: Particle.h:138
void SetNumberOfSteps(vtkm::Id numSteps)
Definition: Particle.h:135
void SetSpatialBounds()
Definition: Particle.h:42
void SetID(vtkm::Id id)
Definition: Particle.h:132
void set(vtkm::Id bitIndex)
Definition: Bitset.h:30
bool CheckTemporalBounds() const
Definition: Particle.h:48
~ChargedParticle() noexcept
Definition: Particle.h:233
vtkm::Id GetID() const
Definition: Particle.h:131
vtkm::ParticleStatus & GetStatus()
Definition: Particle.h:249
Particle(const vtkm::Particle &p)
Definition: Particle.h:111
vtkm::Id GetNumberOfSteps() const
Definition: Particle.h:134
vtkm::Id NumSteps
Definition: Particle.h:171
void SetTemporalBounds()
Definition: Particle.h:46
friend std::ostream & operator<<(std::ostream &out, const vtkm::Particle &p)
Definition: Particle.h:161