Skip to content

Commit

Permalink
Particle Container: Support Pure SoA (#124)
Browse files Browse the repository at this point in the history
Transition particle containers, iterators, etc. to support also the
new pure SoA layout.
  • Loading branch information
ax3l authored Apr 27, 2023
1 parent 4610d69 commit 5e95674
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 74 deletions.
2 changes: 1 addition & 1 deletion cmake/dependencies/AMReX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ option(pyAMReX_amrex_internal "Download & build AMReX" ON)
set(pyAMReX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
CACHE STRING
"Repository URI to pull and build AMReX from if(pyAMReX_amrex_internal)")
set(pyAMReX_amrex_branch "6b294a5cd3e5c55b36c7d0afe2993501775eb42f"
set(pyAMReX_amrex_branch "ee492f47704ae8b094ad9bb4b6f758d82606a61e"
CACHE STRING
"Repository branch for pyAMReX_amrex_repo if(pyAMReX_amrex_internal)")

Expand Down
165 changes: 99 additions & 66 deletions src/Particle/ParticleContainer.H

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/Particle/ParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
*/
#include "ParticleContainer.H"

#include <AMReX_Particle.H>


void init_ParticleContainer_HiPACE(py::module& m);
void init_ParticleContainer_ImpactX(py::module& m);
void init_ParticleContainer_WarpX(py::module& m);

void init_ParticleContainer(py::module& m) {
using namespace amrex;

// TODO: we might need to move all or most of the defines in here into a
// test/example submodule, so they do not collide with downstream projects
make_ParticleContainer_and_Iterators< 1, 1, 2, 1> (m); // tests
make_ParticleContainer_and_Iterators<Particle<1, 1>, 2, 1>(m); // tests

init_ParticleContainer_HiPACE(m);
init_ParticleContainer_ImpactX(m);
Expand Down
8 changes: 6 additions & 2 deletions src/Particle/ParticleContainer_HiPACE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
*/
#include "ParticleContainer.H"

#include <AMReX_Particle.H>


void init_ParticleContainer_HiPACE(py::module& /* m */) {
using namespace amrex;

// TODO: we might need to move all or most of the defines in here into a
// test/example submodule, so they do not collide with downstream projects
//make_ParticleContainer_and_Iterators< 0, 0, 4, 0> (m); // HiPACE++ 22.07
//make_ParticleContainer_and_Iterators< 0, 0, 37, 1> (m); // HiPACE++ 22.07
//make_ParticleContainer_and_Iterators<Particle<0, 0>, 4, 0> (m); // HiPACE++ 22.07
//make_ParticleContainer_and_Iterators<Particle<0, 0>, 37, 1> (m); // HiPACE++ 22.07
}
8 changes: 7 additions & 1 deletion src/Particle/ParticleContainer_ImpactX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
*/
#include "ParticleContainer.H"

#include <AMReX_Particle.H>
#include <AMReX_ParticleTile.H>


void init_ParticleContainer_ImpactX(py::module& m) {
using namespace amrex;

// TODO: we might need to move all or most of the defines in here into a
// test/example submodule, so they do not collide with downstream projects
make_ParticleContainer_and_Iterators< 0, 0, 5, 0> (m); // ImpactX 22.07
make_ParticleContainer_and_Iterators<Particle<0, 0>, 5, 0>(m); // ImpactX 22.07 - 23.04
make_ParticleContainer_and_Iterators<SoAParticle<8, 2>, 8, 2>(m); // ImpactX 23.05+
}
8 changes: 6 additions & 2 deletions src/Particle/ParticleContainer_WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
*/
#include "ParticleContainer.H"

#include <AMReX_Particle.H>


void init_ParticleContainer_WarpX(py::module& m) {
using namespace amrex;

// TODO: we might need to move all or most of the defines in here into a
// test/example submodule, so they do not collide with downstream projects
make_ParticleContainer_and_Iterators< 0, 0, 4, 0> (m); // WarpX 22.07 1D-3D
//make_ParticleContainer_and_Iterators< 0, 0, 5, 0> (m); // WarpX 22.07 RZ
make_ParticleContainer_and_Iterators<Particle<0, 0>, 4, 0>(m); // WarpX 22.07 - 23.04 1D-3D
//make_ParticleContainer_and_Iterators<Particle<0, 0>, 5, 0> (m); // WarpX 22.07 - 23.04 RZ
}
3 changes: 2 additions & 1 deletion src/Particle/StructOfArrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void make_StructOfArrays(py::module &m)
void init_StructOfArrays(py::module& m) {
make_StructOfArrays< 2, 1>(m);
make_StructOfArrays< 4, 0>(m); // HiPACE++ 22.07
make_StructOfArrays< 5, 0>(m); // ImpactX 22.07
make_StructOfArrays< 5, 0>(m); // ImpactX 22.07 - 23.04
make_StructOfArrays< 8, 2>(m); // ImpactX 23.04+
make_StructOfArrays<37, 1>(m); // HiPACE++ 22.07
}

0 comments on commit 5e95674

Please sign in to comment.