We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 741182c commit 7268811Copy full SHA for 7268811
1 file changed
src/particle.cpp
@@ -220,7 +220,12 @@ void Particle::event_advance()
220
221
// Sample a distance to collision
222
if (type() == ParticleType::electron || type() == ParticleType::positron) {
223
- collision_distance() = 0.0;
+ collision_distance() = INFINITY;
224
+ if (material() != MATERIAL_VOID) {
225
+ double density = model::materials[material()]->density();
226
+ if (density > 0.0)
227
+ collision_distance() = 0.0;
228
+ }
229
} else if (macro_xs().total == 0.0) {
230
collision_distance() = INFINITY;
231
} else {
0 commit comments