| 1323 | } |
| 1324 | |
| 1325 | void AddIntComp (std::string const & name, int communicate=1) |
| 1326 | { |
| 1327 | // names must be unique |
| 1328 | auto const it = std::ranges::find(m_soa_idata_names, name); |
| 1329 | if (it != m_soa_idata_names.end()) { |
| 1330 | throw std::runtime_error("AddIntComp: name '" + name + "' is already present in the SoA."); |
| 1331 | } |
| 1332 | m_soa_idata_names.push_back(name); |
| 1333 | |
| 1334 | m_runtime_comps_defined = true; |
| 1335 | m_num_runtime_int++; |
| 1336 | h_redistribute_int_comp.push_back(communicate); |
| 1337 | SetParticleSize(); |
| 1338 | this->resizeData(); |
| 1339 | |
| 1340 | // resize runtime SoA |
| 1341 | for (int lev = 0; lev < numLevels(); ++lev) { |
| 1342 | for (ParIterType pti(*this,lev); pti.isValid(); ++pti) { |
| 1343 | auto& tile = DefineAndReturnParticleTile(lev, pti); |
| 1344 | auto np = tile.numParticles(); |
| 1345 | if (np > 0) { |
| 1346 | auto& soa = tile.GetStructOfArrays(); |
| 1347 | soa.resize(np); |
| 1348 | } |
| 1349 | } |
| 1350 | } |
| 1351 | } |
| 1352 | |
| 1353 | void AddIntComp (int communicate=1) |
| 1354 | { |
no test coverage detected