This add MustRefineParticlesCreateParticles option 4.
When using MustRefineParticlesCreateParticles = 3, dark matter particles from two different nested levels occupying the same cell will cause that cell to be refined to the higher of the two levels. This can add a lot of extra AMR near level boundaries in zoom-in simulations as coarse particles enter higher resolution regions.
With MustRefineParticlesCreateParticles = 4, the opposite strategy is taken, where a cell will be refined to the coarsest level of the contained dark matter particles.
Below is a crude example of a must-refine particle simulation with 2 initial nested levels.
MustRefineParticlesCreateParticles = 3
MustRefineParticlesCreateParticles = 4
This is implemented by creating a set of “antirules”, similar to the refinement rules set up for determining when to refine. The antirules determine when refinement, perhaps flagged by another particle, should be overridden. The antiflagging field is then cic deposited and layered on top of the original flagging field.
@bwoshea Could you review this PR?
Looks good to me, @gbryan . I’ll leave it to you or @jwise77 to merge!
Thanks all – the tests pass and we have three approves, so I’m merging.