From 2476d50439e39843d75720c3f857ad05c4f89e23 Mon Sep 17 00:00:00 2001 From: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> Date: Wed, 26 Jan 2022 09:19:15 -0800 Subject: expose WarpXParticleContainer::sumParticleCharge to Python (#2790) --- Source/Python/WarpXWrappers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Python/WarpXWrappers.cpp') diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp index 6703bb665..63ba4b713 100644 --- a/Source/Python/WarpXWrappers.cpp +++ b/Source/Python/WarpXWrappers.cpp @@ -516,6 +516,14 @@ namespace mypc.defineAllParticleTiles(); } + amrex::Real warpx_sumParticleCharge(const char* char_species_name, const bool local) + { + auto & mypc = WarpX::GetInstance().GetPartContainer(); + const std::string species_name(char_species_name); + auto & myspc = mypc.GetParticleContainerFromName(species_name); + return myspc.sumParticleCharge(local); + } + int warpx_getParticleBoundaryBufferSize(const char* species_name, int boundary) { const std::string name(species_name); -- cgit v1.2.3