-
Notifications
You must be signed in to change notification settings - Fork 198
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
Remove Temporary Particle Container tmp_pc
#5056
Labels
cleaning
Clean code, improve readability
Comments
EZoni
changed the title
Code clean-up: remove
Code cleanup: remove Jul 23, 2024
tmp_particle_data
tmp_particle_data
EZoni
changed the title
Code cleanup: remove
Clean code: remove Jul 23, 2024
tmp_particle_data
tmp_particle_data
ax3l
changed the title
Clean code: remove
Remove Temporary Particle Container Jan 10, 2025
tmp_particle_data
tmp_pc
I think this plan looks good. We should merge #5489 beforehand, because we also don't want to read/write the |
Hi @EZoni - here some detailed steps I think will work:
There may some things I'm over looking but I think that's ~90% of the process. |
Understood, thanks for the summary! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
WarpXParticleContainer
class has atmp_particle_data
(tmp_pc
) here: https://github.com/ECP-WarpX/WarpX/blob/development/Source/Particles/WarpXParticleContainer.H#L507, which is used exclusively to save the old positions and momenta used in the boosted-frame diagnostics:https://github.com/ECP-WarpX/WarpX/blob/development/Source/Particles/PhysicalParticleContainer.cpp#L2813
https://github.com/ECP-WarpX/WarpX/blob/development/Source/Particles/PhysicalParticleContainer.cpp#L2813
This is a bit clunky, e.g. as
tmp_particle_data
needs to be resized here:https://github.com/ECP-WarpX/WarpX/blob/development/Source/Particles/WarpXParticleContainer.cpp#L1523
Additionally, the name is not very descriptive, and might confuse new developers (it is not clear that this is related to BTD, unless one really search through the code for the places where
tmp_particle_data
is used.)It might be cleaner to remove
tmp_particle_data
and instead use runtime components, as is done currently for the implicit PIC (which also needs to save the old positions and momenta, albeit at a different point in the PIC loop):https://github.com/ECP-WarpX/WarpX/blob/development/Source/Initialization/WarpXInitData.cpp#L591
https://github.com/ECP-WarpX/WarpX/blob/development/Source/FieldSolver/ImplicitSolvers/WarpXImplicitOps.cpp#L113
https://github.com/ECP-WarpX/WarpX/blob/development/Source/FieldSolver/ImplicitSolvers/WarpXImplicitOps.cpp#L113
We could use similar runtime components for the BTD, but with a different name in order not to conflict with the implicit solver (e.g.
uz_btd_old
instead ofuz_n
). I also seem to remember that we can set a flag on some runtime component to avoid doing MPI exchanges (which would be useful for the runtime components that would replacetmp_particle_data
).The text was updated successfully, but these errors were encountered: