← Back to team overview

yade-users team mailing list archive

Re: [Question #688156]: How to create a regular prism in Yade

 

Question #688156 on Yade changed:
https://answers.launchpad.net/yade/+question/688156

Huang peilun posted a new comment:
Thank you, Jan!
That solved my problem.

I'll post what I have tried and why/how it went wrong. 
This time I just use
O.bodies.append(Cylinder(length=1, radius=1))
I didn't figure out what type does the Cylinder class have.

I want to make a penetration test, and I want a cylinder shaped rod to
do this.

Here's another question, I want to apply gravity to this cylinder and
have contact with spheres, what kind of IGeomFunctor and LawFunctor
should I use? Now the current script is as followed. The cylinder just
disappeared at the beginning of the simulation.

from yade import pack

O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))

rod=Body()
rod.shape=Cylinder()
rod.shape.length=.5
rod.shape.radius=.2
rod.state.pos=(.5,.5,1.8)
O.bodies.append(rod)

sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.05,rRelFuzz=.3)
sp.toSimulation()

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Cylinder_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Sphere_ChainedCylinder_CylScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_CylScGeom_FrictPhys_CundallStrack()]
	),
	# update position using Newton's equations
	NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
	# call the checkUnbalanced function (defined below) every 2 seconds
	PyRunner(command='checkUnbalanced()',realPeriod=2),
]
O.dt=.2*PWaveTimeStep()

def checkUnbalanced():
	if O.forces.f(rod.id)[2]==0: return
	ball.state.blockedDOFs='xyXYZ'
	ball.state.vel=(0,0,2)
	if unbalancedForce()<.05:
		O.pause()

O.saveTmp()

Thanks!

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.