4
from yade import utils, plot, qt
13
tc = 0.01; en = 0.7; et = 0.7;
35
mat1 = O.materials.append(ViscElMat(frictionAngle=fr,density=rho, SPHmode=True, h=h, mu=mu,tc=tc, en=en, et=et, KernFunctionPressure = 1, KernFunctionVisco = 1))
36
idBox = pack.regularHexa(pack.inAlignedBox((0.0,-Rad*yCoeff,0.0),(X,Rad*yCoeff,Z)),radius=Rad,gap=0.0,color=(0,1,1), material=mat1, mask = 1, fixed=True)
41
for i in range(len(idBox)):
42
if (((idBox[i].state.pos[0])<yCoeff*Rad) or
43
((idBox[i].state.pos[0])>(X-yCoeff*Rad - 2.0*Rad)) or
44
((idBox[i].state.pos[2])<(yCoeff*Rad)) or
45
((idBox[i].state.pos[2])>(Z - 2.0*Rad))):
46
idBoxAdd.append(idBox[i])
47
elif (((idBox[i].state.pos[0])<SpheresX) and
48
((idBox[i].state.pos[2])<SpheresZ) and
49
((idBox[i].state.pos[1])>-Rad) and
50
((idBox[i].state.pos[1])<2.0*Rad)):
51
idBox[i].shape.color = Vector3(1,0,0)
52
idBox[i].state.fixed = False
53
idBox[i].state.blockedDOFs = 'y'
54
idSpheresAdd.append(idBox[i])
58
O.bodies.append(idBoxAdd)
59
idSpheres = O.bodies.append(idSpheresAdd)
65
InsertionSortCollider([Bo1_Sphere_Aabb(label='is2aabb')],ompThreads=1),
67
[Ig2_Sphere_Sphere_ScGeom(label='ss2sc')],
68
[Ip2_ViscElMat_ViscElMat_ViscElPhys()],
69
[Law2_ScGeom_ViscElPhys_Basic()],
71
NewtonIntegrator(damping=0.01,gravity=[0,0,-9.81]),
72
SPHEngine(mask=1, k=k, rho0 = rho, h=h, KernFunctionDensity= 1),
73
PyRunner(command='addPlotData()',iterPeriod=10,initRun=True,dead=False),
77
print "enlargeF = %g"%enlargeF
78
is2aabb.aabbEnlargeFactor = enlargeF
79
ss2sc.interactionDetectionFactor = enlargeF
82
# Function to add data to plot
84
plot.addData(t = O.time, eKin = utils.kineticEnergy())
86
plot.plots={'t':('eKin')};