diff options
author | 2022-06-01 14:02:34 -0700 | |
---|---|---|
committer | 2022-06-01 14:02:34 -0700 | |
commit | aaedf159f69f6803a00957a5a0ebe728d248c52b (patch) | |
tree | 6ff62a4c28a7980c055738200f5bc7d21c3244a1 /Source/Particles/ParticleBoundaryBuffer.cpp | |
parent | d6eeed0790bcfe02b6b1182c39be02b6943a6ebc (diff) | |
download | WarpX-aaedf159f69f6803a00957a5a0ebe728d248c52b.tar.gz WarpX-aaedf159f69f6803a00957a5a0ebe728d248c52b.tar.zst WarpX-aaedf159f69f6803a00957a5a0ebe728d248c52b.zip |
Boundary scraping diagnostic (#3064)
* Initialize boundary scraping diagnostic
* Add new file
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Start fixing diagnostics
* Define ReadParameters function
* Define stubs for all required functions
* Enable new diagnostics in one of the tests
* Dump all particles at the end of the run
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Use the same types for different pinned-memory particles
* Use the same types for different pinned-memory particles
* Fix compilation error
* Finalize dumping buffer
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Clean up file
* Activate recording of particles at the boundary
* New function getParticleBufferPointer
* Pass a WarpXParticleContainer to the ParticleDiag
* Handle timestamp
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert to multi-level simulation
* Add documentation and a few checks
* Fix error with MPI
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update varnames for RZ openPMD
* Add automated test
* Add automatic check
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Create new named component particle container
* Fix compilation
* Make WarpXParticleContainer derive from NamedParticleContainer
* Transfer functions that are specific to the particle component maps
* Move PIdx
* Make PinnedMemoryParticleContainer derive from NamedComponentParticleContainer
* Fix compilation
* Avoid unnecessary MPI communications
* Fix brittle code
* Define function `make_alike`
* Fix compilation
* Add back const anotations
* Fix typo
* Update code
* Fix compilation error
* Fix indentation
* Fix indentation
* Apply suggestions from code review
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
* Fix namespace
* Improve Error Messages Further
* Doxygen: Parameters of the Diag Constructor
* Update `WarpX-tests.ini`
... so we can filter the test out if we build w/o openPMD.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to '')
-rw-r--r-- | Source/Particles/ParticleBoundaryBuffer.cpp | 14 |
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]; +} |