Right, I was suggesting to add a comment explaining how to adapt it for non-AMReX codes.

Another option would be to define a ref_factor property on the base dataset class that just returns an array filled with 2s and then AMReX could override that. That way ds.ref_factor would always be valid.

On Mon, Jun 3, 2019 at 3:33 PM Michael Zingale <michael.zingale@stonybrook.edu> wrote:
I think I wrote that original example, and for our data sets, the refinement ratio is variable and can change between levels, hence the general approach there.  Maybe there is a way to make it work for all frontends? because if you modify the example to take out the ref_factor, then it will break AMReX codes.

On Mon, Jun 3, 2019 at 3:24 PM Nathan Goldbaum <nathan12343@gmail.com> wrote:
Yup, that's correct, I believe ref_factors is only defined for boxlib data like that example.

If you'd like to make a pull request to improve that example I think it would be readily accepted. The source code for that example lives here: https://github.com/yt-project/yt/blob/master/doc/source/cookbook/power_spectrum_example.py

There are instructions for how to make a pull request in our contributor's guide:


On Mon, Jun 3, 2019 at 3:17 PM Salome Mtchedlidze <salomchedlidze@gmail.com> wrote:
Hello again,

Apologize, I have just been told that I just need to write instead of

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

ref = 2**max_level

since ENZO only refines with the factor of 2.

Thanks,
Salome
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.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@python.org
To unsubscribe send an email to yt-users-leave@python.org