The average velocity profile of an old simulation can now be used as an initial condition to a new simulation. The base mesh needs to stay the same, but auxiliary physics can now be added a posteriori without setting them as true in the initial simulation. The time stepping scheme can also be modified.
Description
The refactored restart mechanism had some problems:
The auxiliary physics needed to be set as true while the average velocity profile was calculated. The matrix for the auxiliary physic was therefore assembled and could lead to useless memory and simulation time usage.
The user could not choose to add an auxiliary physics to an already calculated average velocity profile if it was not specified in the initial simulation. This is because the restart mechanism would always search for a solution to the auxiliary physic in the checkpoint files even if it was non existent.
In my opinion, the location of the "use average velocity profile = true" in the multiphysics subsection was somewhat awkward as the average velocity profile is not really an auxiliary physic.
To solve these problems, the already implemented checkpoint mechanism is used. The simulation solving for the average velocity profile therefore needs to have checkpointing activated as well as the set calculate average velocities set to true (as before). Parameters in the initial condition section have been added as well as some conditions in the read_checkpoint() function.
Conditions like:
Do not search for a solution to the auxiliary physics if the average velocity is used as an initial condition.
Do search for a solution to the auxiliary physics if the restart is normally used.
Use the checkpoint file specified by the user in the appropriate initial condition section and not the simulation control section if the average velocity profile initial condition is used.
Testing
A test using the average velocity profile was modified.
Documentation
Documentation will be added in a subsequent PR if all the modifications are accepted.
Miscellaneous (will be removed when merged)
An initial condition using the VTU files was attempted, but it is way easier to use the already existing checkpoint mechanism. No known function to retrieve the triangulation information from the vtu have been found in deal.II. The read_vtu() function is only oriented towards reading vtu meshes generated with deal.II.
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
[ ] All in-code documentation related to this PR is up to date (Doxygen format)
[ ] Lethe documentation is up to date
[x] The branch is rebased onto master
[x] Code is indented with indent-all and .prm files (examples and tests) with prm-indent
[x] If parameters are modified, the tests and the documentation of examples are up to date
[ ] Changelog (CHANGELOG.md) is up to date if the refactor affects the user experience or the codebase
Pull request related list:
[x] No other PR is open related to this refactoring
[x] Labels are applied
[x] There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
[x] If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
[x] If any future works is planed, an issue is opened
[ ] The PR description is cleaned and ready for merge
So now if I understand correctly, we can run simulation that solve FD only while checkpointing, then run subsequent simulations where auxiliary physics are activated by using the proper type of initial condition?
The average velocity profile of an old simulation can now be used as an initial condition to a new simulation. The base mesh needs to stay the same, but auxiliary physics can now be added a posteriori without setting them as true in the initial simulation. The time stepping scheme can also be modified.
Description
The refactored restart mechanism had some problems:
To solve these problems, the already implemented checkpoint mechanism is used. The simulation solving for the average velocity profile therefore needs to have checkpointing activated as well as the set calculate average velocities set to true (as before). Parameters in the initial condition section have been added as well as some conditions in the read_checkpoint() function.
Conditions like:
Testing
A test using the average velocity profile was modified.
Documentation
Documentation will be added in a subsequent PR if all the modifications are accepted.
Miscellaneous (will be removed when merged)
An initial condition using the VTU files was attempted, but it is way easier to use the already existing checkpoint mechanism. No known function to retrieve the triangulation information from the vtu have been found in deal.II. The read_vtu() function is only oriented towards reading vtu meshes generated with deal.II.
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: