yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #15263
Re: [Question #645973]: Triaxial Test on a cylinder
Question #645973 on Yade changed:
https://answers.launchpad.net/yade/+question/645973
Status: Open => Answered
Jan Stránský proposed the following answer:
you place/execute the snippet just after your commands :-)
#############
TriaxialTest(numberOfGrains=500).load()
O.run(1000,True) # True argument is important, prevent further commands to be executed before 1000 iterations are finished
from yade import pack
pred = pack.inCylinder((0.5,0.5,0),(0.5,0.5,1),.4) #[1]
cyl = [b for b in O.bodies if isinstance(b.shape,Sphere) and pred(b.state.pos,b.shape.radius)]
# predicate(center,radius) returns True if it contains the sphere(center,radius), False otherwise
# test
sphs = [(b.state.pos,b.shape.radius) for b in cyl]
O.reset()
O.bodies.append([sphere(pos,r) for pos,r in sphs])
#############
cheers
Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.