single function for specific pair style

Hi all,
Recently I’m trying to implement a new pair style in LAMMPS. I want to include this pair style in compute group/group. I searched in the mail lists of LAMMPS and knew that I need to write a routine named single() in my own pair style. I looked the codes of pair_lj_cut.cpp and several other pair styles, the structure for these single routines are the same:
single(int i, int j, int itype, int jtype, double rsq, double factor_coul, double,factor_lj,double &fforce).
But my pair style is a little bit more complicated because the potential is direction dependent, the potential form is E(x,y,z) instead of E®. So to calculate the energy, the structure of single function for my potential should be like follows:
single(int i, int j, int itype, int jtype, double delx, double dely, double delz, double factor_coul, double,factor_lj,double &fforce)

My question is, can I write the single function as above or it won’t work since I changed the structure of it?
Does anyone have any idea about this question? Thank you in advance!

Best,
Huang

Hi all,
Recently I'm trying to implement a new pair style in LAMMPS. I want to
include this pair style in compute group/group. I searched in the mail
lists of LAMMPS and knew that I need to write a routine named single() in
my own pair style. I looked the codes of pair_lj_cut.cpp and several other
pair styles, the structure for these single routines are the same:
single(int i, int j, int itype, int jtype, double rsq, double factor_coul,
double,factor_lj,double &fforce).
But my pair style is a little bit more complicated because the potential
is direction dependent, the potential form is E(x,y,z) instead of E(r). So
to calculate the energy, the structure of single function for my potential
should be like follows:
single(int i, int j, int itype, int jtype,
*double delx, double dely, double delz*, double factor_coul,
double,factor_lj,double &fforce)

My question is, can I write the single function as above or it won't work
since I changed the structure of it?

​it won't work.​

axel.

Hi Axel,
I see. Thanks!

Best,
Huang

BTW: there is an alternative to using compute group/group and those are the computes in the USER-TALLY package.

…and compute group/group won’t work for many-body potentials regardless, so if you would have based your pair style on airebo, you’d have been at a dead end from the beginning.

axel.