Error in generating elastic constants using openkim FF


I try to calculate elastic constants using the scripts that are given in the “ELASTIC” folder for the bcc cubic box. Since the box is orthogonal, it gives an error. I included tilted parameters by setting 0.0 0.000000000000 0.0 xy xz yz. I am using openkim MEAM potential “MEAM_LAMMPS_HuangLiuDuan_2021_HfNbTaTiZr__MO_893505888031_001” in my init.mod. When I run the program, it bypasses the tilt but gives this error:

Changing box ...
  triclinic box = (-0.042876648 -0.040868106 -0.080431537) to (19.129165 17.127175 16.166739) with tilt (0.0000000 0.0000000 0.0000000)
  triclinic box = (-0.042876648 -0.040868106 -0.080431537) to (19.129165 17.127175 16.166739) with tilt (0.0000000 0.0000000 0.0000000)
  triclinic box = (-0.042876648 -0.040868106 -0.080431537) to (19.129165 17.127175 16.166739) with tilt (0.0000000 0.0000000 0.0000000)
ERROR: Must re-specify non-restarted pair style (kim) after read_restart (src/force.cpp:177)
Last command: minimize ${etol} ${ftol} ${maxiter} ${maxeval}

Do you know why it is happening.

It is difficult to answer your question with specific details, since you didn’t provide enough information.
As the error message indicates, you are not correctly re-initializing the potential after a restart.
How to do that is mostly a question for the OpenKIM folks, but they will need to know more details as well.

2_ec_Tix0.2_SQS.rar (19.8 KB)

Hello Axel,

Thank you for your reply. I am uploading the input files so you can reproduce the error. kim initialization should be in potential.mod, but when I put those commands over there, it says it should be before the coordinate initialization. I don’t know where to put these init now.

Hi @Asif-Iqbal-Bhatti,

The example in the ELASTIC directory use writing and reading of restart files. This messes up with kim contrary to most other pair_style because it is apparently not stored in the restart file as the error states.

To solve your problem, assuming you did not change significantly the content and purpose of each files, you can add kim init *your model* before the read_restart restart.equil commands and kim interactions *your atoms* after the same lines in the displace.mod (there are 2 read_restart in the file). You should also add the kim init command before the create_box command in init.mod and kim interactions command after it. You can comment all the pair_style and pair_coeff lines in potential.mod. Also, be consistent with your units.

After those changes, I have similar results compared to the original example using OpenKIM SW model.

The problem is that “kim interactions” won’t work without a “kim init”. This is different from ‘normal’ LAMMPS pair styles.

For your specific model, this situation can be easily resolved. When looking at the log file, you can see that the kim commands are really just frontends that will then create multiple other LAMMPS commands.

If you replace the kim interactions command with the corresponding pair_style and pair_coeff commands that it will generate and put those into the potential.mod file, it should just work.


Thank you so much. I tried your approach, and it worked. It is better to use pair_style and pair_coeff in the potential.mod file once, and there is no need to specify anything in the init.mod.