@@ -221,14 +221,16 @@ void make_ParticleContainer_and_Iterators (py::module &m, std::string allocstr)
221
221
// const IntVect* Nrep = nullptr);
222
222
223
223
// void InitFromBinaryFile (const std::string& file, int extradata);
224
-
225
224
// void InitFromBinaryMetaFile
226
- // void InitRandom (Long icount, ULong iseed,
227
- // const ParticleInitData& mass,
228
- // bool serialize = false, RealBox bx = RealBox());
229
225
230
- .def (" Increment" , &ParticleContainerType::Increment) // TODO pure SoA
231
- // .def("IncrementWithTotal", &ParticleContainerType::IncrementWithTotal, py::arg("mf"), py::arg("level"), py::arg("local")=false) // TODO pure SoA
226
+ // TODO for pure SoA
227
+ // depends on https://github.com/AMReX-Codes/amrex/pull/3280
228
+ .def (" InitRandom" , py::overload_cast<Long, ULong, const ParticleInitData&, bool , RealBox>(&ParticleContainerType::InitRandom)) // TODO pure SoA
229
+ .def (" InitRandomPerBox" , py::overload_cast<Long, ULong, const ParticleInitData&>(&ParticleContainerType::InitRandomPerBox)) // TODO pure SoA
230
+ .def (" InitOnePerCell" , &ParticleContainerType::InitOnePerCell) // TODO pure SoA
231
+
232
+ .def (" Increment" , &ParticleContainerType::Increment)
233
+ .def (" IncrementWithTotal" , &ParticleContainerType::IncrementWithTotal, py::arg (" mf" ), py::arg (" level" ), py::arg (" local" )=false )
232
234
.def (" Redistribute" , &ParticleContainerType::Redistribute, py::arg (" lev_min" )=0 , py::arg (" lev_max" )=-1 ,
233
235
py::arg (" nGrow" )=0 , py::arg (" local" )=0 , py::arg (" remove_negative" )=true )
234
236
.def (" SortParticlesByCell" , &ParticleContainerType::SortParticlesByCell)
@@ -361,15 +363,6 @@ void make_ParticleContainer_and_Iterators (py::module &m, std::string allocstr)
361
363
// }
362
364
;
363
365
364
- // TODO for pure SoA
365
- // depends on https://github.com/AMReX-Codes/amrex/pull/3280
366
- if constexpr (!T_ParticleType::is_soa_particle) {
367
- py_pc
368
- .def (" InitRandom" , py::overload_cast<Long, ULong, const ParticleInitData&, bool , RealBox>(&ParticleContainerType::InitRandom)) // TODO pure SoA
369
- .def (" InitRandomPerBox" , py::overload_cast<Long, ULong, const ParticleInitData&>(&ParticleContainerType::InitRandomPerBox)) // TODO pure SoA
370
- .def (" InitOnePerCell" , &ParticleContainerType::InitOnePerCell);
371
- }
372
-
373
366
using iterator = amrex::ParIter_impl<ParticleType, T_NArrayReal, T_NArrayInt, Allocator>;
374
367
make_Iterators< false , iterator, Allocator >(m, allocstr);
375
368
using const_iterator = amrex::ParConstIter_impl<ParticleType, T_NArrayReal, T_NArrayInt, Allocator>;
@@ -383,8 +376,7 @@ void make_ParticleContainer_and_Iterators (py::module &m)
383
376
{
384
377
// TODO for pure SoA
385
378
// depends on https://github.com/AMReX-Codes/amrex/pull/3280
386
- if constexpr (!T_ParticleType::is_soa_particle)
387
- make_ParticleInitData<T_ParticleType, T_NArrayReal, T_NArrayInt>(m);
379
+ make_ParticleInitData<T_ParticleType, T_NArrayReal, T_NArrayInt>(m);
388
380
389
381
// see Src/Base/AMReX_GpuContainers.H
390
382
// !AMREX_USE_GPU: DefaultAllocator = std::allocator
0 commit comments