lammps code for order parameter

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

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.

Then you will have to learn it, or offer someone an adequate compensation for doing your work.

Axel

You could write a per-atom compute to calculate

this. There are several computes that look at local
neighborhoods of atoms - e.g. compute centro/atom.

Section_modify.html of the doc pages explains how
to write your own compute.

Steve