Skip to content

Commit ecaa46d

Browse files
authored
Fix SuperParticle push_back (#3661)
## Summary From #3585 commit: fixes a segfault for the legacy particle layout: ``` Thread 1 "python3" received signal SIGSEGV, Segmentation fault. 0x00007ffff5951e5c in amrex::ParticleTile<amrex::Particle<1, 1>, 2, 1, std::allocator>::push_back<2, 1, 0> (this=0x555555f206e0, sp=...) at /home/axel/src/pyamrex/build/_deps/fetchedamrex-src/Src/Particle/AMReX_ParticleTile.H:916 916 m_soa_tile.GetIdCPUData()[np] = sp.m_idcpu; ``` ## Additional background X-ref: AMReX-Codes/pyamrex#232 ## 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
1 parent d884f44 commit ecaa46d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Src/Particle/AMReX_ParticleTile.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ struct ParticleTile
912912
}
913913

914914
m_soa_tile.resize(np+1);
915-
if constexpr (!ParticleType::is_soa_particle) {
915+
if constexpr (ParticleType::is_soa_particle) {
916916
m_soa_tile.GetIdCPUData()[np] = sp.m_idcpu;
917917
}
918918
auto& arr_rdata = m_soa_tile.GetRealData();

0 commit comments

Comments
 (0)