steel.Kn = 10*gravel.Kn steel.frictionAngle = 0.4 #rad rubber = PolyhedraMat() rubber.density = 1000 #kg/m^3 rubber.Ks = gravel.Ks/10 rubber.Kn = gravel.Kn/10 rubber.frictionAngle = 0.7 #rad O.bodies.append(polyhedra_utils.polyhedra(gravel,v=((0,0,-0.05),(0.3,0,-0.05),(0.3,0.3,-0.05),(0,0.3,-0.05),(0,0,0),(0.3,0,0),(0.3,0.3,0),(0,0.3,0)),fixed=True, color=(0.35,0.35,0.35))) #O.bodies.append(utils.wall(0,axis=1,sense=1, material = gravel)) #O.bodies.append(utils.wall(0,axis=0,sense=1, material = gravel)) #O.bodies.append(utils.wall(0.3,axis=1,sense=-1, material = gravel)) #O.bodies.append(utils.wall(0.3,axis=0,sense=-1, material = gravel)) polyhedra_utils.fillBox((0,0,0), (0.3,0.3,0.3),gravel,sizemin=[0.025,0.025,0.025],sizemax=[0.05,0.05,0.05],seed=4) def checkUnbalancedI(): print "iter %d, time elapsed %f, time step %.5e, unbalanced forces = %.5f"%(O.iter, O.realtime, O.dt, utils.unbalancedForce()) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]), InteractionLoop( [Ig2_Wall_Polyhedra_PolyhedraGeom(), Ig2_Polyhedra_Polyhedra_PolyhedraGeom(), Ig2_Facet_Polyhedra_PolyhedraGeom()], [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], # collision "physics" [PolyhedraVolumetricLaw()] # contact law -- apply forces ), #GravityEngine(gravity=(0,0,-9.81)), NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)), PyRunner(command='checkUnbalancedI()',realPeriod=5,label='checker')
O.bodies.append( polyhedra_utils.polyhedra(gravel, v=((0, 0, -0.05), (0.3, 0, -0.05), (0.3, 0.3, -0.05), (0, 0.3, -0.05), (0, 0, 0), (0.3, 0, 0), (0.3, 0.3, 0), (0, 0.3, 0)), fixed=True, color=(0.35, 0.35, 0.35))) #O.bodies.append(utils.wall(0,axis=1,sense=1, material = gravel)) #O.bodies.append(utils.wall(0,axis=0,sense=1, material = gravel)) #O.bodies.append(utils.wall(0.3,axis=1,sense=-1, material = gravel)) #O.bodies.append(utils.wall(0.3,axis=0,sense=-1, material = gravel)) polyhedra_utils.fillBox((0, 0, 0), (0.3, 0.3, 0.3), gravel, sizemin=[0.025, 0.025, 0.025], sizemax=[0.05, 0.05, 0.05], seed=4) def checkUnbalancedI(): print "iter %d, time elapsed %f, time step %.5e, unbalanced forces = %.5f" % ( O.iter, O.realtime, O.dt, utils.unbalancedForce()) O.engines = [ ForceResetter(), InsertionSortCollider( [Bo1_Polyhedra_Aabb(), Bo1_Wall_Aabb(), Bo1_Facet_Aabb()]),
from yade import polyhedra_utils,export polyhedra_utils.fillBox((0,0,0), (0.3,0.3,0.3),defaultMaterial(),sizemin=(0.025,0.025,0.025),sizemax=(0.05,0.05,0.05),seed=4) export.textPolyhedra('/tmp/textPolyhedra.txt')
O.bodies.append( utils.facet(((0.0, 0.0, 0.6), (0.57, 0.0, 0.6), (0.57, 0.57, 0.6)), dynamic=None, fixed=True, material=matF)) O.bodies.append( utils.facet(((0.0, 0.0, 0.6), (0.0, 0.57, 0.6), (0.57, 0.57, 0.6)), dynamic=None, fixed=True, material=matF)) ## add polyhedron ballast = polyhedra_utils.fillBox((0.17, 0.17, 0.6), (0.40, 0.40, 0.8), matP, sizemin=[0.026, 0.026, 0.026], sizemax=[0.038, 0.038, 0.038], ratio=[1, 1, 1], seed=4, mask=1) #O.bodies.append(wall((0,0,0),2)) O.engines = [ ForceResetter(), InsertionSortCollider( [Bo1_Polyhedra_Aabb(), Bo1_Wall_Aabb(), Bo1_Facet_Aabb()]), InteractionLoop( [ Ig2_Wall_Polyhedra_PolyhedraGeom(),
from yade import polyhedra_utils, export polyhedra_utils.fillBox((0, 0, 0), (0.3, 0.3, 0.3), defaultMaterial(), sizemin=(0.025, 0.025, 0.025), sizemax=(0.05, 0.05, 0.05), seed=4) export.textPolyhedra('/tmp/textPolyhedra.txt')