[lammps-users] Do calculations with atom vectors

Hello LAMMPS users,

I have a question regarding the processing of per atom properties. Is it possible to create variables that are atom vectors and that contain mathematically manipulated data? For example, I would like to calculate the euclidean norm for each row of a matrix consisting of the column vectors sigma11, sigma22 and sigma33. The only command close to this task is reduce and it’ll give me scalar values which I obviously don’t want.

Is there a possibility to do this within LAMMPS?

Just for clarification I’ve added a piece of code how I’ve imagined it to work:

compute sigma all stress/atom
variable sigma_mean equal “sqrt(sigma[][1]^2 + sigma[][2]^2 + sigma[][3]^2)”
dump atoms all cfg 1000 ${simname}.*.cfg id type xs ys zs v_sigma

Thanks in advance for your help!

Best regards,
Patrick

Use an atom style variable instead on an equal style variable,
and you can do that.

Steve