Hello,
I am using LAMMPS version dated 23 Jun 2022 to study a phosphate crystal (Na4Fe3P4O15) that comprises of sodium, iron, phosphorous, and oxygen atoms. I used the following commands to calculate the total pair potential energy of sodium atoms in two ways:
compute s sodium pe/atom pair
compute spe sodium reduce sum c_s
compute sod_all sodium group/group all pair yes kspace no
On outputting c_sod_all and c_spe, I was expecting c_sod_all to be twice c_spe, since in the former (compute group/group), the energy for each pair is accumulated while in the latter (compute pe/atom), for each pair, the energy for that pair is split in half and added to each atom participating (see: computre group/group vs pe/atom).
However, the output I am getting is as follows:
Step c_spe c_sod_oxy c_sod_e_oxy c_sod_all
360000 -12343.569 -214911.13 179884.75 -35026.38
where c_sod_all is quite far from 2*c_spe. I do not understand what I am doing wrong. Any help is appreciated. Please find my complete code below:
#Initialization
read_restart <restart.file>
Potential Parameters
pair_style hybrid/overlay coul/long 15 morse 15 lj/cut 15
pair_coeff * * coul/long
kspace_style pppm 1e-5
pair_coeff <list of pair coeffs>
Simulation Specifics
group sodium type 1:4
group iron type 5:7
group phos type 8:11
group oxy type 12:26
group excp_oxy type 1:11 # Except oxygen
Computes
compute s sodium pe/atom pair
compute spe sodium reduce sum c_s
compute sod_oxy sodium group/group oxy pair yes kspace no
compute sod_e_oxy sodium group/group excp_oxy pair yes kspace no
compute sod_all sodium group/group all pair yes kspace no
thermo 400
thermo_style custom step c_spe c_sod_oxy c_sod_e_oxy c_sod_all
rerun dump.data skip 1 dump x y z
~