How to output the total torque?

Dear ALL,

I am using LAMMPS (23 Jun 2022).

I have a Single wall carbon nanotube, which I fixed one end and I am applying torque on the other end. I used

fix mysf2 CNT_top addtorque 0 0 50

to apply torque. I need the total torque to calculate the shear modulus. I an not sure how to out put the total torque. could you please help me with that?

Can use the torque(group,dim) variable: variable command — LAMMPS documentation.

Thank stamoor, but I am still confused how to it. I am already defining the value of torque 50 in z direction. how define a variable and how to calculate the total torque is still confusing for me. Could you please explain a little more?

Not tested but should be something like:

variable total_tx equal torque(all,x)
variable total_ty equal torque(all,y)
variable total_tz equal torque(all,z)

Then use fix print or something like that.

thanks a lot. I try it.