[Draft] Reduce Particles: Speedup#1104
Draft
ax3l wants to merge 3 commits intoBLAST-ImpactX:developmentfrom
Draft
[Draft] Reduce Particles: Speedup#1104ax3l wants to merge 3 commits intoBLAST-ImpactX:developmentfrom
ax3l wants to merge 3 commits intoBLAST-ImpactX:developmentfrom
Conversation
Introduce methods to control which parameters (moments, min/max, covariances, etc.) to reduce in particle reduced beam characteristics/moments. Speed up usage, to avoid that recording the history of beam moments can dominate simple simulation runs.
5 tasks
5 tasks
WeiqunZhang
pushed a commit
to AMReX-Codes/amrex
that referenced
this pull request
Aug 19, 2025
## Summary
In C++ it is not allowed to make a zero-sized array type like `int[0]`
so a more verbose way using `amrex::TypeArray<int, 0>` needs to be used.
Additionally, `std::declval` is now used instead of `Types{}`.
## Additional background
Zero-variants in BLAST-ImpactX/impactx#1104
## Checklist
The proposed changes:
- [x] 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
Observed: - too explicit - split min/max out separately, seldomly needed - make the other options "stack"
WeiqunZhang
added a commit
to AMReX-Codes/amrex
that referenced
this pull request
Sep 11, 2025
## Summary Sometimes one needs the underlying (u)int value of an `enum class`, e.g., when building bitmasks. This adds a helper function to `AMREX_ENUM`. ## Additional background BLAST-ImpactX/impactx#1104 --------- Co-authored-by: Weiqun Zhang <weiqunzhang@lbl.gov>
ax3l
commented
Sep 11, 2025
|
|
||
| constexpr MomentSelection operator| (MomentSelection lhs, MomentSelection rhs) noexcept | ||
| { | ||
| return static_cast<MomentSelection>(static_cast<std::underlying_type_t<MomentSelection>>(lhs) | static_cast<std::underlying_type_t<MomentSelection>>(rhs)); |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Introduce methods to control which parameters (moments, min/max, covariances, etc.) to reduce in particle reduced beam characteristics/moments. Speed up usage, to avoid that recording the history of beam moments can dominate simple simulation runs.
Fix #1102
To Do