@@ -30,10 +30,15 @@ void make_ParticleTileData(py::module &m)
3030 using ParticleTileDataType = ParticleTileData<T_ParticleType, NArrayReal, NArrayInt>;
3131 using SuperParticleType = Particle<NStructReal + NArrayReal, NStructInt + NArrayInt>;
3232
33- auto const particle_tile_data_type =
34- std::string (" ParticleTileData_" ) + std::to_string (NStructReal) + " _" +
35- std::to_string (NStructInt) + " _" + std::to_string (NArrayReal) + " _" +
33+ auto particle_tile_data_type = std::string (" ParticleTileData_" );
34+ if (T_ParticleType::is_soa_particle)
35+ particle_tile_data_type += " pureSoA_" ;
36+ particle_tile_data_type +=
37+ std::to_string (NStructReal) + " _" +
38+ std::to_string (NStructInt) + " _" +
39+ std::to_string (NArrayReal) + " _" +
3640 std::to_string (NArrayInt);
41+
3742 py::class_<ParticleTileDataType>(m, particle_tile_data_type.c_str ())
3843 .def (py::init ())
3944 .def_readonly (" m_size" , &ParticleTileDataType::m_size)
@@ -63,9 +68,14 @@ void make_ParticleTile(py::module &m, std::string allocstr)
6368 using ParticleTileType = ParticleTile<T_ParticleType, NArrayReal, NArrayInt, Allocator>;
6469 using SuperParticleType = Particle<NStructReal + NArrayReal, NStructInt + NArrayInt>;
6570
66- auto const particle_tile_type = std::string (" ParticleTile_" ) + std::to_string (NStructReal) + " _" +
67- std::to_string (NStructInt) + " _" + std::to_string (NArrayReal) + " _" +
68- std::to_string (NArrayInt) + " _" + allocstr;
71+ auto particle_tile_type = std::string (" ParticleTile_" );
72+ if (T_ParticleType::is_soa_particle)
73+ particle_tile_type += " pureSoA_" ;
74+ particle_tile_type += std::to_string (NStructReal) + " _" +
75+ std::to_string (NStructInt) + " _" +
76+ std::to_string (NArrayReal) + " _" +
77+ std::to_string (NArrayInt) + " _" + allocstr;
78+
6979 auto py_particle_tile = py::class_<ParticleTileType>(m, particle_tile_type.c_str ())
7080 .def (py::init ())
7181 .def_readonly_static (" NAR" , &ParticleTileType::NAR)
@@ -184,15 +194,27 @@ void init_ParticleTile(py::module& m) {
184194 // AMReX legacy AoS position + id/cpu particle ype
185195 using ParticleType_0_0 = Particle<0 , 0 >;
186196 using ParticleType_1_1 = Particle<1 , 1 >;
197+ #if AMREX_SPACEDIM == 1
198+ using SoAParticleType_5_0 = SoAParticle<5 , 0 >;
199+ #elif AMREX_SPACEDIM == 2
200+ using SoAParticleType_6_0 = SoAParticle<6 , 0 >;
201+ #elif AMREX_SPACEDIM == 3
187202 using SoAParticleType_7_0 = SoAParticle<7 , 0 >;
203+ #endif
188204 using SoAParticleType_8_0 = SoAParticle<8 , 0 >;
189205
190206 // TODO: we might need to move all or most of the defines in here into a
191207 // test/example submodule, so they do not collide with downstream projects
192208 make_ParticleTile<ParticleType_1_1, 2 , 1 > (m);
193209 make_ParticleTile<ParticleType_0_0, 4 , 0 > (m); // HiPACE++ 22.07
194210 make_ParticleTile<ParticleType_0_0, 5 , 0 > (m); // ImpactX 22.07
195- make_ParticleTile<SoAParticleType_7_0, 7 , 0 > (m); // ImpactX 24.01+
211+ #if AMREX_SPACEDIM == 1
212+ make_ParticleTile<SoAParticleType_5_0, 5 , 0 > (m); // WarpX 24.01+ 1D
213+ #elif AMREX_SPACEDIM == 2
214+ make_ParticleTile<SoAParticleType_6_0, 6 , 0 > (m); // WarpX 24.01+ 2D
215+ #elif AMREX_SPACEDIM == 3
216+ make_ParticleTile<SoAParticleType_7_0, 7 , 0 > (m); // WarpX 24.01+ 3D
217+ #endif
196218 make_ParticleTile<SoAParticleType_8_0, 8 , 0 > (m); // ImpactX 24.01+
197219 make_ParticleTile<ParticleType_0_0, 37 , 1 > (m); // HiPACE++ 22.07
198220}
0 commit comments