Restarting a Simulation#

A completed simulation can be continued with more loading steps (see Simulation Restart). In this tutorial, an fcc polycrystal of 50 grains (the mesh of Multiaxial Control at a Constant Strain Rate) is loaded in two cycles, run one after the other:

../../_images/mesh3.png

Fig. 30 The mesh, colored by grain.#

The material is an AL6XN steel, with cyclic hardening:

Table 19 Single-crystal elastic constants and plasticity parameters.#

\(c_{11}\) [MPa]

\(c_{12}\) [MPa]

\(c_{44}\) [MPa]

\(m\) [-]

\(\dot{\gamma}_0\) [1/s]

\(\tau_0\) [MPa]

\(h_0\) [MPa]

\(\tau_s\) [MPa]

\(n\) [-]

\(204.6 \times 10^3\)

\(137.7 \times 10^3\)

\(126.2 \times 10^3\)

0.02

1.0

160.0

375.0

1000.0

1.0

Table 20 Cyclic hardening parameters (cyclic_hardening on).#

\(a\) [-]

\(c\) [-]

0.05

3.5

The polycrystal is loaded along 33 at a constant strain rate with triaxial control, the loads 11 and 22 held at zero. The first run loads to 300 N and unloads to 0 N, and writes a restart point at the end of every step (print restart).

First Run#

## FEPX tutorial "Restarting a simulation", first run: a 50-grain fcc polycrystal (AL6XN steel,
## cyclic hardening) loaded along 33 at a constant strain rate to 300 N and unloaded to 0 N; the
## restart point written at every step end.

## Material
number_of_phases 1
phase 1
  crystal_type FCC
  model crystal_plasticity
  c11 204.6e3
  c12 137.7e3
  c44 126.2e3
  m 0.02
  gammadot_0 1.0
  tau_0 160.0
  hardening saturation_isotropic
  h_0 375.0
  tau_s 1000.0
  n 1.0
  cyclic_hardening on
  cyclic_a 0.05
  cyclic_c 3.5

## Loading
boundary_conditions triaxial
control_component 33
number_of_steps 2
#                 comp  step 1  step 2
strain_rate       33    1e-4   -1e-4
target_load       33    300.0   0.0
target_load       11    0.0     0.0
target_load       22    0.0     0.0
dtime                   2.5     2.5
dtime_min               0.25    0.25

## Output
print defrate_pl_eq
print slip
print sliprate
print coo
print forces
print restart
print stress
print strain
$ mpirun -np 4 fepx
========================    F   E   P   X    ===========================
Info   : A finite element software package for polycrystal plasticity.
Info   : Version 3.0.0-dev (git 755da754, 11-06-2026)
Info   : Built with: GCC 15.2.0|Open MPI 5.0.10|HDF5 1.14.6
Info   : Running on 4 ranks.
Info   : <https://fepx.info>
Info   : Copyright (C) 1996-2026, and MIT licensed, by the FEPX authors.
Info   : ---------------------------------------------------------------
Info   : Loading simulation...
Info   :   [i] Parsing file `simulation.cfg'...
Info   :   [i] Parsed file `simulation.cfg'.
Info   :   [i] Parsing file `simulation.msh'...
Info   :   [i] Parsed file `simulation.msh'.
Info   :   - Material parameters:
Info   :     > Number of phases: 1
Info   :     > Phase 1: fcc, crystal_plasticity
Info   :       . c11:                       2.0460E+05 MPa
Info   :       . c12:                       1.3770E+05 MPa
Info   :       . c44:                       1.2620E+05 MPa
Info   :       . m:                         2.0000E-02
Info   :       . gammadot_0:                1.0000E+00 1/s
Info   :       . hardening:                 saturation_isotropic
Info   :       . tau_0:                     1.6000E+02 MPa
Info   :       . h_0:                       3.7500E+02 MPa
Info   :       . tau_s:                     1.0000E+03 MPa
Info   :       . n:                         1.0000E+00
Info   :       . saturation_evolution:      off (def.)
Info   :       . cyclic_hardening:          on
Info   :       . cyclic_a:                  5.0000E-02
Info   :       . cyclic_c:                  3.5000E+00
Info   :       . precipitate_strengthening: off (def.)
Info   :   - Loading: boundary_conditions triaxial, 2 steps
Info   :     > Triaxial load control: elastic estimate E = 2.2545E+05
Info   :       MPa, nu = 2.6516E-01
Info   :     > Triaxial load control: initial face velocities
Info   :       -2.6516E-05 -2.6516E-05 1.0000E-04 mm/s
Info   :     > Step 1: target_load 33 3.0000E+02 N from t = 0.0000E+00
Info   :       s, increments 2.5000E-01 to 2.5000E+00 s
Info   :       . Component 11: target_load 0.0000E+00 N
Info   :         (load-controlled)
Info   :       . Component 22: target_load 0.0000E+00 N
Info   :         (load-controlled)
Info   :   - Options other than the defaults: (none)
Info   :   - Output: defrate_pl_eq slip sliprate coo forces restart
Info   :     stress strain (format ascii)
Info   :   - Mesh parameters:
Info   :     > Node number: 8737
Info   :     > Elt  number: 5641 (10-node tetrahedra)
Info   :     > Elsets: 50; partitions: 4
Info   :   - Partitioning: 4 ranks
Info   :     > Elements per rank: 1410 to 1411
Info   :     > Ghost nodes per rank: 224 to 305 (1047 in total)
Info   :     > Neighbors per rank: 3 to 3
Info   :   [o] Writing results to `simulation.sim'...
Info   : Initializing simulation...
Info   :   - Elastic step of 1.0000E-01 s (step 1)
Info   :     > Iteration 1 (SA): R = 9.6495E-02 (257 CG iterations)
Info   :     > Iteration 2 (SA): R = 1.1844E-06 (247 CG iterations)
Info   :     > Converged in 2 iterations (1.741 s)
Info   : Running step 1...
Info   :   - Increment 1: t = 2.5000E+00 s, dt = 2.4000E+00 s
Info   :     > Iteration 1 (SA): R = 4.0746E-05 (245 CG iterations)
Info   :     > Iteration 2 (NR): R = 1.6916E-08 (246 CG iterations)
Info   :     > Converged in 2 iterations (1.784 s)
Info   :     > Load iteration 1: face velocities -2.65156E-05
Info   :       -2.65156E-05 1.00000E-04 mm/s; 11: 4.513590E+00 (to reach
Info   :       0.000000E+00) N; 22: 3.887811E+00 (to reach 0.000000E+00)
Info   :       N;
Info   :     > Iteration 1 (SA): R = 6.3389E-05 (244 CG iterations)
Info   :     > Iteration 2 (NR): R = 1.8784E-08 (236 CG iterations)
Info   :     > Converged in 2 iterations (1.745 s)
Info   :     > Iteration 1 (SA): R = 6.7969E-05 (253 CG iterations)
Info   :     > Iteration 2 (NR): R = 1.8511E-08 (245 CG iterations)
Info   :     > Converged in 2 iterations (1.773 s)
Info   :     > Iteration 1 (SA): R = 3.5878E-03 (255 CG iterations)
Info   :     > Iteration 2 (NR): R = 1.1483E-06 (243 CG iterations)
Info   :     > Converged in 2 iterations (1.751 s)
Info   :     > Load iteration 2: face velocities -3.20926E-05
Info   :       -3.05013E-05 1.00000E-04 mm/s; 11: -1.159917E-04 (to
Info   :       reach 0.000000E+00) N; 22: -7.828203E-05 (to reach
Info   :       0.000000E+00) N;
  [...]
Info   : Final step terminated. Simulation completed successfully.
Info   :   [o] Wrote results to `simulation.sim'.
Info   :   - Increments: 17
Info   :   - Global iterations: 108 (58 NR)
Info   :   - CG iterations: 27437
Info   :   - Warnings issued: 17
Info   :   - Wall time per phase:
Info   :     > Input and setup:                      0.114 s
Info   :     > Initialization:                       1.751 s
Info   :     > Increments:                          95.111 s
Info   :       . Element and material work:         67.582 s
Info   :       . CG:                                26.912 s
Info   :       . Other:                              0.617 s
Info   :     > Output:                               2.672 s
Info   : Elapsed time:                              99.648 s
========================================================================
simulation.sim
|-- inputs
|   |-- simulation.cfg
|   `-- simulation.msh
|-- restart
|   |-- restart.rank0
|   |-- restart.rank1
|   |-- restart.rank2
|   `-- restart.rank3
`-- results
    |-- elts
    |   |-- defrate_pl_eq
    |   |   |-- defrate_pl_eq.step0
    |   |   |-- defrate_pl_eq.step1
    |   |   `-- defrate_pl_eq.step2
    |   |-- slip
    |   |   |-- slip.step0
    |   |   |-- slip.step1
    |   |   `-- slip.step2
    |   |-- sliprate
    |   |   |-- sliprate.step0
    |   |   |-- sliprate.step1
    |   |   `-- sliprate.step2
    |   |-- strain
    |   |   |-- strain.step0
    |   |   |-- strain.step1
    |   |   `-- strain.step2
    |   `-- stress
    |       |-- stress.step0
    |       |-- stress.step1
    |       `-- stress.step2
    |-- forces
    |   |-- x0
    |   |-- x1
    |   |-- y0
    |   |-- y1
    |   |-- z0
    |   `-- z1
    |-- mesh
    |   |-- strain
    |   |   |-- strain.step0
    |   |   |-- strain.step1
    |   |   `-- strain.step2
    |   `-- stress
    |       |-- stress.step0
    |       |-- stress.step1
    |       `-- stress.step2
    `-- nodes
        `-- coo
            |-- coo.step0
            |-- coo.step1
            `-- coo.step2

Second Run#

The second run, in the same directory, continues simulation.sim: it reloads to 230 N and unloads again. Its configuration file replaces the first; it has restart on and lists only the new steps, which are written as steps 3 and 4. The material, the boundary conditions and the input files must be those of the first run.

## FEPX tutorial "Restarting a simulation", second run (in the directory of the first): reloading
## to 230 N and unloading to 0 N, written as steps 3 and 4.

## Material
number_of_phases 1
phase 1
  crystal_type FCC
  model crystal_plasticity
  c11 204.6e3
  c12 137.7e3
  c44 126.2e3
  m 0.02
  gammadot_0 1.0
  tau_0 160.0
  hardening saturation_isotropic
  h_0 375.0
  tau_s 1000.0
  n 1.0
  cyclic_hardening on
  cyclic_a 0.05
  cyclic_c 3.5

## Loading
restart on
boundary_conditions triaxial
control_component 33
number_of_steps 2
#                 comp  step 1  step 2
strain_rate       33    1e-4   -1e-4
target_load       33    230.0   0.0
target_load       11    0.0     0.0
target_load       22    0.0     0.0
dtime                   2.5     2.5
dtime_min               0.25    0.25

## Output
print defrate_pl_eq
print slip
print sliprate
print coo
print forces
print restart
print stress
print strain
$ mpirun -np 4 fepx
========================    F   E   P   X    ===========================
Info   : A finite element software package for polycrystal plasticity.
Info   : Version 3.0.0-dev (git 755da754, 11-06-2026)
Info   : Built with: GCC 15.2.0|Open MPI 5.0.10|HDF5 1.14.6
Info   : Running on 4 ranks.
Info   : <https://fepx.info>
Info   : Copyright (C) 1996-2026, and MIT licensed, by the FEPX authors.
Info   : ---------------------------------------------------------------
Info   : Loading simulation...
Info   :   [i] Parsing file `simulation.cfg'...
Info   :   [i] Parsed file `simulation.cfg'.
Info   :   [i] Parsing file `simulation.msh'...
Info   :   [i] Parsed file `simulation.msh'.
Info   :   - Material parameters:
Info   :     > Number of phases: 1
Info   :     > Phase 1: fcc, crystal_plasticity
Info   :       . c11:                       2.0460E+05 MPa
Info   :       . c12:                       1.3770E+05 MPa
Info   :       . c44:                       1.2620E+05 MPa
Info   :       . m:                         2.0000E-02
Info   :       . gammadot_0:                1.0000E+00 1/s
Info   :       . hardening:                 saturation_isotropic
Info   :       . tau_0:                     1.6000E+02 MPa
Info   :       . h_0:                       3.7500E+02 MPa
Info   :       . tau_s:                     1.0000E+03 MPa
Info   :       . n:                         1.0000E+00
Info   :       . saturation_evolution:      off (def.)
Info   :       . cyclic_hardening:          on
Info   :       . cyclic_a:                  5.0000E-02
Info   :       . cyclic_c:                  3.5000E+00
Info   :       . precipitate_strengthening: off (def.)
Info   :   - Loading: boundary_conditions triaxial, 2 steps
Info   :     > Triaxial load control: elastic estimate E = 2.2545E+05
Info   :       MPa, nu = 2.6516E-01
Info   :     > Step 3: target_load 33 2.3000E+02 N from t = 3.5376E+01
Info   :       s, increments 2.5000E-01 to 2.5000E+00 s
Info   :       . Component 11: target_load 0.0000E+00 N
Info   :         (load-controlled)
Info   :       . Component 22: target_load 0.0000E+00 N
Info   :         (load-controlled)
Info   :   - Restart: continuing from step 2 (increment 17, t =
Info   :     3.5376E+01 s); the 2 steps of simulation.cfg follow it
Info   :   - Options other than the defaults:
Info   :     > restart on
Info   :   - Output: defrate_pl_eq slip sliprate coo forces restart
Info   :     stress strain (format ascii)
Info   :   - Mesh parameters:
Info   :     > Node number: 8737
Info   :     > Elt  number: 5641 (10-node tetrahedra)
Info   :     > Elsets: 50; partitions: 4
Info   :   - Partitioning: 4 ranks
Info   :     > Elements per rank: 1410 to 1411
Info   :     > Ghost nodes per rank: 224 to 305 (1047 in total)
Info   :     > Neighbors per rank: 3 to 3
Info   :   [o] Writing results to `simulation.sim'...
Info   : Running step 3...
Info   :   - Increment 18: t = 3.7876E+01 s, dt = 2.5000E+00 s
Info   :     > Control rate reversed: accumulated slip (cyclic
Info   :       hardening) reset
Info   :     > Iteration 1 (SA): R = 3.5731E-05 (246 CG iterations)
Info   :     > Iteration 2 (NR): R = 1.4794E-08 (249 CG iterations)
Info   :     > Converged in 2 iterations (1.434 s)
Info   :     > Load iteration 1: face velocities -3.19234E-05
Info   :       -3.03882E-05 1.00000E-04 mm/s; 11: 2.590448E-02 (to reach
Info   :       6.636044E-02) N; 22: 2.451239E-02 (to reach 6.346606E-02)
Info   :       N;
  [...]
Info   : Final step terminated. Simulation completed successfully.
Info   :   [o] Wrote results to `simulation.sim'.
Info   :   - Increments: 12
Info   :   - Global iterations: 52 (26 NR)
Info   :   - CG iterations: 12779
Info   :   - Warnings issued: 0
Info   :   - Wall time per phase:
Info   :     > Input and setup:                      0.103 s
Info   :     > Initialization:                       0.010 s
Info   :     > Increments:                          37.178 s
Info   :       . Element and material work:         26.227 s
Info   :       . CG:                                10.598 s
Info   :       . Other:                              0.353 s
Info   :     > Output:                               2.289 s
Info   : Elapsed time:                              39.580 s
========================================================================

The simulation directory then holds the results of both runs. Post-process it with Neper (neper -S) after the second run: Neper’s results of the first run (in simulation.sim/results/mesh) cannot be extended to the new steps; remove them before running neper -S again.

simulation.sim
|-- inputs
|   |-- simulation.cfg
|   `-- simulation.msh
|-- restart
|   |-- restart.rank0
|   |-- restart.rank1
|   |-- restart.rank2
|   `-- restart.rank3
`-- results
    |-- elts
    |   |-- defrate_pl_eq
    |   |   |-- defrate_pl_eq.step0
    |   |   |-- defrate_pl_eq.step1
    |   |   |-- ...
    |   |   `-- defrate_pl_eq.step4
    |   |-- slip
    |   |   |-- slip.step0
    |   |   |-- slip.step1
    |   |   |-- ...
    |   |   `-- slip.step4
    |   |-- sliprate
    |   |   |-- sliprate.step0
    |   |   |-- sliprate.step1
    |   |   |-- ...
    |   |   `-- sliprate.step4
    |   |-- strain
    |   |   |-- strain.step0
    |   |   |-- strain.step1
    |   |   |-- ...
    |   |   `-- strain.step4
    |   `-- stress
    |       |-- stress.step0
    |       |-- stress.step1
    |       |-- ...
    |       `-- stress.step4
    |-- forces
    |   |-- x0
    |   |-- x1
    |   |-- y0
    |   |-- y1
    |   |-- z0
    |   `-- z1
    |-- mesh
    |   |-- strain
    |   |   |-- strain.step0
    |   |   |-- strain.step1
    |   |   |-- ...
    |   |   `-- strain.step4
    |   `-- stress
    |       |-- stress.step0
    |       |-- stress.step1
    |       |-- ...
    |       `-- stress.step4
    `-- nodes
        `-- coo
            |-- coo.step0
            |-- coo.step1
            |-- ...
            `-- coo.step4

Simulation Results#

../../_images/curves7.png

Fig. 31 (left) Volume-averaged normal stresses against the normal strains at the ends of the four steps; (right) normal stresses of faces x1, y1 and z1 (force over current area) at every increment of both runs.#

../../_images/slip7.png

Fig. 32 Accumulated slip on system 7 after the second cycle (displacements magnified 10 times).#

../../_images/slip8.png

Fig. 33 Accumulated slip on system 8 after the second cycle (displacements magnified 10 times).#

The commands, after the second run:

$ neper -S simulation.sim -resmesh stress,strain
$ neper -V simulation.sim -step 4 -datanodecoo coo -datanodecoofact 10 -showelt1d all \
    -dataelt1drad 0.004 -dataelt3dedgerad 0.0015 -dataelt3dedgecol 32:32:32 -cameraangle \
    13.5 -imagesize 800:800 -dataeltcol slip7 -dataeltscale \
    -0.0006:-0.0004:-0.0002:0.0000:0.0002:0.0004:0.0006 -print img_slip7
$ convert "(" img_slip7.png -trim ")" "(" -size 40x1 xc:white ")" "(" -size 240x \
    -background white -font DejaVu-Serif -pointsize 30 "caption:Slip, system 7" \
    -bordercolor white -border 0x12 "(" img_slip7-scale3d.png -trim ")" -gravity west \
    -append ")" -background white -gravity center +append -bordercolor white -border 20 \
    -resize 600x600 -strip PNG8:slip7.png
$ neper -V simulation.sim -step 4 -datanodecoo coo -datanodecoofact 10 -showelt1d all \
    -dataelt1drad 0.004 -dataelt3dedgerad 0.0015 -dataelt3dedgecol 32:32:32 -cameraangle \
    13.5 -imagesize 800:800 -dataeltcol slip8 -dataeltscale \
    -0.0006:-0.0004:-0.0002:0.0000:0.0002:0.0004:0.0006 -print img_slip8
$ convert "(" img_slip8.png -trim ")" "(" -size 40x1 xc:white ")" "(" -size 240x \
    -background white -font DejaVu-Serif -pointsize 30 "caption:Slip, system 8" \
    -bordercolor white -border 0x12 "(" img_slip8-scale3d.png -trim ")" -gravity west \
    -append ")" -background white -gravity center +append -bordercolor white -border 20 \
    -resize 600x600 -strip PNG8:slip8.png
$ python3 tutorial_pages.py plot restart . simulation.sim