[lammps-users] How to append number to index variable?

Hello,

I need to know , how to append number to index variable?
for example, in this case, I want to add 4 to this command:
variable A index 1 2 3
How can I do that?

Thanks

I don’t think that is possible.
What do you want to accomplish by this?

Dear Dr. Axel Kohlmeyer,
Thank you very much for your prompt reply.
I want to make a list of ID atoms and add the atoms that have a specific coordinate in each step to this list (step by step)
and use this list for the next part of the simulation.
do you have any suggestions?

best regards

Dear Dr. Axel Kohlmeyer,
Thank you very much for your prompt reply.
I want to make a list of ID atoms and add the atoms that have a specific coordinate in each step to this list (step by step)
and use this list for the next part of the simulation.
do you have any suggestions?

not sure. I’d probably handle this with multiple separate inputs and then run some custom script to parse the output and collected the information for the next run.

you might be able to work something out using
shell rm list.txt

then multiple times:

print “${val}” file list.txt append yes

to collect the list in a file. and finally use:

variable list file list.txt

to have that list in a variable that can be iterated over.

but this is just speculation. you’ll have to try and test it with some demo dummy example.

axel.

Dear Dr. Axel Kohlmeyer,
It was very nice of you to quickly read my email.
I really appreciate your clear and accurate guidance as well as your helpful comments on my work.

All the best