diff options
author | 2023-03-23 10:52:29 -0700 | |
---|---|---|
committer | 2023-03-23 17:52:29 +0000 | |
commit | f7b05278348b006aa8b54d58fb243b5536076918 (patch) | |
tree | e0560a4be1abbe17a8a30ef0b220054bbc2033a0 /Source/Particles/WarpXParticleContainer.cpp | |
parent | fedca01aa44d4a1883f623601d11cf85fb353d2a (diff) | |
download | WarpX-f7b05278348b006aa8b54d58fb243b5536076918.tar.gz WarpX-f7b05278348b006aa8b54d58fb243b5536076918.tar.zst WarpX-f7b05278348b006aa8b54d58fb243b5536076918.zip |
Fix add_particles to account for theta attribute with RZ (#3776)
* Fix add_particles to account for theta attribute with RZ
* Add assertions in the number of attributes specified
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index 8eec0314d..79562e8d3 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -153,6 +153,11 @@ WarpXParticleContainer::AddNParticles (int /*lev*/, { using namespace amrex::literals; + WARPX_ALWAYS_ASSERT_WITH_MESSAGE((PIdx::nattribs + nattr_real - 1) <= NumRealComps(), + "Too many real attributes specified"); + WARPX_ALWAYS_ASSERT_WITH_MESSAGE(nattr_int <= NumIntComps(), + "Too many integer attributes specified"); + int ibegin, iend; if (uniqueparticles) { ibegin = 0; |