[FLASH-USERS] getting neighbor blocks and blocks on the corners for a given block

Suoqing Ji suoqing at physics.ucsb.edu
Fri Oct 13 14:44:54 EDT 2017


Hi John,

One thing which might work is to connect the current point with the corner of current block, and extend the connecting line into the other side (with length smaller than half of the current block size to avoid any overshoot), then you get a point located in the “corner” block. Next, you can use Grid_getBlkIDFromPos to get the ID of the corner block.

Another similar thing is to use Grid_getBlkNeighBlkIDFromPos twice: provide a position in neighbor block and a correct direction to find the corner block...

Best wishes,
—
Suoqing Ji
Ph.D Candidate
Department of Physics
University of California, Santa Barbara
http://physics.ucsb.edu/~suoqing

On Oct 13, 2017, 11:16 AM -0700, John ZuHone <jzuhone at gmail.com>, wrote:
> Hi folks,
>
> I want to design an algorithm where I can pick a point in the domain based on a particle position, and find all of the particles within a given radius, where this radius is roughly a factor of a few times the local cell size. Based off a suggestion from Paul Ricker, my plan is to query only the particles within the block containing my particle and its surrounding blocks. This would mean I would need to query not only the neighbor blocks, but also the blocks which are on the “corners” of my block.
>
> Does anyone have any suggestions as to the best way to get this information, assuming a PARAMESH simulation? Getting the processor ID and block ID of neighbors is straightforward, but what about the blocks on the corners?
>
> Best,
>
> John Z
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20171013/5cea9e20/attachment.htm>


More information about the flash-users mailing list