aboutsummaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGravatar Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> 2022-02-04 15:05:45 -0800
committerGravatar GitHub <noreply@github.com> 2022-02-04 15:05:45 -0800
commit9263e6a9832f7ec69a8cc54fda3f6f1de51caaf1 (patch)
treecd5ac71f1de829d48e7e709b59d419f4fca20c17 /Python
parentf236cd6d20eb4bbc742b69147af47ff6f70302f7 (diff)
downloadWarpX-9263e6a9832f7ec69a8cc54fda3f6f1de51caaf1.tar.gz
WarpX-9263e6a9832f7ec69a8cc54fda3f6f1de51caaf1.tar.zst
WarpX-9263e6a9832f7ec69a8cc54fda3f6f1de51caaf1.zip
added `local` flag to `warpx_getNumParticles` (#2828)
Diffstat (limited to 'Python')
-rwxr-xr-xPython/pywarpx/_libwarpx.py6
1 files changed, 4 insertions, 2 deletions
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):