I tried to find a solution on my own, but this particular error wasn’t listed in the LAMMPS documentation or anywhere else online.
(Version: lammps/stable_23Jun2022_update4)
kim init EAM_Dynamo_BelandTammMu_2017_FeNiCr__MO_715003088863_000 metal
atom_style atomic
boundary p p p
# Read initial structure
read_data FeNiCr.data
# Adjust neighbor settings
neighbor 2.0 bin
# Define interatomic potential
kim interactions Fe Ni Cr
# Define groups
group all type 1 2 3
# Perform a short MD run to relax the system
velocity all create 200.0 12345 mom yes rot yes dist gaussian
fix 1 all nve
run 1000
unfix 1
# Set minimization parameters
min_style cg
minimize 1.0e-4 1.0e-6 1000 10000
# Set temperature and run equilibration
velocity all create 300.0 12345 mom yes rot yes dist gaussian
fix 1 all npt temp 300.0 300.0 100 iso 0.0 0.0 1000.0
# Output settings for equilibration
thermo 100
thermo_style custom step temp pe ke etotal press vol
# Equilibration run
run 5000
# Unfix equilibration fix
unfix 1
# Apply small strain increments and calculate stress response
variable strain equal 0.001
# Loop over strain increments to apply strain and measure stress
variable i loop 10
label loop_strain
# Calculate new box dimensions for applying strain
variable stxx equal "lx*(1+v_strain)"
variable styy equal "ly*(1-v_strain/2)"
variable stzz equal "lz*(1-v_strain/2)"
change_box all x scale ${stxx} y scale ${styy} z scale ${stzz} remap
# Run after applying strain to equilibrate
run 1000
# Output settings for capturing stress data
thermo 100
thermo_style custom step temp press pxx pyy pzz lx ly lz
# Calculate stress tensor
compute stress all stress/atom
compute peratom all reduce sum c_stress[1] c_stress[2] c_stress[3]
# Capture stress data
thermo_style custom step temp c_peratom[1] c_peratom[2] c_peratom[3] pxx pyy pzz
# Final run to capture stress data
run 0
# Increment strain
next i
jump SELF loop_strain
# End of script
Running your input file with an up-to-date LAMMPS, KIM and model file version gave me no error. Note that I had to complete the (useless) partial data input you provided with random atoms in the box and perform minimization and also make some modification in the order of the commands. You should start with updating your softwares and check that everything, including your model file is properly, installed on your machine.
As there are several other incorrect commands in your input, such as the compute stress/atom which lacks an argument and the order in which commands are initialised in your loops which is inconsistent, you will still encounter other errors after doing so. I can’t tell you how to correct them since I don’t know the end goal of your simulation.
I know this code isn’t great. I’m working on a project in computational material science using LAMMPS, and it’s been challenging, but I’m making progress. Thank you for your time and assistance!.
@eriondi, I am not judging the quality of your code. As long as it runs and you know what is going on, it’s ok. I am trying to give you other insights on what you will encounter after correcting your KIM related issue.
LAMMPS is not that trivial to grasp and we all go through a lot of trials and errors. KIM is also a complex piece of software to master. Even with people ready to help, this is not something trivial to learn. But if you try to understand what the error messages mean and go look for how to solve them either in the documentation or the archive of this forum, you might eventually learn how to make it work according to your needs.
Hi @eriondi, my suspicion is that the EAM potential is ending up in a configuration where the electron density at an atomic site is out of the tabulated range. This is a difference in the KIM and LAMMPS EAM implementation – the KIM implementation refuses to extrapolate and raises an error.
This is why I imagine @Germain was not able to reproduce your error – because you did not provide a complete coordinate file, their configuration was different, so they, probably incidentally, just didn’t run into the same issue.
If I am correct, this is an indication of your simulation ending up in an unphysical configuration, or at least one that the potential was not designed to handle.
'm not sure if you were suggesting that I try a different EAM potential, but I did attempt that, and the error persists. Specifically, I tried using the EAM_Dynamo_MendelevBorovikov_2020_FeNiCr__MO_922363340570_000 model.
What @ilia_nikiforov suggested is to double check for your configuration as it is likely there are weird configuration of atoms.
The difference in implementation is related to the computation of the forces using either KIM or LAMMPS eam pair style. In the former, LAMMPS calls KIM to compute the forces, in the latter, it does on its own. If you want to compare the output of both implementations, you would have to download EAM input files provided by KIM, and use them with the eam pair_style of LAMMPS. See for example the bottom of the webpage of the related model.
BTW, I still advise on updating your code if possible. 23jun2022 starts to be an “old” version of LAMMPS.
Exactly, my suspicion (which I cannot confirm because I don’t have your complete input) is that your simulation is evolving to a point where the atoms are very dense somewhere, causing a high electron density term in the EAM functional form, which causes the KIM implementation of EAM to crash because the value of the density is out of range of the interpolation table provided by the EAM potential.
It is not surprising that multiple EAM potentials have the same issue, they probably have similar behaviors and interpolation tables because they are designed for the same material. While switching to the LAMMPS implementation of EAM, or trying a different type of potential from KIM like
MIGHT make your simulation run error-free, I would check your simulation carefully, because I am very suspicious that a correctly set-up simulation would evolve to a configuration that is out-of-range for the EAM potentials.
Which would mean that some atoms are very close, which in turn almost always means that there is a flaw in the initial geometries. LAMMPS allows this since it can sometimes happen with random atom insertions.
Otherwise, it would be a problem to compress the system to a density beyond what the potential has been parameterized for.
Thank you so much for going out of your way to help me—I truly appreciate it. I’ve now provided the data (which I should have done from the start). The data is generated randomly from a Python script for different percentages of Fe, Cr, and Ni. I thought I was already minimizing the system’s energy by finding the positions of particles with the least energy using the following commands:
velocity all create 200.0 12345 mom yes rot yes dist gaussian
fix 1 all nve
run 1000
unfix 1
However, it seems I was mistaken. I also realize I may be making errors with other aspects , like the size of the simulation box. It seems it would be more accurate if I based the size on the system’s density. Thanks again, everyone, for your assistance. Main.py (4.1 KB) FeCrNi.in (1.8 KB)