CheckpointFile usage #4450
-
Hi! I am trying to create CheckpointFiles and then to restart the simulation from a previous CheckpointFile. I am following the documentation: https://www.firedrakeproject.org/checkpointing.html. 1checkpoint_minimal_example.zip python3 checkpoint_minimal_example.py _checkpoint_minimal_example --- Function Space Details (2D) --- 2I also tried with the mesh defined as: mesh = UnitSquareMesh(10, 10, name="Mesh"). Nothing different. 3Then I tried with the mixed space pressure-velocity function: 4without saving and loading the mesh which is indicated to be otional in the documentation (https://www.firedrakeproject.org/checkpointing.html.), I get the following error: (venv-firedrake) madalinaphys@madalinaenciu:~/Documents/STRASSE_LH2_Simulation/Thermosiphon_2D$ python3 checkpoint_minimal_example.py _checkpoint_minimal_example --- Function Space Details (2D) --- Could you guide me with what I am doing wrong? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I managed to figure out while explaining it in the question :) |
Beta Was this translation helpful? Give feedback.
Saving and loading the mesh seems to be necessary. I am not sure why in the documentation it is said to be optional (https://www.firedrakeproject.org/checkpointing.html.) Can somebody give a working example where you can later load functions from a CheckpointFile without a mesh? What is different in my case?
The other errors come from the fact that the definition of the functions using for example:
a. V_T = FunctionSpace(mesh, T_element)
V_T.name = "TemperatureSpace"
temp = Function(V_T, name="Temperature")
is completely different than:
b. with CheckpointFile(restart_file, 'r') as chk:
mesh = chk.load_mesh("Mesh")
temp = chk.load_function(mesh, name="Temperature"
seem to be different.
B…