Skip to content

Commit

Permalink
AMReX: Update to latest development (#379)
Browse files Browse the repository at this point in the history
Update to latest commit in `development`.

Includes upstream named SoA components. Includes updated APIs from #375

---------

Co-authored-by: Andrew Myers <atmyers2@gmail.com>
  • Loading branch information
ax3l and atmyers authored Oct 10, 2024
1 parent 7d23493 commit 0134c3d
Show file tree
Hide file tree
Showing 3 changed files with 20 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 @@ -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)")

Expand Down
22 changes: 18 additions & 4 deletions src/Particle/ParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>(&ParticleContainerType::template AddRealComp<bool>),
py::arg("communicate")=true, "add a new runtime component with type Real")
.def("add_int_comp", py::overload_cast<bool>(&ParticleContainerType::template AddIntComp<bool>),
py::arg("communicate")=true, "add a new runtime component with type Int")
.def("add_real_comp", py::overload_cast<int>(&ParticleContainerType::AddRealComp),
py::arg("communicate")=1,
"add a new runtime component with type Real"
)
.def("add_int_comp", py::overload_cast<int>(&ParticleContainerType::AddIntComp),
py::arg("communicate")=1,
"add a new runtime component with type Int"
)
.def("add_real_comp", py::overload_cast<std::string const &, int>(&ParticleContainerType::AddRealComp),
py::arg("name"),
py::arg("communicate")=1,
"add a new runtime component with type Real"
)
.def("add_int_comp", py::overload_cast<std::string const &, int>(&ParticleContainerType::AddIntComp),
py::arg("name"),
py::arg("communicate")=1,
"add a new runtime component with type Int"
)

.def_property_readonly("finest_level", &ParticleContainerBase::finestLevel)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_soa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0134c3d

Please sign in to comment.