MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / AddIntComp

Method AddIntComp

Src/Particle/AMReX_ParticleContainer.H:1325–1351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

addParticlesFunction · 0.45
make_alikeMethod · 0.45

Calls 7

resizeDataMethod · 0.95
GetStructOfArraysMethod · 0.80
endMethod · 0.45
push_backMethod · 0.45
isValidMethod · 0.45
numParticlesMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected