[FLASH-USERS] Question re yt covering_grid
Ryan Farber
rjfarber at umich.edu
Sun Mar 30 13:16:42 EDT 2025
Hi Jesse,
1. I think this is more appropriately for the yt community slack or their
other help platforms, since your question isn't really FLASH specific.
2. Both snippets are technically valid; you will lose information if you
set up a covering grid at a lower resolution than your simulation (but
sometimes that's intentional which is fine). So probably you want your
snippet 2. Although I think you'd have an issue if you're running in 2D.
Also note that yt is 0-based whereas FLASH's refinement is 1-based.
Best wishes,
--------
Ryan
On Sat, Mar 29, 2025 at 8:32 PM Jesse Chen <cxxgc at msn.com> wrote:
> Dear Flash engineers and users,
>
>
>
> Hope this email finds you well.
>
>
>
> I am using yt package of python for processing data from hdf5 files
> generated with FLASH. I have a question concerning the refinement level. In
> dealing with hdf5 files, do I need to fix the refinement level or use the
> highest one? i.e. Which one of the python snippets below is correct for 2D
> heatmap plotting and data extraction?
>
> Snippet I.
>
> refinement_level = 2 # 2 only for example
>
> domain_left_edge = ds.domain_left_edge.to("cm")
>
> domain_right_edge= ds.domain_right_edge.to("cm")
>
> domain_dimensions= ds.domain_dimensions
>
>
>
> cg = ds.covering_grid(
>
> level = refinement_level,
>
> left_edge=domain_left_edge,
>
> dims = domain_dimensions * 2**refinement_level,
>
> )
>
>
>
> Snippet II.
>
>
>
> max_level = ds.max_level
>
> base_dims = ds.domain_dimensions
>
> highres_dims = base_dims * 2**max_level
>
> domain_left_edge = ds.domain_left_edge.to("cm")
>
> domain_right_edge = ds.domain_right_edge.to("cm")
>
>
>
> cg = ds.covering_grid(
>
> level = max_level,
>
> left_edge = domain_left_edge,
>
> dims = highres_dims,
>
> )
>
>
>
> And for your reference, in the par file, my settings are
>
> lrefine_max = 4
>
> lrefine_min = 1
>
>
>
> Thanks in advance for your advice.
>
>
>
> Cheers,
>
>
>
> Jesse
>
>
> _______________________________________________
> 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/20250330/b6aa5e17/attachment.htm>
More information about the flash-users
mailing list