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 Python function to extract particles scraped during the last step. #5711

Merged
merged 6 commits into from
Feb 27, 2025

Conversation

RemiLehe
Copy link
Member

@RemiLehe RemiLehe commented Feb 26, 2025

This adds a function that extracts the particles that were scraped at the current timestep.

This is useful in callback functions, where we often want to re-inject particles that hit the boundary, and therefore need to select the ones that were scraped at the current timestep.

This also avoids calling clear_buffer, which potentially interferes with the BoundaryScrapingDiagnostic

@RemiLehe RemiLehe force-pushed the particle_scraped_last_step branch from ed5038e to 136e774 Compare February 26, 2025 20:41
@RemiLehe RemiLehe changed the title [WIP] Add Python function to extract particles scraped during the last step. Add Python function to extract particles scraped during the last step. Feb 26, 2025
@RemiLehe RemiLehe marked this pull request as ready for review February 26, 2025 21:01
@RemiLehe RemiLehe closed this Feb 26, 2025
@RemiLehe RemiLehe reopened this Feb 26, 2025
Copy link
Member

@RevathiJambunathan RevathiJambunathan left a comment

Choose a reason for hiding this comment

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

Thank you @RemiLehe for this PR!!!
I tested it and it works!

Copy link
Member

@dpgrote dpgrote left a comment

Choose a reason for hiding this comment

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

This looks good, thanks!
A minor change would be to have the level default to 0 which is likely the most common case.

@RemiLehe RemiLehe merged commit cfd9d1d into ECP-WarpX:development Feb 27, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants