About variable control




Hi all, I have a question about usage of variable in LAMMPS.









I define equal style variable A and B.



This variables will be evaluated when they are called by output command like thermo.



Next, I check the value in variable A during calculation, then this value is not satisfy some specified conditions.



Then I want to change the value in variable A to the value in variable B.



Is there any way to do this?








Best Regards


  Hi all, I have a question about usage of variable in LAMMPS.

I define equal style variable A and B.

This variables will be evaluated when they are called by output command
like thermo.

Next, I check the value in variable A during calculation, then this value
is not satisfy some specified conditions.

Then I want to change the value in variable A to the value in variable B.

Is there any way to do this?

you can emulate an inline if in your variable formula using logical
expressions like this (untested):

variable a equal (v_b<0.0)*v_this+(v_b>=0.0)*v_that

axel.