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) --- Source/Python/WarpXWrappers.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/Python/WarpXWrappers.cpp') diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp index d91cd9a88..accecd615 100644 --- a/Source/Python/WarpXWrappers.cpp +++ b/Source/Python/WarpXWrappers.cpp @@ -240,11 +240,12 @@ namespace return dx[dir]; } - long warpx_getNumParticles(const char* char_species_name) { + long warpx_getNumParticles(const char* char_species_name, const bool local) { const auto & mypc = WarpX::GetInstance().GetPartContainer(); const std::string species_name(char_species_name); auto & myspc = mypc.GetParticleContainerFromName(species_name); - return myspc.TotalNumberOfParticles(); + // the first argument below is to only count valid particles + return myspc.TotalNumberOfParticles(true, local); } #define WARPX_GET_FIELD(FIELD, GETTER) \ -- cgit v1.2.3