From 18ace1d64b3213a0b9a6018f7c02b906f0d2031c Mon Sep 17 00:00:00 2001 From: Christian Sendlinger Date: Tue, 27 Feb 2024 11:34:21 +0100 Subject: [PATCH] bugfix in zero gyro radius guard --- src/simulation/mover.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/simulation/mover.cpp b/src/simulation/mover.cpp index 1ea13f2..a2c2975 100755 --- a/src/simulation/mover.cpp +++ b/src/simulation/mover.cpp @@ -9,6 +9,7 @@ #include "simulation/particle.h" #include "simulation/reflector.h" #include "simulation/terminator.h" +#include "constants/sim_constants.h" #include "tools/simulation_time.h" @@ -223,7 +224,7 @@ void DriftMover::move(particle::Particle* particle, const blitz::TinyVector dv_electric = timestep * particle->charge_C() * E_parallel / particle->mass_kg(); - if (v_perp_norm > 0.) { + if (v_perp_norm > SimConstants::compare_epsilon) { const double gyro_radius = particle->mass_kg() * v_perp_norm / (B_norm * std::abs(particle->charge_C()));