| 592 | template <std::integral I> |
| 593 | requires (sizeof(I) >= sizeof(Long)) |
| 594 | void |
| 595 | ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor>::CapacityOfParticlesInGrid (LayoutData<I>& mem, int lev) const |
| 596 | { |
| 597 | AMREX_ASSERT(lev >= 0 && lev < std::ssize(m_particles)); |
| 598 | |
| 599 | AMREX_ASSERT(BoxArray::SameRefs(mem.boxArray(), ParticleBoxArray(lev)) && |
| 600 | mem.DistributionMap() == ParticleDistributionMap(lev)); |
| 601 | |
| 602 | [[maybe_unused]] Gpu::NoSyncRegion no_sync{}; |
| 603 | for (ParConstIterType pti(*this, lev); pti.isValid(); ++pti) |
| 604 | { |
| 605 | int gid = pti.index(); |
| 606 | mem[gid] += static_cast<I>(pti.capacity()); |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | // |
| 611 | // This includes both valid and invalid particles since invalid particles still take up space. |
no test coverage detected