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

PC Names: Same Type, Multiple Vars/Instances #4302

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jan 18, 2025

Summary

If the same particle container type is used to create multiple particle species, then the compile-time defined names were only added for the first particle species (instance) of the type and then skipped for any later species (another instance of the same type).

This is due to the global variable (so many globals...) used in the type init. This fixes the problem by moving the instance related name logic out of the once-per-type logic if branch.

Additional background

First seen with ImpactX for its "lost" particle species (2nd instance of the same PC type in the code).
Needed for ECP-WarpX/impactx#805

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

If the same particle container type is used to create
multiple particle species, then the compile-time defined
names were only added for the first particle species (instance)
of the type and then skipped for any later species (another
instance of the same type).

This is due to the global variable (so many globals...) used in
the type init. This fixes the problem by moving the instance
related name logic out of the once-per-type logic `if` branch.
@ax3l ax3l force-pushed the fix-soa-name-multiple-vars branch from 62c6746 to 50e5b42 Compare January 18, 2025 06:19
@ax3l ax3l requested a review from WeiqunZhang January 18, 2025 18:32
@atmyers atmyers merged commit 20eb1ab into AMReX-Codes:development Jan 21, 2025
74 checks passed
@ax3l ax3l deleted the fix-soa-name-multiple-vars branch January 21, 2025 20:06
ax3l added a commit to AMReX-Codes/pyamrex that referenced this pull request Jan 23, 2025
Update to latest commit in `development`.
Pull in fixes
- [x] AMReX-Codes/amrex#4298
- [x] AMReX-Codes/amrex#4299
- [x] AMReX-Codes/amrex#4302
- [x] AMReX-Codes/amrex#4300

for #382.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants