Dear,
I want to carry out the following function with LAMMPS’s commands:
if x> -2(an atom’s x coordinate) then y ++;
How can I do? I have code with lammps’s commands like this:
variable totaltime equal 1
variable xcoord atom x[1]
if {xcoord} > -2 then {totaltime} ={totaltime}+1 #or adding" {totaltime} =${totaltime}+1"
But It’s can’t do. if I code
variable a equal 1
if … then “print X is smaller = $a”
when it runs to if sentence, It gives
if … then “print X is smaller =$a”
print X is smaller = $a
print X is smaller = 1
then It give a error information meaning print synatax error. What’s the matter?
Thanks