If command

Hello
I have a question about "boolean expression of if command ", is it possible to use “atom-variable” in boolean expression?
I want to use x or y variable as “atom-variable” which specify the position of atoms in boolean expression but I encounter with “Substitution for illegal variable” error. This error appears even if I use a specific atom, like x[1].
How can I solve this error?

Thanks for your help

Hello
I have a question about "boolean expression of if command ", is it
possible to use "atom-variable" in boolean expression?

​no.​ it doesn't make sense. the if command is global and will have to be
executed equally in all processors, while atom style variables operate on
per-processor local data. such kind of if statement would be very
inefficient due to the massive amounts of communication involved.

I want to use x or y variable as "atom-variable" which specify the
position of atoms in boolean expression but I encounter with "Substitution
for illegal variable" error. This error appears even if I use a specific
atom, like x[1].
How can I solve this error?

​what do you need that if statement for?

you can include conditionals​ into your atom-style variable and they will
evaluate to either 1.0 or 0.0, so just multiplying with them will often
achieve the desired effect.

​axel.​