From 90726ca0888cd2eacfddaaa02aa8cfb1123a000b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Jan 2022 10:12:38 -0500 Subject: [PATCH] explain that the computed force in python pair is force/r same as in Pair:single() --- doc/src/Modify_pair.rst | 38 +++++++++++++++++++------------------- doc/src/pair_python.rst | 18 +++++++++--------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/src/Modify_pair.rst b/doc/src/Modify_pair.rst index 7263b8fd48..6913204504 100644 --- a/doc/src/Modify_pair.rst +++ b/doc/src/Modify_pair.rst @@ -12,24 +12,24 @@ includes some optional methods to enable its use with rRESPA. Here is a brief description of the class methods in pair.h: -+---------------------------------+-------------------------------------------------------------------+ -| compute | workhorse routine that computes pairwise interactions | -+---------------------------------+-------------------------------------------------------------------+ -| settings | reads the input script line with arguments you define | -+---------------------------------+-------------------------------------------------------------------+ -| coeff | set coefficients for one i,j type pair | -+---------------------------------+-------------------------------------------------------------------+ -| init_one | perform initialization for one i,j type pair | -+---------------------------------+-------------------------------------------------------------------+ -| init_style | initialization specific to this pair style | -+---------------------------------+-------------------------------------------------------------------+ -| write & read_restart | write/read i,j pair coeffs to restart files | -+---------------------------------+-------------------------------------------------------------------+ -| write & read_restart_settings | write/read global settings to restart files | -+---------------------------------+-------------------------------------------------------------------+ -| single | force and energy of a single pairwise interaction between 2 atoms | -+---------------------------------+-------------------------------------------------------------------+ -| compute_inner/middle/outer | versions of compute used by rRESPA | -+---------------------------------+-------------------------------------------------------------------+ ++---------------------------------+---------------------------------------------------------------------+ +| compute | workhorse routine that computes pairwise interactions | ++---------------------------------+---------------------------------------------------------------------+ +| settings | reads the input script line with arguments you define | ++---------------------------------+---------------------------------------------------------------------+ +| coeff | set coefficients for one i,j type pair | ++---------------------------------+---------------------------------------------------------------------+ +| init_one | perform initialization for one i,j type pair | ++---------------------------------+---------------------------------------------------------------------+ +| init_style | initialization specific to this pair style | ++---------------------------------+---------------------------------------------------------------------+ +| write & read_restart | write/read i,j pair coeffs to restart files | ++---------------------------------+---------------------------------------------------------------------+ +| write & read_restart_settings | write/read global settings to restart files | ++---------------------------------+---------------------------------------------------------------------+ +| single | force/r and energy of a single pairwise interaction between 2 atoms | ++---------------------------------+---------------------------------------------------------------------+ +| compute_inner/middle/outer | versions of compute used by rRESPA | ++---------------------------------+---------------------------------------------------------------------+ The inner/middle/outer routines are optional. diff --git a/doc/src/pair_python.rst b/doc/src/pair_python.rst index 3d087565be..35e07dbd11 100644 --- a/doc/src/pair_python.rst +++ b/doc/src/pair_python.rst @@ -126,11 +126,11 @@ and *compute_energy*, which both take 3 numerical arguments: * itype = the (numerical) type of the first atom * jtype = the (numerical) type of the second atom -This functions need to compute the force and the energy, respectively, -and use the result as return value. The functions need to use the -*pmap* dictionary to convert the LAMMPS atom type number to the symbolic -value of the internal potential parameter data structure. Following -the *LJCutMelt* example, here are the two functions: +This functions need to compute the (scaled) force and the energy, +respectively, and use the result as return value. The functions need +to use the *pmap* dictionary to convert the LAMMPS atom type number +to the symbolic value of the internal potential parameter data structure. +Following the *LJCutMelt* example, here are the two functions: .. code-block:: python @@ -154,10 +154,10 @@ the *LJCutMelt* example, here are the two functions: for consistency with the C++ pair styles in LAMMPS, the *compute_force* function follows the conventions of the Pair::single() - methods and does not return the full force, but the force scaled by - the distance between the two atoms, so this value only needs to be - multiplied by delta x, delta y, and delta z to conveniently obtain the - three components of the force vector between these two atoms. + methods and does not return the pairwise force directly, but the force + divided by the distance between the two atoms, so this value only needs + to be multiplied by delta x, delta y, and delta z to conveniently obtain + the three components of the force vector between these two atoms. ----------