[lammps-users] Question about the index variable

Hi,

I have a problem about the index style in the variable command. From the tutorial, each time a next command is used with this index variable name, the next string is assigned. However, I assigned “variable num index _1 _2”, but lammps replaced the ${num} twice with the string “_1”.

you need to use next command.
next num (look in manual for syntax to double check)

You didn't use the next command, so the variable
will remain "_1" until you do.

Steve