How to use Restart Initialization¶

This capability allows you to start a new simulation using an initial condition based on a previously run simulation. The initial condition is provided by the Restart/Checkpoint data. The basic steps described in this workflow are:
Create a simulation
Run solver (1)
Create copy of MSB file
Configure restart initialization in new model
Run solver (2) – This uses initial condition data from the results of (1)
It is recommended to keep the file structure separate for the two cases. The below text shows a notional file/directory structure.
|-- run-1/ (Original/Source case providing initial conditions for subsequent runs)
| |-- run1.msb
| |-- input.xml, *.stl
| |-- out/
| |-- Stats/
| |-- Output/
| |-- Checkpoint/
| |-- TimeX.XXXXX/ (This is the initial condition data)
|-- run-2/ (New/Target case using initial condition from run-1)
|-- run2.msb
|-- input.xml, *.stl
|-- out/
The second simulation (run-2) will reference the first simulation (run-1) checkpoint data. Therefore it is important that the location of run-1 does not change.
Important
Note the location of the initial condition data. This is located at out/Checkpoint/TimeX.XXXX
in the original case results, where TimeX.XXXX
is the chosen checkpoint time data folder.
Basic Workflow¶
Create a basis simulation
This simulation will provide the initial condition data to our next simulation. The only requirement here is to enable checkpoint writing, which is on by default. Go to the Output settings panel (click the Output button). On the Restart Files page, make sure restart files are configured.
Run the simulation
No special requirement here. Just run the simulation as usual. Wait for it to finish.
Create a copy of the MSB file
Copy the MSB file to a new location and open it in M-Star Pre. The remainder of the instructions will use this MSB file.
Configure Restart Initialization
Click on Simulation Parameters in the Model tab
Change the Initial State Mode to External Load
Click Edit
The Check Point Mapping form should appear. This window contains all of the initial state loading configuration and displays how source data will map onto the new simulation. It parses the available data from the original checkpoint files if available.
Click Local - Refer to data .
Set the Path to TimeX.XXXXX directory by pasting the text or clicking the browse button. This directory should be set to the checkpoint restart time directory of the previously run simulation. This directory is shown above in the example folder structure.
Once the checkpoint path is set, the available data will appear in the Source column in the table. Depending on how the new simulation is configured, every field may or may not be matched in the Target data column. If the source data cannot be matched to a target, it will not be available for loading. Therefore any fields (scalar, particles) that you want to load from the original case must have the same name.
Use the Load column to configure how each field is loaded or not loaded.
Click OK
Run the solver
Click Run. This second simulation will load the initial condition data from the first simulation.
Check Point Mapping Form¶
Where is the checkpoint data?
Local - Copy the data during export - This data must be on the local computer. This will copy the original checkpoint data into the new case when you export the new case. This can be useful if you need to make a self contained case.
Local - Refer to data - This data must be on the local computer. This will reference the original checkpoint data. This is more space efficient but does require that the new case be able to access the original data at the same exact path as specified. Therefore if you move or delete the old data, the new case will not run.
Remote - Refer to data - The data is on a remote resource.
Path to TimeX.XXXX directory
This input should refer to the original case out/Checkpoint/TimeX.XXXXX
directory that will be used for initial condition. For example
|-- run-1/
| |-- run1.msb
| |-- input.xml, *.stl
| |-- out/
| |-- Stats/
| |-- Output/
| |-- Checkpoint/
| |-- TimeX.XXXXX/ (Choose this directory)
Table display
If the data is Local, the Source column (original case) will be populated with all available fields that can be used for initialization. The Target column lists out fields in the new simulation. Note that names are matched by name and type, so the new model should use the same names if initial condition loading is required. If you want to load a field from the initial condition, change Load to On. If you do not want to load the initial condition data, change the setting to Off.
If the data is Remote, the table is only populated with the new simulation fields. You will have to know which fields are available.
Special note for particles – Particles have the option to load positions only.
Initial condition overrides input values¶
This may be obvious, but when you use external data as an initial condition, this will override the value set on the object. So for example if you decide to load in the particle initial condition data, but also have the particles set to Dump at a certain time, this Dump setting is ignored in favor of the loaded initial condition data. Some warnings about this will likely appear in M-Star Pre when you go to run the model.