[FLASH-USERS] How to get the coordinates of cells in blocks

kiyarash Taghiniyarami kiyarash.niyarami at gmail.com
Wed May 15 14:42:41 EDT 2024


Dear Ryan,
Thanks a lot for the answer. The issue is resolved.
 Best,

Kiya

On Wed, May 15, 2024 at 5:27 PM Ryan Farber <rjfarber at umich.edu> wrote:

> Hi Kiya,
>
> I don’t think you’ve provided quite enough information. Attaching the
> logfile would be helpful.
>
> Particularly, it’s unclear to me what you mean by nx=20. Do you mean you
> ran setup with -nxb=20? If so, you will have 20 cells (AKA zones) per
> block, as you wrote. Regarding your screenshot showing 400 cells total,
> then I guess you also have 20 blocks.
>
> You might have 20 blocks from setting nblockx=20 (in flash.par) or from
> refinement.
>
> In either case, in your Simulation_initBlock.F90 (or other file), the
> coordinator of all cells can be accessed by
>
> 1. call Grid_getListOfBlocks
> 2. Loop over the returned blocks
> 3. In that loop call Grid_getCellCoordinates (check Grid_interface for the
> precise subroutine name). You can choose to get cell coordinates at cell
> center, right edge, or left edge.
>
> ==
> If you want to know your cell coordinates just in post-processing using
> yt, I think your question would be appropriately asked on the yt slack help
> channel (and/or possibly their mailing list /IRC).
>
> But you should just have to do
> ds =yt.load(file_name)
> ad = ds.all_data()
> xcoords = ad[“x”]
>
> Hope that helps!
>
> Best,
> Ryan
>
> Sent from my iPhone
>
> > On May 15, 2024, at 6:54 AM, kiyarash Taghiniyarami <
> kiyarash.niyarami at gmail.com> wrote:
> >
> > 
> > Dear Users,
> >
> > I run a problem in flash in 1D with nx=20 with paramesh4. In the output
> file as hdf5 I got  "blocks" and "coordinates" which shows me the block in
> each direction (x,y,z) and the coordinates of the mid-block. But when I run
> yt to show the file status I understood that every block has some cells. In
> this case there are 20 cells for each block. So my question is how can I
> get the coordinates of those cells?
> > Because in the coordinates it just shows the midblock coordinates but
> not cells.
> > Any help would be appreciated.
> >
> > P.S. I attached the picture with the relevant parts highlighted.
> >
> > Best,
> > Kiya
> > <Screenshot from 2024-05-15 14-17-51.png>
> > _______________________________________________
> > flash-users mailing list
> > flash-users at flash.rochester.edu
> >
> > For list info, including unsubscribe:
> > https://flash.rochester.edu/mailman/listinfo/flash-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20240515/361bf3cf/attachment.htm>


More information about the flash-users mailing list