[lammps-users] compute stress/atom command

Dear Friends
I use following script to calculate PN and PT and in log file I want to see c_PRESS[1], but the following error is recived:

ERROR: Thermo compute ID does not compute vector info

region Reg block xi xf yhi ylo zhi zho
group slab region Reg
compute PRESS slab stress/atom
compute Pslab slab reduce sum c_PRESS[1] c_PRESS[4] c_PRESS[5]
variable PN equal c_Pslab[1]
variable PT equal (c_Pslab[4]^2+c_Pslab[5]^2)^0.5

Would you please help me?

Thanks

Saly

Have you done any “homework” on your own to find out where the problem is? For instance, try seeing what the manual says about the quantities the compute commands work with. . . .

–AEI

Dear Ahmed Ismael

Yes, I wrote a loop in my script that I sent to you some lines of it. I try to see all of the variables in my script and I knew that compute stress outputs are not calculated. As you see my script is the same as the example that it is in the manual but I don’t know the reason of the Error.

Would you please help me?

Regards

Saly

Dear Ahmed Ismael

In my simulation box there is some water with kspace style command. May be this is the reason of the error. But in this situation what should I do?

This is a separate issue. k-space contributions do not get incorporated into the stress/atom compounds, However, LAMMPS will not crash because of this—it will only give you a warning.

The issue that you’re using the wrong kind of variable—or making a reference to data that does not exist in a vector—is a completely separate one.

However, it should also be pointed out that you’re using a very strange definition for transverse pressure. I’ve never seen a pressure defined as a root-mean-square quantity using the off-diagonal components. (So what you’re doing doesn’t really seem to make a lot of sense from a physical perspective.)

–AEI

You didn't list your thermo_style command which is what
is generating the error.

Steve