[yt-users] cloud in cell mesh construction for particle data

John ZuHone jzuhone at gmail.com
Thu Jun 5 15:36:28 PDT 2014


Hi Brendan,

Which version of yt are you using? 

If you're using 3.0, this is actually fairly easy. If you look in yt.fields.particle_fields.py, around line 85, you can see how this is done for the "particle_density" and "particle_mass" fields. Basically you can call a "deposit" method which takes the particle field quantity you want deposited and deposits it into cells. The underlying calculation is done using Cython, so it's fast. 

If you're using 2.x, then you can do the same thing, but it's not as straightforward. You can see how this works in yt.data_objects.universal_fields.py, around line 986, where the "particle_density" field is defined. Basically, it calls CICDeposit_3, which is in yt.utilities.lib.CICDeposit.pyx. 

Let me know if you need any more clarification. 

Best,

John Z

On Jun 5, 2014, at 6:07 PM, Brendan Griffen <brendan.f.griffen at gmail.com> wrote:

> Hi,
> 
> I was wondering if there were any Cython routines within yt which takes particle data and converts it into a cloud-in-cell based mesh which can be written to a file of my choosing. I heard a while ago there was some such functionality but it could be too far down the yt rabbit hole to be used as a standalone? Is this true? I have my own Python code for doing it but it just isn't fast enough and thought I'd ask the yt community if there were any wrapper tools available to boost the speed.
> 
> Thanks.
> Brendan
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org




More information about the yt-users mailing list