Get the velocity of a facetcyliner in one point

Asked by Felix Niewienda

Hi,

I try to get the velocity of a facetcylinder in any point I want. Right now I am useing the following commands:

zylinder=O.bodies.append(geom.facetCylinder((0.0,0.0,1.0),radius=2.0,height=2.0,segmentsNumber=20,wallMask=6,**kwMeshes))

O.engines=[

    ...

    PyRunner(iterPeriod = 1, command = 'func()', dead = False),
]

def func():
    global velocity
    velocity=O.bodies[0].state.vel

What I get is the velocity of the first facet of the cylinder, but I don't really know which point on the facet got this velocity.

What I would like to have is a way to get the velocity (or position or acceleration) at any point of the cyliner (or in the cyliner).

Has anyone an idea how this could work?

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello Felix,

facets are by default non-dynamic. Do you have in your script something to
move them (perhaps some kinematic engines)?

In such case, I would write a function, that would compute velocity (or any
other quantity) at given position from the attributes of those kinematic
engines.

Otherwise you could somehow interpolate between values from individual
facets, but I think that the previous approach I suggested would be both
easier and more accurate.

If I guessed your approach wrong, than I am sorry for spamming and would
ask you for more information :-)
cheers
Jan

2013/10/23 Felix Niewienda <email address hidden>

> New question #237895 on Yade:
> https://answers.launchpad.net/yade/+question/237895
>
> Hi,
>
> I try to get the velocity of a facetcylinder in any point I want. Right
> now I am useing the following commands:
>
>
> zylinder=O.bodies.append(geom.facetCylinder((0.0,0.0,1.0),radius=2.0,height=2.0,segmentsNumber=20,wallMask=6,**kwMeshes))
>
> O.engines=[
>
> ...
>
> PyRunner(iterPeriod = 1, command = 'func()', dead = False),
> ]
>
> def func():
> global velocity
> velocity=O.bodies[0].state.vel
>
> What I get is the velocity of the first facet of the cylinder, but I don't
> really know which point on the facet got this velocity.
>
> What I would like to have is a way to get the velocity (or position or
> acceleration) at any point of the cyliner (or in the cyliner).
>
> Has anyone an idea how this could work?
>
>
> --
> 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
>

Revision history for this message
Felix Niewienda (felix-niewienda) said :
#2

Hi Jan,

Than you for your fast answer. Your guess is completely right. If there is no way to meassure it directly I think this is the best solution.

Revision history for this message
Felix Niewienda (felix-niewienda) said :
#3

I am now useing 2 facets to interpolate a position in the middle of the cylinder. To get the position of the facets i use O.bodies.state.se3. Is the position given in this vector the centroid of the facet or which value is it providing?

Revision history for this message
Best Jérôme Duriez (jduriez) said :
#4

State.se3 is defined for any body, whatever its shape. So, I guess yes, the position part of se3 corresponds to the center, as it is the case e.g. for spheres. Someone more familiar than me with facet code (classes Facet, Ig2_Facet_Sphere_ScGeom, ...) would be more affirmative.

Revision history for this message
Felix Niewienda (felix-niewienda) said :
#5

Thanks jduriez, that solved my question.