LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] single function for specific pair style
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] single function for specific pair style

From: Huang <nongyanhuang@...223...>
Date: Fri, 18 Aug 2017 04:03:44 +0800 (CST)

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?
Does anyone have any idea about this question? Thank you in advance!