A paper, and affiliated GPL-licensed public code, was posted today
that may be of interest:
The paper itself has examples for gridding SPH particles, and it is
OpenMP parallel. This could be the basis for an interesting mechanism
for loading SPH data; one could imagine the initial procedure being
decomposition based on a fairly coarse PH-curve (allowing for overlap
between processors), feeding individual regions to the DTFE, and then
gridding them. It also includes TSC as well as SPH interpolation.
This could also be useful for a variety of other gridding processes
that yt does.
I've been trying to develop an ellipsoid container for YT to wrap around
the particles from the halo profiler as an object. I think I am stuck
because I don't quite understand parts of the code.
I'll try walk through sections of AMRSphereBase describing my
understanding of the code. I have the corresponding portion for the
ellipsoid I wrote up at this URL to compare with the sphere:
So please correct my misunderstanding of each section
in _get_list_of_grids(self, field = None):
-This section is trying to get a list of root grid tiles that may have
data within the sphere.
- It determines the grids with find_sphere_grids().
- It changes them to a list.
- It sorts them by level then x y z.
- It returns the list as an array.
in _is_fully_enclosed(self, grid):
-This section is to see if the grids have all corners inside the sphere.
- It finds the absolute displacement of each component of the corner from
- It finds the shortest path considering periodic BC.
- It finds the distance in 3D of the corner from the center of sphere.
- It returns true if all corners are within sphere, false if not.
in _get_cut_mask(self, grid, field=None):
I have a conceptual question here, what does cut mask mean? My impression
from the code is that if the cell is part of the object it becomes part of
the cut mask(cm=cutmask)?
-This section is the place that determines if each individual cells within
the possible grids is inside the sphere. (I have a feeling I'm completely
wrong on this point)
- It returns True if the grid is fully enclosed, skip checking for child
- It check if grid is not the same type as FakeGridForParticles,
GridChildMaskWrapper (which means it hasn't been cached yet) and if grid
is already part of the cut mask, if so return the cut mask as is.
- Check which of the cells in grids are part of the sphere as well as
child mask and assign it to cut mask
- Last, after cut mask is calculated, it check if it hasn't been cached
yet, if not, cache it to self._cut_mask[grid.id]
- Returns the cut mask
To emulate what's done by calling "RadiusCode", at first I thought of
trying to define another derived quantity call it "EllipseIn" and
calculate the eqn of the ellipsoid (<1 in, >1 out) at another place, but
in the end I thought I might as well just do the calculation on the spot.
Unfortunately, I ran into some trouble with the dimension of the x,y,z.
I am still kind of fuzzy on how _get_cut_mask iterates through the cells
in the grid and flag them as part of the object. It seem
self._cut_mask=cm where cm are just a bunch of True and False won't give
information on which cell is being considered. That's why I was concerned
that maybe this isn't the place sphere check for cells either.
Any expert help on AMR3D is greatly appreciated.
I added what I think is support for Pylab to the current tip of the yt repo.
What it does is create (dynamically) a new backend that overloads the
interactivity commands in pylab to dump out images and display them
inline. I had to hack around a little bit to make sure that it worked
if you had specified a GUI engine in your matplotlibrc.
All of the work is done in extdirect_repl.py, in the reason_pylab and
Anyway, if some people could test it out, see if it works to do things like:
pylab.plot( ... )
and so on and so forth, that'd be great. I've been using it and it
works for me, and I'm pretty pumped about having general plotting
included in Reason, so I'd like to hear if it works for others.
I've been thinking about the best way to construct minimal image
representations, which feed into the Reason / plotting refactor ideas.
I started sketching out a minimally-reproducible phase plot in
yt/visualization/profile_plotter.py, in the objects
I think that as it stands it encompasses how to save and then recreate
a (simply) visualization, but I was wondering if some other people
could look that over, and help me come up with ideas for what would be
necessary to also make sure it faithfully represents image plots, 1D
line plots, and so on. IT doesn't need to cover all possibilities,
just the basic ones.
Anyway, ideas would be greatly appreciated! Thanks!