diff --git a/src/Base/PODVector.cpp b/src/Base/PODVector.cpp index 109745b7..2e11d121 100644 --- a/src/Base/PODVector.cpp +++ b/src/Base/PODVector.cpp @@ -61,6 +61,9 @@ void make_PODVector(py::module &m, std::string typestr, std::string allocstr) .def(py::init<>()) .def(py::init(), py::arg("size")) .def(py::init(), py::arg("other")) + .def("assign", [](PODVector_type & pv, T const & value){ + pv.assign(pv.size(), value); + }, py::arg("value"), "assign the same value to every element") .def("push_back", py::overload_cast(&PODVector_type::push_back)) .def("pop_back", &PODVector_type::pop_back) .def("clear", &PODVector_type::clear) diff --git a/src/Particle/ParticleContainer.H b/src/Particle/ParticleContainer.H index 532542a1..36cce41d 100644 --- a/src/Particle/ParticleContainer.H +++ b/src/Particle/ParticleContainer.H @@ -196,9 +196,23 @@ void make_ParticleContainer_and_Iterators (py::module &m, std::string allocstr) .def_property_readonly("num_runtime_int_comps", &ParticleContainerType::NumRuntimeIntComps, "The number of runtime Int components in SoA") + .def_property_readonly("num_position_components", [](const py::object&){ return AMREX_SPACEDIM; }) .def_property_readonly("byte_spread", &ParticleContainerType::ByteSpread) + // runtime components + .def("add_real_comp", &ParticleContainerType::template AddRealComp, + py::arg("communicate")=true, "add a new runtime component with type Real") + .def("add_int_comp", &ParticleContainerType::template AddIntComp, + py::arg("communicate")=true, "add a new runtime component with type Int") + + .def("resize_runtime_real_comp", &ParticleContainerType::ResizeRuntimeRealComp, + py::arg("new_size"), py::arg("communicate"), + "Resize the Real runtime components (SoA)") + .def("resize_runtime_int_comp", &ParticleContainerType::ResizeRuntimeIntComp, + py::arg("new_size"), py::arg("communicate"), + "Resize the Int runtime components (SoA)") + .def_property_readonly("finest_level", &ParticleContainerBase::finestLevel) // ParticleContainer ( const ParticleContainer &) = delete;