thanks to the openKIM community I could finish my potential model.
I have verified that the forces, energies and particleEnergies are
correct by using LAMMPS. It produces exactly the same numbers as IMD,
so the values are correct.
But when I run the vc_forces_numer_deriv test provided at KCC I see
large deviations and the alpha at the end is of the order of 10^-3 and
not 10^-10 as expected. The forces that are computed differ considerably, e.g.:
Atom Type Dir Force_model Force_numer Force diff pred error weight stat
1 0 1 3.877238373442486E-01 -2.731087349161498E-01 6.60833E-01 5.55112E-17 1.22997E+15 FAIL
2 3.838638296887518E-01 -2.867688962737701E-01 6.70633E-01 1.66533E-16 1.29149E+15 FAIL
3 3.933035953364041E-01 -2.813365660120671E-01 6.74640E-01 2.03965E-12 1.37934E+11 FAIL
This is however not the case if I disable the embedding part of the potentials.
For pair potentials the test gives the expected results. When I enable the embedding part
it goes from alpha~10^-12 to 10^-3.
I guess that it might have something to do with the process_dEdr values.
Is there a way for me to check if I accounted for all contributions in this function?
The way I implemented this process_dEdr function is that after each force contribution I
also call the process_dEdr function with the value of the derivative. Do I have to take
care of something else?