Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Particle Container: Support Pure SoA #124

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}