aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/Average.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2020-04-10 09:10:52 -0700
committerGravatar GitHub <noreply@github.com> 2020-04-10 09:10:52 -0700
commitf1da608562d32af7345809499f30b05341132afc (patch)
tree7610c0521aa36a59a40117d9e7304abb6432587a /Source/Utils/Average.cpp
parent4660df45d956520d34be190e8ee64f0add0e2460 (diff)
downloadWarpX-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