Hi Carla,

So it looks like ref_factors is only defined in the boxlib frontend, which is why it doesn't work for your Enzo data. Boxlib needs a concept of ref_factors because it allows AMR refinement jumps larger than a factor of two on a single level (i.e. level 2 might be four times higher resolution as level 1). Enzo and many other AMR codes do not allow this, instead only allowing a factor of two increase in linear resolution per AMR level.

The dimensions you want to use depend on what fraction of the full domain you want to interpolate to uniform resolution. It looks like you want to create a covering grid covering your full domain, so to create a covering grid at the same resolution as AMR level 3 you would do:

all_data_level_3 = ds.covering_grid(level=2, left_edge=[0,0.0,0.0],
                                    dims=ds.domain_dimensions * 2**3)

This is because each refinement level jump in an Enzo simulation corresponds to a factor of two increase in spatial resolution.

Hope that makes sense,

Nathan

On Thu, Nov 19, 2015 at 8:58 AM, Carla Bernhardt <carla.j.bernhardt@gmail.com> wrote:
Thank you for your quick response. However, when I used:

ref = int(np.product(ds.ref_factors[0:3])),

I got this error:

AttributeError: 'EnzoDataset' object has no attribute 'ref_factors'

Did I misunderstand your suggestion? Or do I need to import something?

Thanks,

Carla


2015-11-19 15:39 GMT+01:00 Michael Zingale <michael.zingale@stonybrook.edu>:
I've done this in the past:

ref = int(np.product(ds.ref_factors[0:max_level]))                          
                                                                                
# allocate for our uniformly-gridded result                                 
dims = ds.domain_dimensions*ref       

this will work for a more general case when the jump between levels can change as a function of level.

On Thu, Nov 19, 2015 at 9:10 AM, Carla Bernhardt <carla.j.bernhardt@gmail.com> wrote:
Dear YT Users,

To better understand covering_grid (or smoothed_covering_grid), can someone explain what dimensions I should use when I have multiple levels of refinement? If I have 1 level of refinement from AMR data, the dimensions should be the same, I believe, but what if I have 2 or 3 levels of refinement? Should the fixed resolution region then have dimensions of dims*2^2 and dims*3^2 respectively?

Here is one example from a tutorial if that helps isolate my question:
all_data_level_2 = ds.covering_grid(level=2, left_edge=[0,0.0,0.0],
                                      dims=ds.domain_dimensions * 2**2)

Thanks in advance,
Carla

_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org




--
Michael Zingale
Associate Professor

Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800
phone:  631-632-8225


_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org