Skip to content

Commit

Permalink
Fix: Resize Component on Add (AMReX-Codes#3861)
Browse files Browse the repository at this point in the history
## Summary

Some object called "dummy mf" needs to be resized to avoid segfaults.

## Additional background

Follow-up to AMReX-Codes#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
  • Loading branch information
ax3l authored Mar 29, 2024
1 parent fe6f3de commit 47347f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Src/Particle/AMReX_ParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 47347f7

Please sign in to comment.