How to do "if-then " statement every time step

Dear all LAMMPS users,

For example, I am simulating a polymer chain translocating through a channel.
I want to record how many time steps it takes to translocate.

So, for every time step, I calculate max(z) (channel starts at z=0, ends at z=10),
if max(z)>0, I record the current time step as i1;
I also calculate min(z) for every time step,
if min(z)>10, I record the time step as i2.

So the translocation time is i2-i1.

but in LAMMPS under the "run " command, it says that the “if then” statement doesn’t work ( On the explanation page of command “run”, right above “Restrictions”).

Does anybody know how to implement this in the input script?

Thanks!!

Aiqun Huang

Dear all LAMMPS users,

For example, I am simulating a polymer chain translocating through a
channel.
I want to record how many time steps it takes to translocate.

So, for every time step, I calculate max(z) (channel starts at z=0, ends at
z=10),
if max(z)>0, I record the current time step as i1;
I also calculate min(z) for every time step,
if min(z)>10, I record the time step as i2.

So the translocation time is i2-i1.

but in LAMMPS under the "run " command, it says that the "if then"
statement doesn't work ( On the explanation page of command "run", right
above "Restrictions").

Does anybody know how to implement this in the input script?

this is much better and easier done in post processing. you probably
only need to dump a few atoms of the polymer and won't have to do it
in every step. data is going to be noisy in any case, so having the
exact timestep is pretty much pointless anyway.

axel.