[yt-users] TotalQuantity vs. summing manually

John ZuHone jzuhone at gmail.com
Fri Dec 20 18:20:32 PST 2013


Geoffrey,

It seems that what is going on here is that whereas the particles in the container are simply the ones contained within the container's cells, the dark matter density is smeared onto the grid using the cloud-in-cell algorithm, meaning that for particles on the edge of their container some of their mass has been smeared onto cells just on the outside, which is a thing that Enzo does.

So it's not really an apples-to-apples comparison.

John ZuHone
Laboratory for High-Energy Astrophysics
NASA/Goddard Space Flight Center
8800 Greenbelt Rd., Mail Code 662
Greenbelt, MD 20771
(w) 301-286-2531
(m) 781-708-5004
john.zuhone at nasa.gov
jzuhone at gmail.com

> On Dec 20, 2013, at 9:02 PM, Geoffrey So <gsiisg at gmail.com> wrote:
> 
> Hi all,
> 
> I found that using a Enzo dataset I was getting slightly different numbers when 
> 1) using the list of dark matter particles selected by creation_time < 0.0
> 
> In [97]: sph_dm = sph['creation_time'] < 0.0
> In [98]: print "%12.12e" % (sph['ParticleMassMsun'][sph_dm]).sum()
> 1.211311468567e+11
> 
> 2) compared to summing the dark matter particles inside a 3D container with TotalQuantity 
> 
> In [101]: print "%12.12e" % (sph.quantities['TotalQuantity']('Dark_Matter_Density')[0]*vol/Msun)
> 1.188937185993e+11
> 
> I'm wondering if the field and particles are handled differently when being counted as inside or outside the 3D container?
> 
> From
> G.S.
> _______________________________________________
> 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