From 47347f785f5c26f1f9e65bef8e10f2d383406ef7 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 29 Mar 2024 15:39:09 -0700 Subject: [PATCH] Fix: Resize Component on Add (#3861) ## Summary Some object called "dummy mf" needs to be resized to avoid segfaults. ## Additional background Follow-up to #3615 ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate --- Src/Particle/AMReX_ParticleContainer.H | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Src/Particle/AMReX_ParticleContainer.H b/Src/Particle/AMReX_ParticleContainer.H index e0b610a46af..b258c584f3d 100644 --- a/Src/Particle/AMReX_ParticleContainer.H +++ b/Src/Particle/AMReX_ParticleContainer.H @@ -1244,6 +1244,7 @@ public: m_num_runtime_real++; h_redistribute_real_comp.push_back(communicate); SetParticleSize(); + this->resizeData(); // resize runtime SoA for (int lev = 0; lev < numLevels(); ++lev) { @@ -1266,6 +1267,7 @@ public: m_num_runtime_int++; h_redistribute_int_comp.push_back(communicate); SetParticleSize(); + this->resizeData(); // resize runtime SoA for (int lev = 0; lev < numLevels(); ++lev) {