Is it poosible to define a variable equal to unwrapped coordinates of an atom? Something along the lines- “variable x1 equal xu”?
Details(Please skip if unnecessary): Lets say that I have 100 particles in a certain section, with some external field. My problem is that I need to run Langevin dynamics sumulation only until x coordinates of the bunch of particles cross the section. Currently I add following to my input script to do this-
variable i loop 10
variable x1 equal x # coordinates of first atom
variable x2 equal x # coordinates of last atom
if ‘$x1 < -1’ then ‘jump infile break1’ # section is -1<x<1
if ‘$x2 > 1’ then ‘jump infile break1’
run 1000 pre no post no
jump infile loopa
This mostly works welll, but since I need to use periodic boundary conditions, sometimes first atom crosses the right boundary before last atom crosses the section. Since its image enters from the left, the first “if” condition is satisfied and the loop breaks prematurely. Can I define unwrapped coordinates in some way instead, to overcome this problem?