LAMMPS has the capability to restart the job from the binary file. According to the description from the official website, the command restart can write out a binary restart file with the current state of the simulation every certain timestep. This command has two modes: write the binary file or the data file. If you wish to use the data file, then a convert command is needed in this scenario. Here we do not consider the data file.
This LAMMPS script is a simple stretch of an iron nanowire. The orientation of the iron nanowire is [100](001)
. Due to the simple orientation, this nanowire is constructed in the LAMMPS script file. The dimension of the nanowire is 20c in the x-direction, 10c in the y-direction and 10c in the z-direction, c is the lattice constant which is set to 2.856 in the script. Note that this lattice constant is just copied from Wikipedia. If you want more accurate data of the lattice constant, you can find on this website. The pair potential is the EAM potential from the LAMMPS internal potential library.
First, the entire system is needed to minimize the energy to get the equilibrium and rescale to 300K use the random velocity distribution. Then, a uniform strain is applied to the nanowire in the x-direction. The strain rate is maintained at 1E12 to save simulation time. Before running the simulation, the command restart 200 tmp.restart is inserted into the script, that means every 200 steps, a restart file will be written to the filesystem. Thus, we can restart this simulation with this restart binary file.
1 |
|
After the simulation, get the restart file “tmp.restart.5000” and use the command read_restart
in the restart script.
Note that the following commands do not need to be repeated because their settings are included in the restart file: units, atom_style, special_bonds, pair_style, bond_style. However these commands do need to be used since their settings are not in the restart file: neighbor, fix, timestep.
Actually, the pair_style
and pair_coeff
commands are still needed in the restart file, otherwise, LAMMPS will report <Error: Atom sorting has bin size = 0.0>
. Here is the example of the restart file.
1 |
|
All source code is available upon request.