DOFs of facetSphere

Asked by Huihuang Xia on 2017-07-15

Hi,

I intend to move a facetSphere and get its velocity when it interacts with other elements in my simulation. But to my disappointment, its velocity keeps constant.

I have tried to read its source code, and got that facetSphere have a default -- fixed=True. Consequently, I modify this 'fixed=True' to 'fixed=False', but the facetSphere disappears.

Besides, I have also tried another method. As facetSphere is fixed, its blockedDOFs = 'xyzXYZ' . Thus, I try to modify this one to "blockedDOFs = 'xzXZ'" (because I intend to get the velocity of facetSphere in y axis). But the facetSphere also disappears in my simulation.

Can you give me a hint or solution?

Thanks in advance,
Huihuang

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
2017-07-17
Last query:
2017-07-17
Last reply:
2017-07-16
Best Jan Stránský (honzik) said : #1

Hello Huihuang,
facets have zero mass and inertia by default. It does not matter if they are fixed, but once you let them move, you have zero division in acceleratio=force/mass
have a try this script (also note appendClumped, which I suppose is what you want)
#####
s = sphere((0,3,0),1)
O.bodies.append(s)
facets = geom.facetSphere((0,0,0),1,fixed=False)
for f in facets:
   f.state.mass = 1
   f.state.inertia = (1,1,1)
cid,ids = O.bodies.appendClumped(facets)
fs = O.bodies[cid]
fs.state.mass = s.state.mass
#
fs.state.blockedDOFs = 'xzXYZ'
fs.state.vel = (0,1,0)
#
O.engines = [
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Facet_Sphere_ScGeom()],
      [Ip2_FrictMat_FrictMat_FrictPhys()],
      [Law2_ScGeom_FrictPhys_CundallStrack()],
   ),
   NewtonIntegrator()
]
O.dt = 1e-5
#####

cheers
Jan

Huihuang Xia (huihuangxia) said : #2

Thanks Jan Stránský, that solved my question.