diff options
author | 2020-02-05 12:44:06 -0800 | |
---|---|---|
committer | 2020-02-05 12:44:06 -0800 | |
commit | 5bde8a0df5a404fc2f3622493808930191da03c9 (patch) | |
tree | b3a5e7be14e10bed5193933897911f2877eb541f /Source/Particles/WarpXParticleContainer.cpp | |
parent | 4fa439b20251e815be8ae724d7ff274affa83c56 (diff) | |
parent | e3f379fd4a19a0c7f540c65f51da9f7531a0d32c (diff) | |
download | WarpX-5bde8a0df5a404fc2f3622493808930191da03c9.tar.gz WarpX-5bde8a0df5a404fc2f3622493808930191da03c9.tar.zst WarpX-5bde8a0df5a404fc2f3622493808930191da03c9.zip |
Merge pull request #598 from atmyers/elementary_process
Elementary process refactor
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index 59699d710..cd5bcaaf9 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -748,6 +748,25 @@ WarpXParticleContainer::PushX (int lev, amrex::Real dt) } } +// When using runtime components, AMReX requires to touch all tiles +// in serial and create particles tiles with runtime components if +// they do not exist (or if they were defined by default, i.e., +// without runtime component). +void WarpXParticleContainer::defineAllParticleTiles () noexcept +{ + tmp_particle_data.resize(finestLevel()+1); + for (int lev = 0; lev <= finestLevel(); ++lev) + { + for (auto mfi = MakeMFIter(lev); mfi.isValid(); ++mfi) + { + const int grid_id = mfi.index(); + const int tile_id = mfi.LocalTileIndex(); + tmp_particle_data[lev][std::make_pair(grid_id,tile_id)]; + DefineAndReturnParticleTile(lev, grid_id, tile_id); + } + } +} + // This function is called in Redistribute, just after locate void WarpXParticleContainer::particlePostLocate(ParticleType& p, |