Dear lammps users,

I shall use order parameter to analyze local crystal structure, but there is no lammps code to calculate it, and I don’t know how to write code.

My simulaion system contains two types of atoms(A and B), two vacuum layer located at both sides of the Y axis direction. The whole simulation box adopts periodic boundaries.

In my simulation system, an atom of type A (B) is surrounded by eight nearest neighbor atoms of type B (A). In this sense, there exits eight nearest neighbor distance for an atom. So I define d0 is the mean value of the former six smaller nearest neighbor distance, d1 is the mean value of the remaining two larger nearest neighbor distance. The definition of the order parameter(OP) follows

OP=[d0*(2.6068+2.8613)-d1*(2.6068+2.5102)]/[2.6068*(2.5102-2.8613)]

I want to get the OP value of each atom during my simulation process, so could you please help me write code to realize it, and tell me how to write lammps input commands?

Your kind help would be most appreciated.

Best wishes

Qin Shengjian