yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #13879
Re: [Question #406523]: Cylinders and law2_ScGeom_ViscElPhys_Basic
Question #406523 on Yade changed:
https://answers.launchpad.net/yade/+question/406523
Status: Open => Answered
Bruno Chareyre proposed the following answer:
A cause of the trouble is that the function cylinder(begin = (0,0,0),...) is by itself creating an interaction between the nodes 0 and 1.
It uses "createInteraction(id1,id2)", which in principle checks the available functors in the simulation to determine the type.
The problem is you create the cylinder before defining the functors, hence some default functors (FrictPhys) present at startup are used.
Before any iteration you get:
Yade [1]: i=O.interactions.nth(0)
Yade [2]: i.id1,i.id2
-> [2]: (0, 1)
Yade [3]: i.geom,i.phys
-> [3]: (<ScGeom instance at 0x3674a20>, <FrictPhys instance at 0x3db6f80>)
If you start your script with O.engines=[] (removing the default functors) the result is different. Now the problem is to create the initial interaction 0+1:
File "raphael.py", line 6, in <module>
cylinder(begin = (0,0,0),end =(0,10,0),radius = 1,fixed = True,color = (0,0,1),intMaterial = 'Mat',extMaterial = 'Mat')
File "/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/gridpfacet.py", line 167, in cylinder
cylIds.append(O.bodies.append( gridConnection(id1,id2,radius=radius,wire=wire,color=color,highlight=highlight,material=extMaterial,mask=mask,cellDist=None) ))
File "/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/gridpfacet.py", line 110, in gridConnection
i=createInteraction(id1,id2)
RuntimeError: No IGeomDispatcher in engines or inside InteractionLoop.
If you define the cylinder after the engines it seems to work as expected (not quite sure what happens with the damping though, you'll need to check), and there is no need to include Ig2_GridNode_GridNode_GridNodeGeom6D() since you don't care about none-node interactions for rigid cylinders.
Try the script below and let me know if it is still strange.
Cheers
Bruno
from yade.gridpfacet import *
O.materials.append(ViscElMat(en=0.5, et=0., young=1e7, poisson=0.5, density=2500, frictionAngle=0.4, label='Mat'))
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_GridConnection_Aabb(),]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Sphere_GridConnection_ScGridCoGeom()],
[Ip2_ViscElMat_ViscElMat_ViscElPhys()],
[Law2_ScGeom_ViscElPhys_Basic()],
),
NewtonIntegrator(damping=0., gravity = (0,0,-9.81))
]
cylinder(begin = (0,0,0),end =(0,10,0),radius = 1,fixed = True,color = (0,0,1),intMaterial = 'Mat',extMaterial = 'Mat')
O.bodies.append(sphere(center = (0,5,5),radius = 1,material = 'Mat'))
O.dt = 1e-6
--
You received this question notification because your team yade-users is
an answer contact for Yade.