LAMMPS sandia: Help needed to understand the algorithm that LAMMPS uses to calculate the potential energy of the system.

Dear Sir,

Yes, and those values are the ones which are different from the ones given in the potential files for the same rij values.

Thanks
Best,

Ritesh

image.png

This cannot work in general since the feature you are using is only meaningful for pairwise additive potentials where the potential function only depends on the atom type. EAM is a manybody potential and uses data that depends on individual atom positions.

But even then, in the LAMMPS version that you are using, the EAM pair style is missing to account for the embedding term in the energy output of pair_write. this has been fixed later, but it won’t work sufficiently in your case, since the embedding term is only accessed for actual distance of the first to atoms in the system and not recomputed for the varying distances of the potential energy sweep of pair_write.

if you want to get the data you are looking for, you have to place the two atoms at the closest distance and then do an MD run with using fix move to create the different force and potential energy values and then use the thermo output of the “pe” property and dump out a trajectory of the positions and forces and compare those results to your theoretical calculations. this way the embedding contribution is properly recomputed in every step to the new distance.

axel.

image.png

Dear Sir,

I was calculating the pair potential values and that too for the first step only. So, I think on the basis of your explanation it should give the correct values for the rij at step 1. I checked the embedding function values at step one and it tallies out. I used the following EAM input potential:
https://www.ctcms.nist.gov/potentials/Download/2011–Bonny-G-Terentyev-D-Pasianot-R-C-et-al–Fe-Ni-Cr/1/FeNiCr.eam.alloy
https://www.ctcms.nist.gov/potentials/Download/2004–Zhou-X-W-Johnson-R-A-Wadley-H-N-G–Ag/4/Ag_Zhou04.eam.alloy
However, the potential values does not match. The pair potential values for different rij values are shown below:
FeNiCr: rij: 2.87056; the pair potential value given in the link above is -0.67706270538 and the pair potential using lammps was -0.235864327998718
Ag: rij: 2.00231874453966; the pair potential value given in the link above is 5.469505472345947 and the pair potential using lammps was 2.73158581133066
(I have formulated a python code and double checked those values in the paper).

Thanks
Best,

Ritesh.

image.png

I suspect you are misreading what is in the potential file. please carefully read the documentation for the eam pair styles which explain what is the data in the potential files for the different formats.

the eam pair style has been around in LAMMPS a very long time and is used a lot, so any mistakes in computing forces or energies in the compute() function would have been noticed a long time ago. also, any published data is usually well tested against (multiple if possible) codes.

so the explanation for any significant differences has to be either in your python code or in your understanding on what you are computing and looking at.

axel.

image.png