diff --git a/doc/third-party/lammps-command.md b/doc/third-party/lammps-command.md index 023345d638..150d755795 100644 --- a/doc/third-party/lammps-command.md +++ b/doc/third-party/lammps-command.md @@ -82,6 +82,7 @@ Evaluate the interaction of the system by using [Deep Potential][DP] or [Deep Po This pair style takes the deep potential defined in a model file that usually has the .pb extension. The model can be trained and frozen by package [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit), which can have either double or single float precision interface. The model deviation evalulates the consistency of the force predictions from multiple models. By default, only the maximal, minimal and average model deviations are output. If the key `atomic` is set, then the model deviation of force prediction of each atom will be output. +The unit follows [LAMMPS units](#units) and the [scale factor](https://docs.lammps.org/pair_hybrid.html) is not applied. By default, the model deviation is output in absolute value. If the keyword `relative` is set, then the relative model deviation of the force will be output, including values output by the keyword `atomic`. The relative model deviation of the force on atom $i$ is defined by diff --git a/source/lmp/pair_deepmd.cpp b/source/lmp/pair_deepmd.cpp index 600c4cae29..645bb9fec9 100644 --- a/source/lmp/pair_deepmd.cpp +++ b/source/lmp/pair_deepmd.cpp @@ -767,12 +767,12 @@ void PairDeepMD::compute(int eflag, int vflag) { all_v_avg = sqrt(all_v_avg / 9); } if (rank == 0) { - all_v_max *= scale[1][1] * ener_unit_cvt_factor; - all_v_min *= scale[1][1] * ener_unit_cvt_factor; - all_v_avg *= scale[1][1] * ener_unit_cvt_factor; - all_f_max *= scale[1][1] * force_unit_cvt_factor; - all_f_min *= scale[1][1] * force_unit_cvt_factor; - all_f_avg *= scale[1][1] * force_unit_cvt_factor; + all_v_max *= ener_unit_cvt_factor; + all_v_min *= ener_unit_cvt_factor; + all_v_avg *= ener_unit_cvt_factor; + all_f_max *= force_unit_cvt_factor; + all_f_min *= force_unit_cvt_factor; + all_f_avg *= force_unit_cvt_factor; fp << setw(12) << update->ntimestep << " " << setw(18) << all_v_max << " " << setw(18) << all_v_min << " " << setw(18) << all_v_avg << " " << setw(18) << all_f_max << " " << setw(18) << all_f_min @@ -798,8 +798,7 @@ void PairDeepMD::compute(int eflag, int vflag) { displacements, MPI_DOUBLE, 0, world); if (rank == 0) { for (int dd = 0; dd < all_nlocal; ++dd) { - std_f_all[tagrecv[dd] - 1] = - stdfrecv[dd] * scale[1][1] * force_unit_cvt_factor; + std_f_all[tagrecv[dd] - 1] = stdfrecv[dd] * force_unit_cvt_factor; } for (int dd = 0; dd < all_nlocal; ++dd) { fp << " " << setw(18) << std_f_all[dd];