Skip to content

Commit

Permalink
Fix: Names in PC::make_alike
Browse files Browse the repository at this point in the history
The ParticleContainer's `make_alike` function forgot the names
of the SoA components.
  • Loading branch information
ax3l committed Feb 4, 2025
1 parent 779df09 commit dc68e02
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Src/Particle/AMReX_ParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -1375,10 +1375,16 @@ public:
ContainerLike<NewAllocator> tmp(m_gdb);

// add runtime real comps to tmp
for (int ic = 0; ic < this->NumRuntimeRealComps(); ++ic) { tmp.AddRealComp(false); }
auto const real_names = this->GetRealSoANames();
for (int ic = 0; ic < this->NumRuntimeRealComps(); ++ic) {
tmp.AddRealComp(real_names.at(ic + NArrayReal), false);
}

// add runtime int comps to tmp
for (int ic = 0; ic < this->NumRuntimeIntComps(); ++ic) { tmp.AddIntComp(false); }
auto const int_names = this->GetIntSoANames();
for (int ic = 0; ic < this->NumRuntimeIntComps(); ++ic) {
tmp.AddIntComp(int_names.at(ic + NArrayInt), false);
}

return tmp;
}
Expand Down

0 comments on commit dc68e02

Please sign in to comment.