Improve support for Particles with PolymorphicArenaAllocator #4603
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Summary
This PR adds a
SetArena(Arena*)function to ParticleContainerBase that allows setting a memory arena that is used for all the particle vectors if the allocator is PolymorphicArenaAllocator. The function has to be called before particle tiles are defined.This functionality is used to fix a bunch of places where a polymorphic vector would previously not have its arena set properly.
Additionally the
RunOnGpulogic inAMReX_WriteBinaryParticleData.His extended to work with a polymorphic allocator.Uses changes extracted from #4404.
Additional background
Previously all components of all particle tiles needed their arena set individually by the user if PolymorphicArenaAllocator was used. In case this was done this PR is a braking change due to the
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(a_arena != nullptrassert inParticleTile::define().Checklist
The proposed changes: