Skip to content

Commit

Permalink
Add AMReX Module as libwarpx_so.amr
Browse files Browse the repository at this point in the history
Attribute to pass through the already loaded AMReX module with the
matching dimensionality to the simulation.
  • Loading branch information
ax3l committed Jul 21, 2023
1 parent cc6cb66 commit 1a30df7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/Python/pyWarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ void init_WarpX(py::module&);
PYBIND11_MODULE(PYWARPX_MODULE_NAME, m) {
// make sure AMReX types are known
#if defined(WARPX_DIM_3D)
py::module::import("amrex.space3d");
auto amr = py::module::import("amrex.space3d");
#elif defined(WARPX_DIM_1D_Z)
py::module::import("amrex.space1d");
auto amr = py::module::import("amrex.space1d");
#else
py::module::import("amrex.space2d");
auto amr = py::module::import("amrex.space2d");
#endif

m.doc() = R"pbdoc(
Expand All @@ -67,6 +67,9 @@ PYBIND11_MODULE(PYWARPX_MODULE_NAME, m) {
init_MultiParticleContainer(m);
init_WarpX(m);

// expose our amrex module
m.attr("amr") = amr;

// API runtime version
// note PEP-440 syntax: x.y.zaN but x.y.z.devN
#ifdef PYIMPACTX_VERSION_INFO
Expand Down

0 comments on commit 1a30df7

Please sign in to comment.