-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable binning for ParticleTileData (#3307)
## Summary To use binning with ParticleTileData, replace ``` using PlasmaBins = amrex::DenseBins<PlasmaParticleContainer::ParticleType>; ``` with ``` using PlasmaBins = amrex::DenseBins<PlasmaParticleContainer::ParticleTileType::ParticleTileDataType>; ``` and ``` bins.build(pti.numParticles(), pti.GetArrayOfStructs().begin(), … ``` with ``` bins.build(pti.numParticles(), pti.GetParticleTile().getParticleTileData(), … ``` Using ParticleTileData is necessary for PureSoA. ## Additional background The previous call_f ``` template <typename F, typename T, typename I> AMREX_GPU_HOST_DEVICE auto call_f(F const& f, T* pstruct_ptr, I& index) noexcept -> decltype(f(pstruct_ptr,index)) { return f(pstruct_ptr[index],index); } ``` had an issue where `pstruct_ptr` and `pstruct_ptr[index]` was mixed up. I fixed this here which may cause some backwards compatibility issues. Otherwise binning should work as before when using a `pstruct_ptr`. ## Checklist The proposed changes: - [ ] fix a bug or incorrect behavior in AMReX - [x] 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 --------- Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
- Loading branch information
1 parent
d448c17
commit 81e1ac3
Showing
7 changed files
with
139 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.