示例#1
0
def wallMat():
    return JCFpmMat(type=0,
                    density=DENS,
                    young=YOUNG,
                    frictionAngle=radians(0))


### walls
mn, mx = Vector3(xinf + 0.1 * Rmean, yinf + 0.1 * Rmean,
                 zinf + 0.1 * Rmean), Vector3(xsup - 0.1 * Rmean,
                                              ysup - 0.1 * Rmean,
                                              zsup - 0.1 * Rmean)

walls = utils.aabbWalls(oversizeFactor=1.5,
                        extrema=(mn, mx),
                        thickness=0.1 * min(X, Y, Z),
                        material=wallMat)
wallIds = O.bodies.append(walls)

### packing
O.bodies.append(ymport.text(PACK + '.spheres', material=sphereMat))

### DFN
O.bodies.append(
    ymport.stl(DFN + '.stl',
               color=(0.9, 0.9, 0.9),
               wire=False,
               material=wallMat))
execfile('identifyInitialFractures.py')

### to reduce initial crack extent: penny crack in the (Y,Z) plane, centre at Yc=0.5 and Zc=0.5, radius 0.1
示例#2
0
Ns=90
sp=pack.SpherePack()

#cohesive spheres crash because sphere-cylnder functor geneteragets ScGeom3D
#O.materials.append(CohFrictMat(young=1.0e5,poisson=0.03,density=2.60e2,frictionAngle=frictionAngle,label='spheremat'))

if os.path.exists("cloud4cylinders"+`Ns`):
 	print "loading spheres from file"
	sp.load("cloud4cylinders"+`Ns`)
else:
 	print "generating spheres"
 	Ns=sp.makeCloud(Vector3(-0.3,0.2,-1.0),Vector3(+0.3,+0.5,+1.0),-1,.2,Ns,False,0.8)
	sp.save("cloud4cylinders"+`Ns`)

O.bodies.append([utils.sphere(center,rad,material='spheremat') for center,rad in sp])
walls=utils.aabbWalls((Vector3(-0.3,-0.15,-1),Vector3(+0.3,+1.0,+1)),thickness=.1,material='walllmat')
wallIds=O.bodies.append(walls)

O.initializers=[
	BoundDispatcher([Bo1_Sphere_Aabb(),Bo1_ChainedCylinder_Aabb(),Bo1_Box_Aabb()])
]

O.engines=[
	ForceResetter(),
	InsertionSortCollider([
		Bo1_ChainedCylinder_Aabb(),
		Bo1_Sphere_Aabb(),
		Bo1_Box_Aabb()
	]),
	InteractionLoop(
		[Ig2_ChainedCylinder_ChainedCylinder_ScGeom6D(), Ig2_Sphere_ChainedCylinder_CylScGeom(), Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],			
hminy0 = hMin(1)
hmaxy0 = hMax(1)

hminz0 = hMin(2)
hmaxz0 = hMax(2)
r_s=2*r
xy=hmaxx0

zmin=-(r+2*r_s)
zmax=r+2*r_s
zmean=(zmax+zmin)*0.5

O.materials.append(FrictMat(young=5e6,poisson=0.3,density=2650,frictionAngle=radians(20),label='sphereMat'))

walls=utils.aabbWalls((Vector3(-0.001,-0.001,zmin),Vector3(hmaxx0,hmaxx0,zmax)),thickness=2.*r,oversizeFactor=1.,material='sphereMat')
wallIds=O.bodies.append(walls)
O.bodies.erase(walls[5].id)

startxyz=Vector3(-0.001,-0.001,0)

color=Vector3(0.9,0.9,0.9)
kw={'color':[0.8,0.8,0.8],'wire':False,'dynamic':True,'material':'sphereMat'}


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)

#cohesive spheres crash because sphere-cylnder functor geneteragets ScGeom3D
#O.materials.append(CohFrictMat(young=1.0e5,poisson=0.03,density=2.60e2,frictionAngle=frictionAngle,label='spheremat'))

if os.path.exists("cloud4cylinders" + ` Ns `):
    print "loading spheres from file"
    sp.load("cloud4cylinders" + ` Ns `)
else:
    print "generating spheres"
    Ns = sp.makeCloud(Vector3(-0.3, 0.2, -1.0), Vector3(+0.3, +0.5, +1.0), -1,
                      .2, Ns, False, 0.8)
    sp.save("cloud4cylinders" + ` Ns `)

O.bodies.append(
    [utils.sphere(center, rad, material='spheremat') for center, rad in sp])
walls = utils.aabbWalls((Vector3(-0.3, -0.15, -1), Vector3(+0.3, +1.0, +1)),
                        thickness=.1,
                        material='walllmat')
wallIds = O.bodies.append(walls)

O.initializers = [
    BoundDispatcher(
        [Bo1_Sphere_Aabb(),
         Bo1_ChainedCylinder_Aabb(),
         Bo1_Box_Aabb()])
]

O.engines = [
    ForceResetter(),
    InsertionSortCollider(
        [Bo1_ChainedCylinder_Aabb(),
         Bo1_Sphere_Aabb(),