From 0134c3dcb7cae3a04088443e4f97a21bbbc44635 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Wed, 9 Oct 2024 19:03:40 -0700 Subject: [PATCH] AMReX: Update to latest `development` (#379) Update to latest commit in `development`. Includes upstream named SoA components. Includes updated APIs from #375 --------- Co-authored-by: Andrew Myers --- cmake/dependencies/AMReX.cmake | 2 +- src/Particle/ParticleContainer.H | 22 ++++++++++++++++++---- tests/test_soa.py | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cmake/dependencies/AMReX.cmake b/cmake/dependencies/AMReX.cmake index 55a6a30a..68d6bf98 100644 --- a/cmake/dependencies/AMReX.cmake +++ b/cmake/dependencies/AMReX.cmake @@ -86,7 +86,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 "24.10" +set(pyAMReX_amrex_branch "8df11b69a1169a1b7791a7a5e723feecd121b467" CACHE STRING "Repository branch for pyAMReX_amrex_repo if(pyAMReX_amrex_internal)") diff --git a/src/Particle/ParticleContainer.H b/src/Particle/ParticleContainer.H index f820dc7f..ef103d3e 100644 --- a/src/Particle/ParticleContainer.H +++ b/src/Particle/ParticleContainer.H @@ -205,10 +205,24 @@ void make_ParticleContainer_and_Iterators (py::module &m, std::string allocstr) .def_property_readonly("byte_spread", &ParticleContainerType::ByteSpread) // runtime components - .def("add_real_comp", py::overload_cast(&ParticleContainerType::template AddRealComp), - py::arg("communicate")=true, "add a new runtime component with type Real") - .def("add_int_comp", py::overload_cast(&ParticleContainerType::template AddIntComp), - py::arg("communicate")=true, "add a new runtime component with type Int") + .def("add_real_comp", py::overload_cast(&ParticleContainerType::AddRealComp), + py::arg("communicate")=1, + "add a new runtime component with type Real" + ) + .def("add_int_comp", py::overload_cast(&ParticleContainerType::AddIntComp), + py::arg("communicate")=1, + "add a new runtime component with type Int" + ) + .def("add_real_comp", py::overload_cast(&ParticleContainerType::AddRealComp), + py::arg("name"), + py::arg("communicate")=1, + "add a new runtime component with type Real" + ) + .def("add_int_comp", py::overload_cast(&ParticleContainerType::AddIntComp), + py::arg("name"), + py::arg("communicate")=1, + "add a new runtime component with type Int" + ) .def_property_readonly("finest_level", &ParticleContainerBase::finestLevel) diff --git a/tests/test_soa.py b/tests/test_soa.py index d358091f..f1970e31 100644 --- a/tests/test_soa.py +++ b/tests/test_soa.py @@ -12,7 +12,7 @@ def test_soa_init(): print("num int components", soa.num_int_comps) assert soa.num_real_comps == 3 and soa.num_int_comps == 1 - soa.define(1, 3) + soa.define(1, 3, ["x", "y", "z", "w"], ["i1", "i2", "i3", "i4"]) print("--test define --") print("num real components", soa.num_real_comps) print("num int components", soa.num_int_comps)