Torque on a mesh body

Asked by Daniela on 2011-08-02

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:

"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??
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:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2011-08-02
Last reply:
2011-08-14
Anton Gladky (gladky-anton) said : #1

Hi,

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

[1] http://bazaar.launchpad.net/~yade-dev/yade/trunk/view/head:/scripts/test/checks/checkWeight.py

Anton

Anton Gladky (gladky-anton) said : #2

> "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 : #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

Anton Gladky (gladky-anton) said : #4

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

I think, the code explains better, than me [1].

[1] http://bazaar.launchpad.net/~yade-dev/yade/trunk/view/head:/py/_utils.cpp#L195

Anton

On Tue, Aug 2, 2011 at 9:31 PM, Daniela
<email address hidden> wrote:
> Question #166741 on Yade changed:
> https://answers.launchpad.net/yade/+question/166741
>
>    Status: Answered => Open
>
> 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
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Daniela (dmaionchi) said : #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));

instead of ret+=axis.dot(m+r.cross(f));

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

Thanks in advance, Daniela

Anton Gladky (gladky-anton) said : #6

As you want, you can do it yourself in python-script.

Can you help with this problem?

Provide an answer of your own, or ask Daniela for more information if necessary.

To post a message you must log in.