prisms-center / phaseField

PRISMS-PF: An Open-Source Phase-Field Modeling Framework
https://prisms-center.github.io/phaseField/
Other
229 stars 119 forks source link

Starting from a checkpoint with different adaptivity parameters #184

Open david-montiel-t opened 2 years ago

david-montiel-t commented 2 years ago

There may be issues when restarting a simulation with different adaptive criteria than the original simulation.

For example, consider a simulation with minimum and maximum refinement levels set to 5 and 7, respectively. The simulation is run starting from time t=0 for Ns time steps and it outputs a the last checkpoint at time step Nc. If we restart the simulation from checkpoint corresponding to Nc but for the new simulation modify the minimum and maximum refinement levels to 4 and 6, respectively, the mesh in the region of the system corresponding to level 7 will not unadapt and stop evolving.

landinjm commented 3 months ago

This has to do with the refinement criterion logic & perhaps the order of loading restarts and calling for AMR in init.cc. Should be an easy fix. https://github.com/prisms-center/phaseField/blob/5f4829aa30fc3e637f57f353e4179ea5d8f1446e/src/matrixfree/refine.cc#L152-L160

Keep in mind that we should warn the user that this is happening.