[FLASH-USERS] merge_amr.pro sampling bug and fix

James Guillochon jfg at ucolick.org
Fri Dec 10 18:09:42 EST 2010


Hi all,

Just thought I would share a small bug in merge_amr.pro (included in tools/fidlr3), and the fix to the bug. Currently, if you try to downsample more than a few levels in a 3d dataset, the exits with an error. The fix is simple, simply copy the lines from the block inclusion routine for the 2d case (lines 402 and 403) to the 3d case within merge_amr.pro. The new block of code should look like this:

400 case params.ndim of                                                                                                                                                                                                                                                                                           
401   2: plotBlocks = where(((tree[*].nodeType EQ 1 AND $                                                                                                                                                                                                                                                         
402                           tree[*].lrefine LT lwant) OR $                                                                                                                                                                                                                                                      
403                          (tree[*].lrefine EQ lwant)) AND $                                                                                                                                                                                                                                                   
404                         tree[*].bndBox[1,0] GE xrange[0] AND $                                                                                                                                                                                                                                                
405                         tree[*].bndBox[0,0] LE xrange[1] AND $                                                                                                                                                                                                                                               
406                         tree[*].bndBox[1,1] GE yrange[0] AND $                                                                                                                                                                                                                                                
407                         tree[*].bndBox[0,1] LE yrange[1])                                                                                                                                                                                                                                                    
408                                                                                                                                                                                                                                                                                                               
409   3: plotBlocks = where(((tree[*].nodeType EQ 1 AND $                                                                                                                                                                                                                                                         
410                           tree[*].lrefine LT lwant) OR $                                                                                                                                                                                                                                                      
411                          (tree[*].lrefine EQ lwant)) AND $                                                                                                                                                                                                                                                   
412                         tree[*].bndBox[1,0] GE xrange[0] AND $                                                                                                                                                                                                                                                
413                         tree[*].bndBox[0,0] LE xrange[1] AND $                                                                                                                                                                                                                                               
414                         tree[*].bndBox[1,1] GE yrange[0] AND $                                                                                                                                                                                                                                                
415                         tree[*].bndBox[0,1] LE yrange[1] AND $                                                                                                                                                                                                                                               
416                         tree[*].bndBox[1,2] GE zrange[0] AND $                                                                                                                                                                                                                                                
417                         tree[*].bndBox[0,2] LE zrange[1])

This will include non-leaf blocks if the requested sampling is sufficiently coarse.

-- 
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/20101210/c4460ac4/attachment.htm>


More information about the flash-users mailing list