Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert IntVect to IntVectND (AMReX-Codes#3969)
## Summary As described in AMReX-Codes#3955, this PR converts IntVect to the n dimensional IntVectND and adds `using IntVect = IntVectND<AMREX_SPACEDIM>;`. Additionally, deduction guides, support for structured bindings and the helper functions `IntVectCat`, `IntVectSplit` and `IntVectResize` were added to IntVectND. ## Additional background Using structured binding support of `amrex::GpuTuple`, the following code should work (on GPU): ```C++ int i, j, k, n; ... // amrex::IntVectND<4> amrex::IntVectND iv1 (i, j, k, n); // amrex::IntVectND<8> amrex::IntVectND iv2 = amrex::IntVectCat(iv1, iv1); // ... = amrex::GpuTuple<amrex::IntVectND<3>,amrex::IntVectND<2>,amrex::IntVectND<2>,amrex::IntVectND<1>> auto [iv3, iv4, iv5, iv6] = amrex::IntVectSplit<3,2,2,1>(iv2); // int, int, int = amrex::IntVectND<3> auto [i2, j2, k2] = iv3; // int = amrex::IntVectND<1> auto [n2] = iv6; assert(i==i2 && j==j2 && k==k2 && n==n2); ```
- Loading branch information