# Torque on a mesh body

Hi,

I need to calculate the forces and torques acting on a mesh body when it is contact with particles. I have already tried to use the ForceRecorder and TorqueRecorder, but somehow it shows always a zero value.
To calculate the forces I used then:

utils.sumForces(ids,(1,0,0))
utils.sumForces(ids,(0,1,0))
utils.sumForces(ids,(0,0,1))

and tested the result by summing the O.forces.f(i) for all i in the mesh. Same result!
I tried to the same for utils.sumTorques, but I cannot understand how this function should work. In the yade doc I found:

Sum forces and torques on bodies given in ids with respect to axis specified by a point axisPt and its direction axis."

Does it gives the value of force+torque??
I also printed hier the values O.forces.t(i) for all i in the mesh and considered the axisPt as (0,0,0) or as the centre of the mesh (this is a cylinder). For both tentatives I could not find the same value given by sumTorques.

Could someone explain me how the function utils.sumTorques works?

Thanks for the help!
Daniela

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2011-08-02
2011-08-14

Hi,

please, have a look at checkWeight.py , it uses sumForces. I hope
it will give you
some ideas, how it works.

Anton

> "yade._utils.sumTorques((list)ids, (Vector3)axis, (Vector3)axisPt) → float¶
>    Sum forces and torques on bodies given in ids with respect to axis specified by a point axisPt and its direction axis."
>
> Does it gives the value of force+torque??

It is a typo, fixed in r2903.

Anton

 Daniela (dmaionchi) said on 2011-08-02: #3

Hi Anton,

thanks for the tip. But I am not having problem with sumForces, I need to know how the sumTorques works. And if I use O.force.f(), what is the relation to sumTorques?

Regards, Daniela

I was wrong in the last message/commit. It was not a typo.

I think, the code explains better, than me .

Anton

On Tue, Aug 2, 2011 at 9:31 PM, Daniela
> Question #166741 on Yade changed:
>
>
> Daniela is still having a problem:
> Hi Anton,
>
> thanks for the tip. But I am not having problem with sumForces, I need
> to know how the sumTorques works. And if I use O.force.f(), what is the
> relation to sumTorques?
>
> Regards, Daniela
>
> --
> You received this question notification because you are a member of
>
> _______________________________________________
> Post to     : <email address hidden>
>

 Daniela (dmaionchi) said on 2011-08-02: #5

Hi Anton, thank again

what do you suggest, how should I then proceed? As I understand, I would just need a function that calculates

ret+=axis.dot(m));

Can I do this myself? Or is there another functions for that?