aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/ParticleBoundaryBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Source/Particles/ParticleBoundaryBuffer.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/Particles/ParticleBoundaryBuffer.cpp b/Source/Particles/ParticleBoundaryBuffer.cpp
index f831b31be..86475aa05 100644
--- a/Source/Particles/ParticleBoundaryBuffer.cpp
+++ b/Source/Particles/ParticleBoundaryBuffer.cpp
@@ -172,7 +172,7 @@ void ParticleBoundaryBuffer::gatherParticles (MultiParticleContainer& mypc,
for (int i = 0; i < numSpecies(); ++i)
{
if (!m_do_boundary_buffer[2*idim+iside][i]) continue;
- const auto& pc = mypc.GetParticleContainer(i);
+ const WarpXParticleContainer& pc = mypc.GetParticleContainer(i);
if (!buffer[i].isDefined())
{
buffer[i] = pc.make_alike<amrex::PinnedArenaAllocator>();
@@ -325,3 +325,15 @@ ParticleBoundaryBuffer::getParticleBuffer(const std::string species_name, int bo
return buffer[index];
}
+
+PinnedMemoryParticleContainer *
+ParticleBoundaryBuffer::getParticleBufferPointer(const std::string species_name, int boundary) {
+
+ auto& buffer = m_particle_containers[boundary];
+ auto index = WarpX::GetInstance().GetPartContainer().getSpeciesID(species_name);
+
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(m_do_boundary_buffer[boundary][index],
+ "Attempted to get particle buffer for boundary "
+ + std::to_string(boundary) + ", which is not used!");
+ return &buffer[index];
+}