total number of cells
Hi All, what's the easiest way to get the number of cells in a simulation? Thanks! _______________________________________________________ sskory@physics.ucsd.edu o__ Stephen Skory http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student ________________________________(_)_\(_)_______________
Hi Stephen, Total number of cells, including duplicated: pf.h.print_stats() which will also output by-level. You can also get this by doing: pf.h.grid_dimensions.prod(axis=1).sum() For non-duplicated, the most straightforward way would be: total = 0 for g in pf.h.grids: total += g.child_mask.sum() g.clear_data() The g.clear_data is necessary to avoid accumulating child masks. If you don't mind accumulating them: total = sum( g.child_mask.sum() for g in pf.h.grids ) -Matt On Sat, Jun 5, 2010 at 11:19 AM, Stephen Skory <stephenskory@yahoo.com> wrote:
Hi All,
what's the easiest way to get the number of cells in a simulation? Thanks! _______________________________________________________ sskory@physics.ucsd.edu o__ Stephen Skory http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student ________________________________(_)_\(_)_______________
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Matthew Turk -
Stephen Skory