Hi,
I'm trying to figure out how to extract the torque on a rigid body
group rbody type 3
fix 1 rbody rigid single
#variable torqx equal torque(rbody,x)
#variable torqy equal torque(rbody,y)
#variable torqz equal torque(rbody,z)
variable fcmx equal fcm(rbody,x)
variable fcmy equal fcm(rbody,y)
variable fcmz equal fcm(rbody,z)
#fix ex1 rbody print 500 "\{torqx\} {torqy} \{torqz\}" file torque\.dat
fix ex2 rbody print 500 "{fcmx} \{fcmy\} {fcmz}" file fcm.dat
This seems to be working OK to print out the forces on the center of mass. I thought I could use the commented lines to get the torque, but it doesn't work, I suppose because group.cpp doesn't compute the torque, only fix_rigid.cpp does that. So, either I need to 1) figure out how to get the torque computed in fix_rigid.cpp to be output by a fix print, or 2) I need to put the torque computation in the group.cpp so that I can print it out along with other group properties. Option 1 is easier, but I can't figure out how to do it, other than hacking in a printf command and recompiling... any help is appreciated!
And Happy New Year to all as well!
Cheers,
Chris.