From 3dc079e6055ab2abb710833c1dc7b6824a439be6 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 29 Mar 2024 13:15:21 -0700 Subject: [PATCH] Fix: Resize Component on Add Some object called "dummy mf" needs to be resized to avoid segfaults. --- 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) {