Restarting procedure
We have nearly everything available to make cashocs jobs restartable. Meshes can be read from saved state files and can (soon) be extracted to gmsh again. These can then be used to define a new initial geometry, and so on.
What we still need is:
- [x] A way to generate meaningful Gmsh meshes with physical tags (see #281)
- [x] When a remeshing occurs, the new mesh has to be saved publicly so that it can be used to restart the session
- [ ] A script / CLI for automatically performing the required mesh conversions, etc. so that the user only has to adapt the initial mesh in their script
- [ ] Documentation of the feature for a simple example
I think that it is not so sensible to create a script which automatically converts everything to restart automatically. I think there are way too many variables in which users set up their code and where things (e.g. meshes) are stored.
Maybe it makes sense to add a restart = bool config option... This would take the config as it is and look for the latest available checkpoint automatically. If none is found, then the script is run as-is.
The difficulty with this approach is that the mesh filename has to be changed dynamically: Is this possible? Do we have to overload the cashocs.import_mesh functionality? This is where the interplay fenics <-> cashocs is crucial and leads to problems...
I am closing this issue as it will not be supported in the foreseeable future. The implications of changing meshes etc. are too large.
Users can manually restart the optimization with loading in the controls (for optimal control, they have to be saved to xdmf) or the mesh (which should be saved with the save_mesh parameter) and can create a new script for the restart. This starts from 0 again, which is what it should do anyway.
If there is need for detailed instructions on how to restart or if there is demand for the restarting procedure, feel free to open a new issue or reopen this one.