The SaveRestartProcess
implemented in the Kratos Core enables the periodic saving of all data contained in the computing (MPM) model part. This functionality acts as a checkpoint system, allowing users to resume a simulation from the last saved state using the RestartUtility
and without having to restart from the beginning.
Regularly saving data during a simulation is crucial for preventing data loss in case of unexpected interruptions. Additionally, it provides flexibility when the total simulation time is uncertain, allowing users to extend the simulation without losing progress.
Save Simulation Data: the SaveRestartProcess
Parameters & Defaults
{
"kratos_module" : "KratosMultiphysics",
"python_module" : "save_restart_process",
"Parameters" : {
"model_part_name" : "SPECIFY_MODEL_PART_NAME",
"echo_level" : 0,
"serializer_trace" : "no_trace",
"restart_save_frequency" : 0.0,
"restart_control_type" : "time",
"save_restart_files_in_folder" : true,
"output_path" : "",
"max_files_to_keep" : -1
}
}
model_part_name
String identifying the name of the MPM ModelPart (usually MPM_Material
).
echo_level
An integer controlling the verbosity level of the simulation output. If greater than zero, messages are printed to the standard output.
serializer_trace
Serializer flag. Admissible values are:
"no_trace"
(default)"trace_error"
"trace_all"
restart_control_type
Determines how the output is controlled and printed during the simulation. Acceptable values are:
step
: the restart file is generated at regular intervals, specified as a fixed number of time steps;time
: the restart file is generated at regular intervals, specified in seconds.
restart_save_frequency
Selects the amount of output_control_type
that needs to happend before printing a new restart file.
output_path
Specifies the name of the folder where the restart files have to be saved. If empty, the files are saved in
a folder named model_part_name__restart_files
.
save_restart_files_in_folder
If true
, save restart files in folder specified by output_path
, otherwise in the current path.
max_files_to_keep
Specifies the maximum number of restart files to keep. If set to -1
, then keeps all the files (default).
Output Files Name
The name of the .rest
files generated by the SaveRestartProcess
is given by
model_part_name
+ _
+ a label indentifying the step or the time (depending
on the restart_control_type
setting) at which the file is written.
Therefore, the path of each file is one of the following:
-
"save_restart_files_in_folder" : true
→
<current_path>/<output_path>/<model_part_name>_<step|time>.rest
-
"save_restart_files_in_folder" : false
→
<current_path>/<model_part_name>_<step|time>.rest
Restart Simulation: the RestartUtility
For restarting a simulation using the .rest
files generated by the SaveRestartProcess
, the following
parameters must be included in the solver_settings
section of the ProjectParameters.json
input file.
{
"model_import_settings" : {
"input_type" : "rest",
"input_filename" : "",
"input_output_path" : "",
"load_restart_files_from_folder" : true,
"restart_load_file_label" : "1",
"echo_level" : 0,
"serializer_trace" : "no_trace"
}
}
input_type
Value must be "rest"
. Typically (i.e., when not using the restart) this field is set to "mdpa"
.
input_filename
String specifying the name, without the time/step label and the extension,
of the rest
files to be loaded. If the user has not changed the name of the
files, this value must be set equal to the model_part_name
(i.e., the value
used by the SaveRestartProcess
, see Output Files Name).
input_output_path
String specifying the name of the folder containing the rest
files. If empty,
the value is set to <input_filename>__restart_files
.
save_restart_files_in_folder
If true
, it is assumed that the rest
files are contained in the folder specified by input_output_path
.
restart_load_file_label
Label specifying the exact rest
file to be loaded and used as starting point for the simulation,
i.e., the number used as suffix in the rest
files and denoting the time/step to which each file refers
(see Output Files Name).
echo_level
An integer controlling the verbosity level of the simulation output. If greater than zero, messages are printed to the standard output.
serializer_trace
Serializer flag. Admissible values are:
"no_trace"
(default)"trace_error"
"trace_all"