Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 6 additions & 3 deletions src/Base/PODVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ void make_PODVector(py::module &m, std::string typestr, std::string allocstr)
// .def("max_size", &PODVector_type::max_size)
.def("capacity", &PODVector_type::capacity)
.def("empty", &PODVector_type::empty)
.def("resize", py::overload_cast<std::size_t>(&PODVector_type::resize))
.def("resize", py::overload_cast<std::size_t, const T&>(&PODVector_type::resize))
.def("reserve", &PODVector_type::reserve)
.def("resize", [](PODVector_type & pv, std::size_t new_size){
pv.resize(new_size); })
.def("resize", [](PODVector_type & pv, std::size_t new_size, const T& init_val){
pv.resize(new_size, init_val); })
.def("reserve", [](PODVector_type & pv, std::size_t new_capacity){
pv.reserve(new_capacity); })
.def("shrink_to_fit", &PODVector_type::shrink_to_fit)
.def("to_host", [](PODVector_type const & pv) {
PODVector<T, amrex::PinnedArenaAllocator<T>> h_data(pv.size());
Expand Down
3 changes: 2 additions & 1 deletion src/Particle/ParticleTile.H
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ void make_ParticleTile(py::module &m, std::string allocstr)

.def("set_num_neighbors", &ParticleTileType::setNumNeighbors)
.def("get_num_neighbors", &ParticleTileType::getNumNeighbors)
.def("resize", &ParticleTileType::resize)
.def("resize", [](ParticleTileType & pt, std::size_t new_size){
pt.resize(new_size); })
;

if constexpr (!T_ParticleType::is_soa_particle) {
Expand Down
3 changes: 2 additions & 1 deletion src/Particle/StructOfArrays.H
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ void make_StructOfArrays(py::module &m, std::string allocstr)

.def("set_num_neighbors", &SOAType::setNumNeighbors)
.def("get_num_neighbors", &SOAType::getNumNeighbors)
.def("resize", &SOAType::resize)
.def("resize", [](SOAType & soa, std::size_t new_size){
soa.resize(new_size); })
;
if (use64BitIdCpu)
py_SoA.def("get_idcpu_data", py::overload_cast<>(&SOAType::GetIdCPUData),
Expand Down
Loading