diff options
author | 2020-04-10 09:10:52 -0700 | |
---|---|---|
committer | 2020-04-10 09:10:52 -0700 | |
commit | f1da608562d32af7345809499f30b05341132afc (patch) | |
tree | 7610c0521aa36a59a40117d9e7304abb6432587a /Source/Utils/Average.cpp | |
parent | 4660df45d956520d34be190e8ee64f0add0e2460 (diff) | |
download | WarpX-f1da608562d32af7345809499f30b05341132afc.tar.gz WarpX-f1da608562d32af7345809499f30b05341132afc.tar.zst WarpX-f1da608562d32af7345809499f30b05341132afc.zip |
Refactor AMReX IDs to Global ID (#906)
This PR exposes the AMReX AoS `.id` and `.cpu` to global
particle ID conversion for general usage in WarpX. The
generated particle ID is unique per particle in the sim.
Also replaces the old implementation with a well-documented
bitshift. The old implementation used C-style union type
punning, via access of the inactive union member, which is
technically undefined behavior (UB) in C++ (and is known to crash
on some platforms, e.g. MSVC). Although some popular compilers
implemented this C feature as an extension, it is never good
to rely on a specific interpretation of UB on a certain platform.
Diffstat (limited to 'Source/Utils/Average.cpp')
0 files changed, 0 insertions, 0 deletions