From 2c49e477126748581892f4d1b13b74119cc53b80 Mon Sep 17 00:00:00 2001 From: JGonzalez Date: Mon, 6 Apr 2026 12:02:34 +0200 Subject: [PATCH] Avoid very low macroparticle weight --- src/modules/moduleInject.f90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/moduleInject.f90 b/src/modules/moduleInject.f90 index 2b23ac6..52e26d3 100644 --- a/src/modules/moduleInject.f90 +++ b/src/modules/moduleInject.f90 @@ -292,6 +292,9 @@ MODULE moduleInject ! Adjust the weight of particles to match the new current self%weightPerEdge(e) = self%weightPerEdge(e) + 1.0d-1 * alpha + ! Limit the weight of a macroparticle to 1.0 + self%weightPerEdge(e) = max(self%weightPerEdge(e), 1.d0) + end do end select