""" Show basic wall functionality (infinite axis-aligned planes). """ from yade import utils O.materials.append( FrictMat(young=30e9, density=1000, poisson=.2, frictionAngle=.5)) O.bodies.append([ utils.wall(1, axis=2, sense=-1), utils.wall(-5, axis=0, sense=1), utils.wall(1, axis=1), utils.wall((1, 0, 0), 0), utils.sphere([0, 0, 0], .5), utils.sphere([-4, -4, -3], .5) ]) Gl1_Wall(div=10) from yade import qt qt.Controller() qt.View() O.engines = [ ForceResetter(), InsertionSortCollider( [Bo1_Sphere_Aabb(), Bo1_Facet_Aabb(), Bo1_Wall_Aabb()]), InteractionLoop( [ Ig2_Sphere_Sphere_ScGeom(),
nodesIds.append( O.bodies.append(gridNode([4,0,0],r,wire=False,fixed=fixed,material='gridNodeMat',color=color)) ) nodesIds.append( O.bodies.append(gridNode([5,0,0],r,wire=False,fixed=fixed,material='gridNodeMat',color=color)) ) vertex=Vector3(4.5,1,0) cylIds.append(O.bodies.append( gridConnection(nodesIds[3],nodesIds[4],r,color=color) ) ) pfacetCreator2(nodesIds[3],nodesIds[4],vertex,r,nodesIds=nodesIds,wire=True,materialNodes='gridNodeMat',material='gridConnectionMat',color=color,fixed=fixed) ################################## ###### pfacetCreator3 ### ################################## ## Option 4: pfacetCreator3(id1,id2,id3) -> based on 3 nodes a = O.bodies.append(gridNode([6,0,0],r,wire=False,fixed=fixed,material='gridNodeMat',color=color)) b = O.bodies.append(gridNode([7,0,0],r,wire=False,fixed=fixed,material='gridNodeMat',color=color)) c = O.bodies.append(gridNode([6.5,1,0],r,wire=False,fixed=fixed,material='gridNodeMat',color=color)) pfacetCreator3(a,b,c,cylIds=[],pfIds=[],wire=False,material=-1,Ecyl=None,color=color) ##################### ##### Wall ### ##################### ## Plate=utils.wall(position=-1,sense=0, axis=1,color=Vector3(1,0,0),material='gridConnectionMat') O.bodies.append(Plate) O.dt = 0.01*PWaveTimeStep() O.saveTmp()
""" Show basic wall functionality (infinite axis-aligned planes). """ from yade import utils O.materials.append(FrictMat(young=30e9,density=1000,poisson=.2,frictionAngle=.5) O.bodies.append([ utils.wall(1,axis=2,sense=-1), utils.wall(-5,axis=0,sense=1), utils.wall(1,axis=1), utils.wall((1,0,0),0), utils.sphere([0,0,0],.5), utils.sphere([-5,-4,-3],.5) ]) Gl1_Wall(div=10) from yade import qt qt.Controller() qt.View() O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_Dem3DofGeom(),Ig2_Facet_Sphere_Dem3DofGeom(),Ig2_Wall_Sphere_Dem3DofGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_Dem3DofGeom_FrictPhys_CundallStrack()], ), GravityEngine(gravity=[1e2,1e2,1e2]), NewtonIntegrator(damping=0.01), ]
O.bodies.erase(i) for i in range(1,38,4): O.bodies.erase(i) predicate=inCylinder(centerBottom=Vector3(0,0,0), centerTop=Vector3(0,0,L+L/2.), radius=l-0.005) sp=SpherePack() sp=pack.randomDensePack(predicate, radius=radius, material='Smat', cropLayers=10, rRelFuzz=0.0, spheresInCell=100,returnSpherePack=True) sp.toSimulation() ######################## #### WALL GENERATION ## ######################## O.materials.append(FrictMat(young=E,poisson=poisson,density=density,frictionAngle=frictionAngleW,label='Wmat')) topPlate=utils.wall(position=hMax(2)+radius*10,sense=0, axis=2,color=Vector3(1,0,0),material='Wmat') O.bodies.append(topPlate) bottomPlate=utils.wall(position=0,sense=0, axis=2,color=Vector3(1,0,0),material='Wmat') O.bodies.append(bottomPlate) ###################### #### MOVE TOP WALL ## ###################### v=1.7e-03 def movewall(v): topPlate.state.pos=Vector3(0,0,hMax(2)+radius) topPlate.state.vel=Vector3(0,0,-v) def dataCollector(): S=pi*l**2
predicate=inAlignedBox(Vector3(-0.001,-0.001,zmax),Vector3(xy+r_s,xy+r_s,zmax+2*r)) sp=SpherePack() sp=pack.regularHexa(predicate, radius=r_s, gap=0.001*0.10,**kw) O.bodies.append(sp) #predicate=inAlignedBox(Vector3(-0.001,-0.001,zmin),Vector3(xy+r_s,xy+r_s,zmean-2*r)) #sp=SpherePack() #sp=pack.regularHexa(predicate, radius=r_s, gap=0.001*0.10,**kw) #O.bodies.append(sp) Gl1_Sphere.stripes=True topPlate=utils.wall(position=hMaxS(2)+r_s,sense=0, axis=2,color=Vector3(1,0,0),material='sphereMat') O.bodies.append(topPlate) top_boundary=[] top_boundary_m1=[] bottom_boundary=[] O.dt=0.2*PWaveTimeStep() for i in range(10,221,21): top_boundary.append(i) for i in range(0,221,21): bottom_boundary.append(i)
pfIds.append(O.bodies.append(pfacet(nodesIds[i*nbl+j],nodesIds[(i+1)*nbl+j+1],nodesIds[(i)*nbl+j+1],color=color,mask=5))) else: pfIds.append(O.bodies.append(pfacet(nodesIds[i*nbl+j],nodesIds[(i+1)*nbl+j],nodesIds[(i)*nbl+j+1],color=color,mask=5))) pfIds.append(O.bodies.append(pfacet(nodesIds[i*nbl+j+1],nodesIds[(i+1)*nbl+j],nodesIds[(i+1)*nbl+j+1],color=color,mask=5))) for i in range(0,nbL,1): j=nbl pfIds.append(O.bodies.append(pfacet( nodesIds[i*nbl+j],nodesIds[(i-1)*nbl+j],nodesIds[(i+1)*nbl+j-1],color=color ))) pfIds.append(O.bodies.append(pfacet( nodesIds[(i)*nbl+j-1],nodesIds[(i+1)*nbl+j-1],nodesIds[(i-1)*nbl+j],color=color ))) ######################## #### WALL GENERATION ## ######################## topPlate=utils.wall(position=L+L/20.+radius,sense=0, axis=2,color=Vector3(1,0,0)) O.bodies.append(topPlate) bottomPlate=utils.wall(position=-radius,sense=0, axis=2,color=Vector3(1,0,0)) O.bodies.append(bottomPlate) ################### #### APPLY LOAD ## ################### #### APPLY CONFINING PRESSURE def Apply_confiningpressure(): for i in pfIds: e0 =O.bodies[i].shape.node3.state.pos - O.bodies[i].shape.node1.state.pos e1 =O.bodies[i].shape.node2.state.pos - O.bodies[i].shape.node1.state.pos e2 =O.bodies[i].shape.node2.state.pos - O.bodies[i].shape.node3.state.pos
from yade import pack,log,timing,utils log.setLevel("SubdomainBalancer",log.INFO) #log.setLevel("BodyContainer",log.TRACE) utils.readParamsFromTable(noTableOk=True,num=12000) import yade.params.table sp=pack.SpherePack() sp.makeCloud((0,0,0),(1,1,1),.03*((12000./yade.params.table.num)**(1/3.)),.5) sp.toSimulation() O.bodies.append(utils.wall((0,0,0),axis=2)) O.bodies.append(utils.wall((0,0,0),axis=1)) #O.bodies.append(utils.wall((0,0,0),axis=0)) #O.bodies.append(utils.wall((0,2,0),axis=1)) #O.bodies.append(utils.wall((2,0,0),axis=0)) O.engines=([SubdomainBalancer(axesOrder='xyz',colorize=True)] if 'SubdomainBalancer' in dir() else [])+[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()],verletDist=.05*.05), InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]), NewtonIntegrator(gravity=(0,0,-10)), #PyRunner(iterPeriod=5000,command='O.pause(); timing.stats();') ] O.dt=utils.PWaveTimeStep() O.timingEnabled=True #O.step(); #O.run(10000,True) timing.stats() from yade import qt qt.View() #O.step() #O.run(5000,True)
from yade import pack,timing,utils utils.readParamsFromTable(noTableOk=True,num=12000) import yade.params.table sp=pack.SpherePack() sp.makeCloud((0,0,0),(1,1,1),.03*((12000./yade.params.table.num)**(1/3.)),.5) sp.toSimulation() O.bodies.append(utils.wall((0,0,0),axis=2)) O.bodies.append(utils.wall((0,0,0),axis=1)) #O.bodies.append(utils.wall((0,0,0),axis=0)) #O.bodies.append(utils.wall((0,2,0),axis=1)) #O.bodies.append(utils.wall((2,0,0),axis=0)) O.engines=([SubdomainBalancer(axesOrder='xyz',colorize=True)] if 'SubdomainBalancer' in dir() else [])+[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()],verletDist=.05*.05), InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]), NewtonIntegrator(gravity=(0,0,-10)), #PyRunner(iterPeriod=5000,command='O.pause(); timing.stats();') ] O.dt=utils.PWaveTimeStep() O.timingEnabled=True #O.step(); #O.run(10000,True) timing.stats() from yade import qt qt.View() #O.step() #O.run(5000,True)
@title:Configuration-Container """ from yade import geom, utils from configuration_material import m_wall #building boxes ----- box_length = 800.0 box_height = 100.0 box_depth = 5 #wallMask #determines which walls will be created, in the order #-x(1), +x (2), -y (4), +y (8), -z (16), +z (32). The numbers are ANDed; the #default 63 means to create all walls #parameter1:center #parameter2:size box = geom.facetBox((box_length / 2, box_height / 2, 0), (box_length / 2, box_height / 2, box_depth / 2), wallMask=0, material=m_wall) #push plane wall_right = utils.wall(box_length, axis=0, material=m_wall) wall_left = utils.wall(0, axis=0, material=m_wall) wall_bottom = utils.wall(0, axis=1, material=m_wall) O.bodies.append(wall_right) O.bodies.append(wall_left) O.bodies.append(wall_bottom)
sp=yade._packSpheres.SpherePack() sp.load('fichier.txt') sp.toSimulation() ## MEMBRANE ## zmax=hMaxSpheres(2) r_c=r_c+4*r_scyl m=mem(r_c, n,zmin-0*r_scyl, zmax+0*r_scyl,hexa,membrane,mask) m_id=O.bodies.append(m) n_sp=len(m_id) Min_Max=MinMax() ## TOP AND BOTTOM WALLS ## top=O.bodies.append(utils.wall(position=(0,0,zmax+Min_Max[1]), axis=2,material=wallmat,mask=8)) bottom=O.bodies.append(utils.wall(position=(0,0,zmin-Min_Max[1]), axis=2, material=wallmat,mask=8)) ##################### ## FUNCTIONS ## ##################### def shearVel(n): O.bodies[top].state.vel[2]=-n O.bodies[bottom].state.vel[2]=n ######################## ## ENGINE DEFINITION ## ######################## O.dt=PWaveTimeStep() O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius,label='aabb'),Bo1_Wall_Aabb()]),