aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2023-03-23 10:52:29 -0700
committerGravatar GitHub <noreply@github.com> 2023-03-23 17:52:29 +0000
commitf7b05278348b006aa8b54d58fb243b5536076918 (patch)
treee0560a4be1abbe17a8a30ef0b220054bbc2033a0 /Source/Particles/WarpXParticleContainer.cpp
parentfedca01aa44d4a1883f623601d11cf85fb353d2a (diff)
downloadWarpX-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.cpp5
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;