[yt-dev] RFC: (yt-3.0) Accessing fluids and particles

Christopher Moody cemoody at ucsc.edu
Mon Feb 27 11:59:57 PST 2012


Hi everyone,
I'm not sure I have a strong opinion one way or the other, except to say
that .fluid bothers me in the event of multiple fluid fields. We may have
native fluid fields and 'interpolated' fluid fields based on SPH particles.
We might even have particle types with different force resolutions (dark
matter may be coarser than star or gas particles, for example), and
therefore may want different smoothing kernels, and different fluids for
each kernel. I'd like break away from the idea of one canonical 'fluid'
quantity...

If we did choose a dd.fluid approach, couldn't we just alias calls like
dd["Density"] to go dd.fluid, and deprecate it over time?

chris

On Mon, Feb 27, 2012 at 11:20 AM, Matthew Turk <matthewturk at gmail.com>wrote:

> Hi all,
>
> During the geometry handling hangout today (which I think was quite
> successful!) the question came up of how to handle accessing particles
> and fluids came up.
>
> The suggestion has been put forth to change all access of field values
> into .fluid/.field and .particles, with the optional type specifier as
> the first attribute.  This would look like:
>
> dd = pf.h.all_data()
> dd.fluid["Dust"]["Density"]
>
> or
>
> dd = pf.h.all_data()
> dd.particles["dark_matter"]["velocity-x"]
>
> I have an opinion on what we should do, but I'd like to hear from
> others before continuing down this path.  Here are the options:
>
> 1) Keep everything as is for now, requiring users to manually
> selection things like particle type and fluid type (in case of
> multiple fluids) and just say who cares if people have multiple
> particle types.
> 2) Move to requiring dict-of-dicts for particles only, and allow
> fluids to exist as is.  i.e.,
>
> dd["Density"]
> dd.particles["dark_matter"]["velocity-x"]
>
> 3) Move to requiring both .fluids and .particles, and make both
> dict-of-dicts.
>
> dd.fluid[:]["Density"] # for all densities summed
> dd.particles[:]["velocity-x"]
>
> 4) Leave things mostly as is, but use tuple-access for types.  This would
> mean:
>
> dd["Density"] # gives the total density
> dd["dust","Density"] # only dust density
> dd["particle-velocity-x"]
> dd["PopII", "particle-velocity-x"]
>
> 5) Use the object for fluids with optional type specifier, and
> dict-of-dicts for particles:
>
> dd["Density"]
> dd["dust","Density"]
> dd.particles["dark_matter"]["velocity-x"]
> --
>
> Votes?
>
> To be honest, thinking about this worries me a bit.  I'm inclined not
> to break old code unless absolutely necessary.  But, I would like to
> support two-fluids in a more reasonable way, and I also want to
> support multiple particle types (a more common use case, I think) more
> elegantly.  As a rule, even though this is coming down the road a bit,
> I'd like to try to keep in mind that big changes are frustrating for
> people, so for each change that is made a good reason for making it
> should be present.  In this case, I initially wanted to make it much
> easier to select individual particle types, but then the discussion
> grew from there.  We need to consider both aesthetic and technical
> challenges.
>
> I'd like to hear any suggestions or feedback on these items, or
> alternate suggestions.
>
> Thanks,
>
> Matt
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20120227/65519682/attachment.html>


More information about the yt-dev mailing list