Added check for zero cross section when calculating distance to collision.

This commit is contained in:
Paul Romano 2012-01-18 18:26:16 -05:00
parent 97b8196c46
commit 7ba2b4d9ac

View file

@ -79,7 +79,11 @@ contains
call distance_to_boundary(p, d_boundary, surface_crossed, lattice_crossed)
! Sample a distance to collision
d_collision = -log(prn()) / material_xs % total
if (material_xs % total == ZERO) then
d_collision = INFINITY
else
d_collision = -log(prn()) / material_xs % total
end if
! Select smaller of the two distances
distance = min(d_boundary, d_collision)