From 9263e6a9832f7ec69a8cc54fda3f6f1de51caaf1 Mon Sep 17 00:00:00 2001 From: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> Date: Fri, 4 Feb 2022 15:05:45 -0800 Subject: added `local` flag to `warpx_getNumParticles` (#2828) --- Python/pywarpx/_libwarpx.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Python/pywarpx/_libwarpx.py') diff --git a/Python/pywarpx/_libwarpx.py b/Python/pywarpx/_libwarpx.py index e6e0d0282..629cecd2a 100755 --- a/Python/pywarpx/_libwarpx.py +++ b/Python/pywarpx/_libwarpx.py @@ -625,7 +625,7 @@ class LibWarpX(): x, y, z, ux, uy, uz, nattr, attr, unique_particles ) - def get_particle_count(self, species_name): + def get_particle_count(self, species_name, local=False): ''' This returns the number of particles of the specified species in the @@ -635,6 +635,8 @@ class LibWarpX(): ---------- species_name : the species name that the number will be returned for + local : If True the particle count on this processor will + be returned. Returns ------- @@ -643,7 +645,7 @@ class LibWarpX(): ''' return self.libwarpx_so.warpx_getNumParticles( - ctypes.c_char_p(species_name.encode('utf-8')) + ctypes.c_char_p(species_name.encode('utf-8')), local ) def get_particle_structs(self, species_name, level): -- cgit v1.2.3