[FLASH-USERS] Indexing Bug in Multipole_experimental

James Guillochon jfg at ucolick.org
Tue Sep 20 12:06:57 EDT 2011


Hi, I've discovered a small bug in Multipole_experimental. In a couple
places in gr_mpolePot* and gr_mpoleMom* there is the following set of lines:

rscaled = r * dr_inner_zone_inv
> dr_unit = int (ceiling (rscaled * inner_zone_grid_inv) * inner_zone_grid)
> Q_lower = inner_zone_Qlower (dr_unit)
>

Occasionally, if r is small enough, dr_unit will be 0, which causes an out
of bounds error when referencing inner_zone_Qlower. The fix is to replace
the dr_unit assignments with the following:

dr_unit = max(int (ceiling (rscaled * inner_zone_grid_inv) *
> inner_zone_grid), 1)
>

Cheers,
- James

-- 
James Guillochon
Department of Astronomy & Astrophysics
University of California, Santa Cruz
jfg at ucolick.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20110920/dacd1a65/attachment.htm>


More information about the flash-users mailing list