Skip to content

Commit

Permalink
Convert Box to BoxND (#4016)
Browse files Browse the repository at this point in the history
## Summary

Similar to #3969 and #3988 but for Box.

## Additional background

It should be checked that the changes to BoxIndexer do not affect the
compiled GPU code.
In my testing, it gives the same performance as development. 

Example usage:
```C++
amrex::BoxND b1{amrex::IntVectND{1,2,3}, amrex::IntVectND{4,5,6}, amrex::IntVectND{1,0,1}};
// ((1,2,3) (4,5,6) (1,0,1))
auto b2 = amrex::BoxCat(b1, b1, b1);
// ((1,2,3,1,2,3,1,2,3) (4,5,6,4,5,6,4,5,6) (1,0,1,1,0,1,1,0,1))
auto [b3, b4, b5, b6, b7] = amrex::BoxSplit<1, 4, 2, 1, 1>(b2);
// ((1) (4) (1))((2,3,1,2) (5,6,4,5) (0,1,1,0))((3,1) (6,4) (1,1))((2) (5) (0))((3) (6) (1))
auto b8 = amrex::BoxResize<2>(b4);
// ((2,3) (5,6) (0,1))
auto b9 = amrex::BoxResize<5>(b8);
// ((2,3,0,0,0) (5,6,0,0,0) (0,1,0,0,0))
```
  • Loading branch information
AlexanderSinn committed Aug 2, 2024
1 parent 4434048 commit c09da99
Show file tree
Hide file tree
Showing 7 changed files with 879 additions and 679 deletions.
4 changes: 3 additions & 1 deletion Src/Base/AMReX_BaseFwd.H
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class BoxList;
class DistributionMapping;
class Geometry;

class Box;
template<int dim>
class BoxND;
using Box = BoxND<AMREX_SPACEDIM>;
template<int dim>
class IntVectND;
using IntVect = IntVectND<AMREX_SPACEDIM>;
Expand Down
Loading

0 comments on commit c09da99

Please sign in to comment.