diff options
author | 2023-01-06 12:30:07 -0800 | |
---|---|---|
committer | 2023-01-06 12:30:07 -0800 | |
commit | 210ef04152c6d33a64bd052918c9b501bf88cd8c (patch) | |
tree | bc6e3c33b0871b0a55b5f8d8f990d9b882ba8b3b /Source | |
parent | 8fb44c9eb40daada432e77963f71b3c99bcdcd3e (diff) | |
download | WarpX-210ef04152c6d33a64bd052918c9b501bf88cd8c.tar.gz WarpX-210ef04152c6d33a64bd052918c9b501bf88cd8c.tar.zst WarpX-210ef04152c6d33a64bd052918c9b501bf88cd8c.zip |
add local flag to ParticleBoundaryBuffer::getNumParticlesInContainer (#3586)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Diagnostics/BoundaryScrapingDiagnostics.cpp | 2 | ||||
-rw-r--r-- | Source/Particles/ParticleBoundaryBuffer.H | 2 | ||||
-rw-r--r-- | Source/Particles/ParticleBoundaryBuffer.cpp | 4 | ||||
-rw-r--r-- | Source/Python/WarpXWrappers.H | 2 | ||||
-rw-r--r-- | Source/Python/WarpXWrappers.cpp | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp b/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp index dff036343..5b5bf4761 100644 --- a/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp +++ b/Source/Diagnostics/BoundaryScrapingDiagnostics.cpp @@ -136,7 +136,7 @@ BoundaryScrapingDiagnostics::Flush (int i_buffer) int n_particles = 0; for (auto const& species_name : m_output_species_names) { - n_particles += particle_buffer.getNumParticlesInContainer(species_name, i_buffer); + n_particles += particle_buffer.getNumParticlesInContainer(species_name, i_buffer, false); } // If the saving of the particles was not set up for any of the species for this boundary diff --git a/Source/Particles/ParticleBoundaryBuffer.H b/Source/Particles/ParticleBoundaryBuffer.H index 9f6ad9066..6026c1610 100644 --- a/Source/Particles/ParticleBoundaryBuffer.H +++ b/Source/Particles/ParticleBoundaryBuffer.H @@ -43,7 +43,7 @@ public: void printNumParticles () const; - int getNumParticlesInContainer(const std::string species_name, int boundary); + int getNumParticlesInContainer(const std::string species_name, int boundary, bool local); PinnedMemoryParticleContainer& getParticleBuffer(const std::string species_name, int boundary); diff --git a/Source/Particles/ParticleBoundaryBuffer.cpp b/Source/Particles/ParticleBoundaryBuffer.cpp index f1ee10593..a5c3bcd90 100644 --- a/Source/Particles/ParticleBoundaryBuffer.cpp +++ b/Source/Particles/ParticleBoundaryBuffer.cpp @@ -352,12 +352,12 @@ void ParticleBoundaryBuffer::gatherParticles (MultiParticleContainer& mypc, } int ParticleBoundaryBuffer::getNumParticlesInContainer( - const std::string species_name, int boundary) { + const std::string species_name, int boundary, bool local) { auto& buffer = m_particle_containers[boundary]; auto index = WarpX::GetInstance().GetPartContainer().getSpeciesID(species_name); - if (buffer[index].isDefined()) return buffer[index].TotalNumberOfParticles(false); + if (buffer[index].isDefined()) return buffer[index].TotalNumberOfParticles(false, local); else return 0; } diff --git a/Source/Python/WarpXWrappers.H b/Source/Python/WarpXWrappers.H index 708a97cc3..0c2002d65 100644 --- a/Source/Python/WarpXWrappers.H +++ b/Source/Python/WarpXWrappers.H @@ -102,7 +102,7 @@ extern "C" { amrex::Real warpx_sumParticleCharge(const char* char_species_name, const bool local); - int warpx_getParticleBoundaryBufferSize(const char* species_name, int boundary); + int warpx_getParticleBoundaryBufferSize(const char* species_name, int boundary, bool local); int** warpx_getParticleBoundaryBufferScrapedSteps( const char* species_name, int boundary, int lev, diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp index 05a2a1061..f2c022365 100644 --- a/Source/Python/WarpXWrappers.cpp +++ b/Source/Python/WarpXWrappers.cpp @@ -565,11 +565,11 @@ namespace return myspc.sumParticleCharge(local); } - int warpx_getParticleBoundaryBufferSize(const char* species_name, int boundary) + int warpx_getParticleBoundaryBufferSize(const char* species_name, int boundary, bool local) { const std::string name(species_name); auto& particle_buffers = WarpX::GetInstance().GetParticleBoundaryBuffer(); - return particle_buffers.getNumParticlesInContainer(species_name, boundary); + return particle_buffers.getNumParticlesInContainer(species_name, boundary, local); } int** warpx_getParticleBoundaryBufferScrapedSteps(const char* species_name, int boundary, int lev, |