Skip to content

Commit

Permalink
Update AMReX
Browse files Browse the repository at this point in the history
Update AMReX to latest `development`.
Pulls in AMReX-Codes/amrex#3296
  • Loading branch information
ax3l committed May 4, 2023
1 parent cd4aa36 commit 6d29586
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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 "23.05"
set(pyAMReX_amrex_branch "a393d7ff7e320cefeeb55e31f1b0e0b5ac2d90ca"
CACHE STRING
"Repository branch for pyAMReX_amrex_repo if(pyAMReX_amrex_internal)")

Expand Down
15 changes: 10 additions & 5 deletions src/Particle/ParticleTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,14 @@ void make_ParticleTile(py::module &m, std::string allocstr)
auto const particle_tile_type = std::string("ParticleTile_") + std::to_string(NStructReal) + "_" +
std::to_string(NStructInt) + "_" + std::to_string(NArrayReal) + "_" +
std::to_string(NArrayInt) + "_" + allocstr;
py::class_<ParticleTileType>(m, particle_tile_type.c_str())
auto py_particle_tile = py::class_<ParticleTileType>(m, particle_tile_type.c_str())
.def(py::init())
.def_readonly_static("NAR", &ParticleTileType::NAR)
.def_readonly_static("NAI", &ParticleTileType::NAI)
.def("define", &ParticleTileType::define)
.def("GetArrayOfStructs",
py::overload_cast<>(&ParticleTileType::GetArrayOfStructs),
py::return_value_policy::reference_internal)
.def("GetStructOfArrays", py::overload_cast<>(&ParticleTileType::GetStructOfArrays),
py::return_value_policy::reference_internal)
.def("empty", &ParticleTileType::empty)
.def("empty", &ParticleTileType::template empty<ParticleType>)
.def("size", &ParticleTileType::template size<ParticleType>)
.def("numParticles", &ParticleTileType::template numParticles<ParticleType>)
.def("numRealParticles", &ParticleTileType::template numRealParticles<ParticleType>)
Expand Down Expand Up @@ -117,6 +114,14 @@ void make_ParticleTile(py::module &m, std::string allocstr)
.def("__setitem__", [](ParticleTileType & pt, int const v, SuperParticleType const value){ pt.getParticleTileData().setSuperParticle( value, v); })
.def("__getitem__", [](ParticleTileType & pt, int const v){ return pt.getParticleTileData().getSuperParticle(v); })
;

if constexpr (!T_ParticleType::is_soa_particle) {
py_particle_tile
.def("GetArrayOfStructs",
py::overload_cast<>(&ParticleTileType::GetArrayOfStructs),
py::return_value_policy::reference_internal)
;
}
}

template <typename T_ParticleType, int NArrayReal, int NArrayInt>
Expand Down

0 comments on commit 6d29586

Please sign in to comment.