Matt, Nathan, Thank you so much, however we would like something more adaptive, to preserve the simulation high resolution. Along these lines, I thought it may help to compute something like 3*v + Lap[v]*dx^2 where Lap[] is the Laplacian operator. I noticed that it is possible to compute a gradient easily:
g = d.add_gradient_fields(('deposit', 'N-BODY_density')) g [('deposit', 'N-BODY_density_gradient_x'), ('deposit', 'N-BODY_density_gradient_y'), ('deposit', 'N-BODY_density_gradient_z'), ('deposit', 'N-BODY_density_gradient_magnitude')]
However, when I try to differentiate the gradient one more time, I get an error:
ggx = d.add_gradient_fields(('deposit', 'N-BODY_density_gradient_x')) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/gnedin/ART/yt/yt/data_objects/static_output.py", line 1391, in add_gradient_fields units = self.field_info[ftype, input_field].units File "/home/gnedin/ART/yt/yt/fields/field_info_container.py", line 330, in __missing__ raise KeyError("No field named %s" % (key,)) KeyError: "No field named ('deposit', 'N-BODY_density_gradient_x')"
What am I doing wrong? n On 2/1/19 11:19 AM, Nathan Goldbaum wrote:
I would also suggest looking into the arbitrary_grid data object, which will allow you to create a grid specifically for doing the deposit operation at the level of resolution you desire, decoupling the deposit operation from the AMR grid:
Create a 20 kpc^3 grid centered on the center of the simulation, with a resolution of 64^3, and deposit all of the particles onto it:
In [8]: grid = ds.arbitrary_grid(ds.domain_center - 10*yt.units.kpc, ds.domain_center + 10*yt.units.kpc, [64, 64, 64])
In [9]: grid['deposit', 'all_density'].shape Out[9]: (64, 64, 64)
On Fri, Feb 1, 2019 at 11:13 AM Matthew Turk
mailto:matthewturk@gmail.com> wrote: Hi Nick and Hanjue,
From any given selector object, you can specify the max level data will be drawn from; this should work with particle data in the ARTIO frontend, but because it may not overlap explicitly with the indexing system you should double check.
An example:
dd = ds.all_data() dd.max_level = 5
That will restrict up to and including level 5 data.
On Fri, Feb 1, 2019 at 11:11 AM Nick Gnedin
mailto:gnedin@fnal.gov> wrote: Folks,
We would like to use dark matter density in one of our simulations, however the build-in derived field ('deposit', 'N-BODY_density') is too noisy for our purposes. We can think of two ways to make it smoother: 1) to reduce the max refinement level of the underlying grid or 2) use SPH-like averaging on particles first before depositing them on the grid.
Since we are newbies, could someone give us a few hints on how to proceed with one or both of these approaches?
Many thanks,
Nick Hanjue _______________________________________________ yt-users mailing list -- yt-users@python.org mailto:yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org mailto:yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org mailto:yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org mailto:yt-users-leave@python.org