Skip to content

Commit

Permalink
Fix FieldProbe Check: Particle Shape (ECP-WarpX#4983)
Browse files Browse the repository at this point in the history
The constructor of FieldProbe might be called earlier than the
WarpX class parameter init. That could lead to relying on an
uninitialized particle shape static. Use the parser instead, similar
to our general efforts to reduce the static members stored in the
WarpX class.
  • Loading branch information
ax3l authored Jun 11, 2024
1 parent c7b203e commit 2602b54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/Diagnostics/ReducedDiags/FieldProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ FieldProbe::FieldProbe (const std::string& rd_name)
ablastr::warn_manager::WarnPriority::low);
}

WARPX_ALWAYS_ASSERT_WITH_MESSAGE(interp_order <= WarpX::nox ,
// ensure assumption holds: we read the fields in the interpolation kernel as they are,
// without further communication of guard/ghost/halo regions
int particle_shape;
const ParmParse pp_algo("algo");
utils::parser::getWithParser(pp_algo, "particle_shape", particle_shape);
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(interp_order <= particle_shape ,
"Field probe interp_order should be less than or equal to algo.particle_shape");
if (ParallelDescriptor::IOProcessor())
{
Expand Down

0 comments on commit 2602b54

Please sign in to comment.