# HG changeset patch # User Britton Smith # Date 1247588758 21600 # Branch raytrace # Node ID f0df96c8e8874fe1dd5526adb6f4254a6e35ec6c # Parent b2a83377938656c37e9f0fd6fee1be44e94d47ee Added check to see if dt in a cell is greater than 0 before setting the max. diff -r b2a83377938656c37e9f0fd6fee1be44e94d47ee -r f0df96c8e8874fe1dd5526adb6f4254a6e35ec6c yt/lagos/RTIntegrator.pyx --- a/yt/lagos/RTIntegrator.pyx Mon Jul 13 09:33:11 2009 -0700 +++ b/yt/lagos/RTIntegrator.pyx Tue Jul 14 10:25:58 2009 -0600 @@ -127,33 +127,43 @@ not (0 <= cur_ind[1] < grid_mask.shape[1]) or \ not (0 <= cur_ind[2] < grid_mask.shape[2]): break - else: - grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 +# else: +# grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 # Note that we are calculating t on the fly, but we get *negative* t # values from what they should be. # If we've reached t = 1, we are done. if tmax[0] >= 1 and tmax[1] >= 1 and tmax[2] >= 1: grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = 1.0 - enter_t + if grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] > 0: + grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 break if tmax[0] < tmax[1]: if tmax[0] < tmax[2]: grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[0] - enter_t + if grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] > 0: + grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 enter_t = tmax[0] tmax[0] += tdelta[0] cur_ind[0] += step[0] else: grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t + if grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] > 0: + grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 enter_t = tmax[2] tmax[2] += tdelta[2] cur_ind[2] += step[2] else: if tmax[1] < tmax[2]: grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[1] - enter_t + if grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] > 0: + grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 enter_t = tmax[1] tmax[1] += tdelta[1] cur_ind[1] += step[1] else: grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] = tmax[2] - enter_t + if grid_t[cur_ind[0], cur_ind[1], cur_ind[2]] > 0: + grid_mask[cur_ind[0], cur_ind[1], cur_ind[2]] = 1 enter_t = tmax[2] tmax[2] += tdelta[2] cur_ind[2] += step[2]