STRESS/ATOM & COMPUTE REDUCE

Submitted by govind on Mon, 09/11/2017 - 06:30

Hi All,

In my work I have to do stress analysis for particles in domain(there is no stl file). With stress/atom and compute reduce I have some doubts, however I have gone through previous discussions on stress analysis. stress/atom generates a vector and we can access its elements like c_stress[1] to c_stress[6]. Now as explained in user document :

compute stress all stress/atom
compute p all reduce sum c_stress[1] c_stress[2] c_stress[3]
variable press equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)
thermo_style custom step ke vol press v_press

I have doubt with variable command because compute reduce sums up the vector elements into a scalar as I understand from the command. So why is variable like this? It can be :

compute stress all stress/atom
variable press equal -(c_stress[1]+c_stress[2]+c_stress[3])/(3*vol)
thermo_style custom step ke vol press v_press

And for compute stress/atom as explained in command description :

The tensor for each atom has 6 components and is stored as a 6-element vector in the following order: xx, yy, zz, xy, xz, yz. So it says that I can access stress components like c_stress[1] i.e. a scalar. But in output info:

This compute calculates a per-atom array with 6 columns, which can be accessed by indices 1-6 by any command that uses per-atom values from a compute as input.

compute stress/atom does generate vector or array?

With regards,
Govind