Skip to content

Commit

Permalink
Fix Restart
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Feb 4, 2025
1 parent 2fe7f5a commit 74414cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/Diagnostics/ParticleIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ MultiParticleContainer::Restart (const std::string& dir)
real_comp_names.push_back(comp_name);
}

int n_rc = 0;
for (auto const& comp : pc->GetRealSoANames()) {
// skip compile-time components
if (n_rc < pc->NArrayReal) { continue; }
n_rc++;

auto search = std::find(real_comp_names.begin(), real_comp_names.end(), comp);
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
search != real_comp_names.end(),
Expand Down Expand Up @@ -185,7 +190,12 @@ MultiParticleContainer::Restart (const std::string& dir)
int_comp_names.push_back(comp_name);
}

int n_ic = 0;
for (auto const& comp : pc->GetIntSoANames()) {
// skip compile-time components
if (n_ic < pc->NArrayInt) { continue; }
n_ic++;

auto search = std::find(int_comp_names.begin(), int_comp_names.end(), comp);
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
search != int_comp_names.end(),
Expand Down

0 comments on commit 74414cd

Please sign in to comment.