Skip to content

Commit fbe322c

Browse files
committed
now enable electrons and positrons to pass through empty domains
1 parent 741182c commit fbe322c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/particle.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ void Particle::event_advance()
220220

221221
// Sample a distance to collision
222222
if (type() == ParticleType::electron || type() == ParticleType::positron) {
223-
collision_distance() = 0.0;
223+
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+
}
224229
} else if (macro_xs().total == 0.0) {
225230
collision_distance() = INFINITY;
226231
} else {

0 commit comments

Comments
 (0)