yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #15520
Re: [Question #656538]: Measuring Force, Trapdoor displacement and Surface displacement
Question #656538 on Yade changed:
https://answers.launchpad.net/yade/+question/656538
Status: Open => Answered
Jan Stránský proposed the following answer:
Hello,
1,2,3)
to get force on one body, use
O.forces.f(id)
to get sum from several bodies, use
sum((O.forces.f(id) for id in ids), Vector3.Zero)
or
f = Vector3.Zero
for i in ids:
f += O.forces.f(i)
for the values of left, right and middle, you only have to pass correct ids of corresponding facets
in the specific code example:
middle: 0,1
left: 2,3
right: 4,5
4)
displacement at given time step:
trapdoor.state.displ()
where trapdoor is one of the facets of the "middle square" (e.g. O.bodies[0])
to record the values over time, you can use e.g. [1]
5)
you have access to the positions and orientations of each body and its vertices
##
for b in O.bodies:
if not isinstance(b.shape,Polyhedra): continue
pos = b.state.pos # center of polyhedron
ori = b.state.ori
vs = b.shape.v
vs = [pos + ori*v for v in vs] # vertices of polyhedron in global coordinate system
##
you can store the values at the start of simulation and compare it with state during simulation.
then it is up to your definition of surface displacement
cheers
Jan
[1] https://yade-dem.org/doc/user.html#tracking-variables
--
You received this question notification because your team yade-users is
an answer contact for Yade.