-
Notifications
You must be signed in to change notification settings - Fork 172
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
Ensure compilation with double precision particles for DSMC collisions #4938
Ensure compilation with double precision particles for DSMC collisions #4938
Conversation
Is there some way we can scale the cross sections to make them work numerically with single-precision particles? |
@archermarx we should be able to make single precision work for the collisions. I expect the problem is more likely in the calculation of the collision energy than the cross-sections themselves since I'm fairly certain the MCC routine works for single precision (which uses similar cross-sections). We can open an issue to remind us to sort out this issue in the future since I won't have time this week to look into this deeper. |
LGTM - note: if you do need SP runs of WarpX where DSMC is just a small part, you could promote the DSMC logic to be all This would be a bigger change, so erroring out at runtime is fine for me. Please double check the constructor where this is placed does not throw when DSMC is not used. |
Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Just double checked, it's working as intended. |
ECP-WarpX#4938) * ensure double precision particle with DSMC collisions * Check ParticleReal precision is double Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> --------- Co-authored-by: Avigdor Veksler <aveksler@TAE7750-MLAP.local> Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
DSMC collisions are not properly captured with single precision for typical plasma collision cross sections. This adds an assert to ensure compilation with double precision.
I could imagine a scenario where a user might still want to use single precision for some cross sections that would be captured, so this could we a warning too rather than an assert.