Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add call to HandleParticlesAtBoundaries in WarpXEvolve.cpp to prevent oob segfaults #5136

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Source/Evolve/WarpXEvolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ WarpX::Evolve (int numsteps)
if (evolve_scheme == EvolveScheme::Explicit) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a more correct way of fixing this is to move this whole block of code to the end of the time step after the electrostatic field calculation (and before the diagnostics). This is suggested in the ancient PR #1751. This fixes two things. At that point the particle boundary conditions would have been handled anyway, and also the fields updated to the correct time level for the velocity push.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that seems reasonable.

Copy link
Member

@dpgrote dpgrote Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this causes many CI tests to fail. I can work through the tests and update the benchmarks, making sure that nothing is actually broken. This will take some time.

if (cur_time + dt[0] >= stop_time - 1.e-3*dt[0] || step == numsteps_max-1) {
// At the end of last step, push p by 0.5*dt to synchronize
const int num_moved = MoveWindow(step+1, is_synchronized);
HandleParticlesAtBoundaries(step, cur_time, num_moved);
FillBoundaryE(guard_cells.ng_FieldGather);
FillBoundaryB(guard_cells.ng_FieldGather);
if (fft_do_time_averaging)
Expand Down
Loading