Can we define an array variable in LAMMPS?

Hi all

For a calculation I need to define an indexed variable A[i] (array/vector in C) in LAMMPS, but I do not know how to define such a variable. Is there such a possibility in LAMMPS or trick to do something similar?

I want to do something like below with an array for XP[10], but it can not accept an array in the superficial way that I do.

label loop_chains
variable M loop 1 10
variable XP_M equal 0 label loop\_xp variable n loop 1 100 variable m equal \({M}-1)*100+n variable xp equal x\[{m}]*($n-0.5)
variable XP_M equal {XP_M\}\+{xp}
next n
jump SELF loop_xp
next M
jump SELF loop_chains

I will be grateful if somebody has any suggestion about it.

Cheers
Sara

Hi all

For a calculation I need to define an indexed variable A[i]
(array/vector in C) in LAMMPS, but I do not know how to define such a
variable. Is there such a possibility in LAMMPS or trick to do
something similar?

no, there is no such thing. the script interpreter of LAMMPS is
minimalist and adapted to the most common needs.
what would be the benefit of having an array style variable? it is not
clear to me from the example you provide below.

axel.