aboutsummaryrefslogtreecommitdiff
path: root/Source/Python
diff options
context:
space:
mode:
authorGravatar Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> 2022-01-26 09:19:15 -0800
committerGravatar GitHub <noreply@github.com> 2022-01-26 09:19:15 -0800
commit2476d50439e39843d75720c3f857ad05c4f89e23 (patch)
treeda291de040a39398c48bb3cbea05a5ad91f1cafc /Source/Python
parent139d8d1a815e3632a6bf7c15a17858e85eb20fee (diff)
downloadWarpX-2476d50439e39843d75720c3f857ad05c4f89e23.tar.gz
WarpX-2476d50439e39843d75720c3f857ad05c4f89e23.tar.zst
WarpX-2476d50439e39843d75720c3f857ad05c4f89e23.zip
expose WarpXParticleContainer::sumParticleCharge to Python (#2790)
Diffstat (limited to 'Source/Python')
-rw-r--r--Source/Python/WarpXWrappers.H2
-rw-r--r--Source/Python/WarpXWrappers.cpp8
2 files changed, 10 insertions, 0 deletions
diff --git a/Source/Python/WarpXWrappers.H b/Source/Python/WarpXWrappers.H
index 9c9f63133..817c1de73 100644
--- a/Source/Python/WarpXWrappers.H
+++ b/Source/Python/WarpXWrappers.H
@@ -94,6 +94,8 @@ extern "C" {
void warpx_addRealComp(
const char* char_species_name, const char* char_comp_name, bool comm);
+ amrex::Real warpx_sumParticleCharge(const char* char_species_name, const bool local);
+
int warpx_getParticleBoundaryBufferSize(const char* species_name, int boundary);
int** warpx_getParticleBoundaryBufferScrapedSteps(
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);