Skip to content

Commit 5e95674

Browse files
authored
Particle Container: Support Pure SoA (#124)
Transition particle containers, iterators, etc. to support also the new pure SoA layout.
1 parent 4610d69 commit 5e95674

File tree

7 files changed

+127
-74
lines changed

7 files changed

+127
-74
lines changed

cmake/dependencies/AMReX.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ option(pyAMReX_amrex_internal "Download & build AMReX" ON)
8282
set(pyAMReX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
8383
CACHE STRING
8484
"Repository URI to pull and build AMReX from if(pyAMReX_amrex_internal)")
85-
set(pyAMReX_amrex_branch "6b294a5cd3e5c55b36c7d0afe2993501775eb42f"
85+
set(pyAMReX_amrex_branch "ee492f47704ae8b094ad9bb4b6f758d82606a61e"
8686
CACHE STRING
8787
"Repository branch for pyAMReX_amrex_repo if(pyAMReX_amrex_internal)")
8888

src/Particle/ParticleContainer.H

Lines changed: 99 additions & 66 deletions
Large diffs are not rendered by default.

src/Particle/ParticleContainer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@
55
*/
66
#include "ParticleContainer.H"
77

8+
#include <AMReX_Particle.H>
9+
10+
811
void init_ParticleContainer_HiPACE(py::module& m);
912
void init_ParticleContainer_ImpactX(py::module& m);
1013
void init_ParticleContainer_WarpX(py::module& m);
1114

1215
void init_ParticleContainer(py::module& m) {
16+
using namespace amrex;
17+
1318
// TODO: we might need to move all or most of the defines in here into a
1419
// test/example submodule, so they do not collide with downstream projects
15-
make_ParticleContainer_and_Iterators< 1, 1, 2, 1> (m); // tests
20+
make_ParticleContainer_and_Iterators<Particle<1, 1>, 2, 1>(m); // tests
1621

1722
init_ParticleContainer_HiPACE(m);
1823
init_ParticleContainer_ImpactX(m);

src/Particle/ParticleContainer_HiPACE.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
*/
66
#include "ParticleContainer.H"
77

8+
#include <AMReX_Particle.H>
9+
810

911
void init_ParticleContainer_HiPACE(py::module& /* m */) {
12+
using namespace amrex;
13+
1014
// TODO: we might need to move all or most of the defines in here into a
1115
// test/example submodule, so they do not collide with downstream projects
12-
//make_ParticleContainer_and_Iterators< 0, 0, 4, 0> (m); // HiPACE++ 22.07
13-
//make_ParticleContainer_and_Iterators< 0, 0, 37, 1> (m); // HiPACE++ 22.07
16+
//make_ParticleContainer_and_Iterators<Particle<0, 0>, 4, 0> (m); // HiPACE++ 22.07
17+
//make_ParticleContainer_and_Iterators<Particle<0, 0>, 37, 1> (m); // HiPACE++ 22.07
1418
}

src/Particle/ParticleContainer_ImpactX.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
*/
66
#include "ParticleContainer.H"
77

8+
#include <AMReX_Particle.H>
9+
#include <AMReX_ParticleTile.H>
10+
811

912
void init_ParticleContainer_ImpactX(py::module& m) {
13+
using namespace amrex;
14+
1015
// TODO: we might need to move all or most of the defines in here into a
1116
// test/example submodule, so they do not collide with downstream projects
12-
make_ParticleContainer_and_Iterators< 0, 0, 5, 0> (m); // ImpactX 22.07
17+
make_ParticleContainer_and_Iterators<Particle<0, 0>, 5, 0>(m); // ImpactX 22.07 - 23.04
18+
make_ParticleContainer_and_Iterators<SoAParticle<8, 2>, 8, 2>(m); // ImpactX 23.05+
1319
}

src/Particle/ParticleContainer_WarpX.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
*/
66
#include "ParticleContainer.H"
77

8+
#include <AMReX_Particle.H>
9+
810

911
void init_ParticleContainer_WarpX(py::module& m) {
12+
using namespace amrex;
13+
1014
// TODO: we might need to move all or most of the defines in here into a
1115
// test/example submodule, so they do not collide with downstream projects
12-
make_ParticleContainer_and_Iterators< 0, 0, 4, 0> (m); // WarpX 22.07 1D-3D
13-
//make_ParticleContainer_and_Iterators< 0, 0, 5, 0> (m); // WarpX 22.07 RZ
16+
make_ParticleContainer_and_Iterators<Particle<0, 0>, 4, 0>(m); // WarpX 22.07 - 23.04 1D-3D
17+
//make_ParticleContainer_and_Iterators<Particle<0, 0>, 5, 0> (m); // WarpX 22.07 - 23.04 RZ
1418
}

src/Particle/StructOfArrays.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void make_StructOfArrays(py::module &m)
7272
void init_StructOfArrays(py::module& m) {
7373
make_StructOfArrays< 2, 1>(m);
7474
make_StructOfArrays< 4, 0>(m); // HiPACE++ 22.07
75-
make_StructOfArrays< 5, 0>(m); // ImpactX 22.07
75+
make_StructOfArrays< 5, 0>(m); // ImpactX 22.07 - 23.04
76+
make_StructOfArrays< 8, 2>(m); // ImpactX 23.04+
7677
make_StructOfArrays<37, 1>(m); // HiPACE++ 22.07
7778
}

0 commit comments

Comments
 (0)