コード例 #1
0
ファイル: packs.py プロジェクト: wangxiaoliang2012/trunk
    bodiesHandling.spheresModify(
        hat, shift=(0.0, 0.0, 1.4), scale=0.7, orientation=oriBody,
        copy=True))  #Duplicate the "heart", shifting, scaling and rotating it

#change the color of upper part of the hat
for hatTmp in hat_upper:
    O.bodies[hatTmp].shape.color = (0.9, 0.5, 0.59)

#facetBunker Demonstration
#Demonstration of HarmonicMotionEngine
vibrationPlate = O.bodies.append(
    geom.facetBunker((-7.0, -7.0, -3.0),
                     dBunker=geometryParameters['extends'][0] * 1.1,
                     dOutput=3.0,
                     hBunker=11.0,
                     hOutput=1.5,
                     hPipe=0.8,
                     wallMask=5,
                     segmentsNumber=20,
                     **kwMeshes))

# spheresToFile saves coordinates and radii of all spheres of the simulation into the text file, works but disabled. Please, uncomment it, if you need
#print "Saved into the OutFile " + str (export.text("OutFile")) + " spheres";

# spheresFromFile function imports coordinates and radii of all spheres of the simulation into the text file
O.bodies.append(
    ymport.text('foo.spheres',
                shift=Vector3(6.0, 6.0, -2.9),
                scale=0.7,
                color=(1, 1, 1),
                **kw))
コード例 #2
0
ファイル: conveyor.py プロジェクト: HuanranWU/Yade
              tc=tc,
              en=en,
              et=es))

sp = pack.SpherePack()
sp.makeCloud((-0.3, 0.05, 0.05), (0.3, 0.7, 0.5), rMean=0.03, rRelFuzz=0.001)
particles = O.bodies.append([sphere(c, r, mask=3) for c, r in sp])

from yade import ymport
fctIds = O.bodies.append(
    ymport.gmsh('conveyor.mesh', scale=0.001, color=(1, 0, 0)))
voxIds = O.bodies.append(
    geom.facetBunker(center=[0, 1.5, -0.7],
                     dBunker=1.1,
                     dOutput=0.2,
                     hBunker=0.2,
                     hOutput=0.2,
                     hPipe=0.1,
                     mask=5))

for i in fctIds:
    O.bodies[i].state.vel = Vector3(0, 0.2, 0)  # Set conveyor velocity

## Timestep
O.dt = .2 * tc

## Engines
O.engines = [
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),
                           Bo1_Facet_Aabb()]),
コード例 #3
0
ファイル: packs.py プロジェクト: franckbourrier/trunk
	for i in v:
		O.bodies[int(i)].shape.color = Vector3(0,0,1)

#Example of bodiesHandling.spheresModify()
hat=O.bodies.append(pack.regularOrtho(pack.inCylinder((0,0,6),(0,0,7),20*rad),radius=0.2,gap=0,color=(1,0,0))) # hat
oriBody = Quaternion(Vector3(0,1,0),(math.pi/8))
hat_upper=O.bodies.append(bodiesHandling.spheresModify(hat,shift=(0.0,0.0,1.4),scale=0.7,orientation=oriBody,copy=True))		#Duplicate the "heart", shifting, scaling and rotating it

#change the color of upper part of the hat
for hatTmp in hat_upper:
	O.bodies[hatTmp].shape.color=(0.9,0.5,0.59)


#facetBunker Demonstration
#Demonstration of HarmonicMotionEngine
vibrationPlate = O.bodies.append(geom.facetBunker((-7.0,-7.0,-3.0),dBunker=geometryParameters['extends'][0]*1.1,dOutput=3.0,hBunker=11.0,hOutput=1.5,hPipe=0.8,wallMask=5,segmentsNumber=20,**kwMeshes))

# spheresToFile saves coordinates and radii of all spheres of the simulation into the text file, works but disabled. Please, uncomment it, if you need
#print "Saved into the OutFile " + str (export.text("OutFile")) + " spheres";

# spheresFromFile function imports coordinates and radii of all spheres of the simulation into the text file
O.bodies.append(ymport.text('foo.spheres',shift=Vector3(6.0,6.0,-2.9),scale=0.7,color=(1,1,1),**kw))

#Demonstration of HarmonicRotationEngine
O.bodies.append(pack.regularHexa(pack.inSphere((-15,5,-5),1.5),radius=rad*2.0,gap=rad/3.0,color=(0.5,0.5,0.1),material=0))
O.bodies.append(geom.facetBox((-15,5,-5),(2,2,2),wallMask=15,**kwMeshes))
vibrationRotationPlate = O.bodies.append(geom.facetBox((-15,5,-5),(2,2,2),wallMask=16,**kwBoxes))

O.bodies.append(utils.wall((0,0,-10),axis=2))

try:
コード例 #4
0
ファイル: clump-hopper-test.py プロジェクト: HuanranWU/Yade
x0t = x0 - at / 2.
y0t = y0 - at / 2.
x1t = x0 + at / 2.
y1t = y0 + at / 2.
zl = z0 - hl
x0l = x0 - al / 2.
y0l = y0 - al / 2.
x1l = x0 + al / 2.
y1l = y0 + al / 2.

vibrationPlate = O.bodies.append(
    geom.facetBunker((x0, y0, z0),
                     dBunker=ab * 4.0,
                     dOutput=ab * 1.7,
                     hBunker=ab * 3,
                     hOutput=ab,
                     hPipe=ab / 3.0,
                     wallMask=4,
                     segmentsNumber=10,
                     material=facetMat))

# Create engines
O.engines = [
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),
                           Bo1_Facet_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(),
         Ig2_Facet_Sphere_ScGeom()],
        [Ip2_ViscElMat_ViscElMat_ViscElPhys()],
        [Law2_ScGeom_ViscElPhys_Basic()],
コード例 #5
0
ファイル: clump-hopper-test.py プロジェクト: Haider-BA/trunk
y0t = y0 - at / 2.0
x1t = x0 + at / 2.0
y1t = y0 + at / 2.0
zl = z0 - hl
x0l = x0 - al / 2.0
y0l = y0 - al / 2.0
x1l = x0 + al / 2.0
y1l = y0 + al / 2.0

vibrationPlate = O.bodies.append(
    geom.facetBunker(
        (x0, y0, z0),
        dBunker=ab * 4.0,
        dOutput=ab * 1.7,
        hBunker=ab * 3,
        hOutput=ab,
        hPipe=ab / 3.0,
        wallMask=4,
        segmentsNumber=10,
        material=facetMat,
    )
)

# Create engines
O.engines = [
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
        [Ip2_ViscElMat_ViscElMat_ViscElPhys()],
        [Law2_ScGeom_ViscElPhys_Basic()],
コード例 #6
0
ファイル: clump-hopper-test.py プロジェクト: yade/trunk
dfltSpheresMat=O.materials.append(ViscElMat(density=density,frictionAngle=frictionAngle,tc=tc,en=en,et=es)) 

O.dt=.05*tc # time step

Rs=0.05 # particle radius

# Create geometry

x0=0.; y0=0.; z0=0.; ab=.7; at=2.; h=1.; hl=h; al=at*3

zb=z0;   x0b=x0-ab/2.; y0b=y0-ab/2.; x1b=x0+ab/2.; y1b=y0+ab/2.
zt=z0+h; x0t=x0-at/2.; y0t=y0-at/2.; x1t=x0+at/2.; y1t=y0+at/2.
zl=z0-hl;x0l=x0-al/2.; y0l=y0-al/2.; x1l=x0+al/2.; y1l=y0+al/2.

vibrationPlate = O.bodies.append(geom.facetBunker((x0,y0,z0),
  dBunker=ab*4.0,dOutput=ab*1.7,hBunker=ab*3,hOutput=ab,hPipe=ab/3.0,
  wallMask=4,segmentsNumber=10,material=facetMat))

# Create engines
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
		[Ip2_ViscElMat_ViscElMat_ViscElPhys()],
		[Law2_ScGeom_ViscElPhys_Basic()],
	),
	DomainLimiter(lo=(-4,-4,-1),hi=(4,4,4),iterPeriod=5000,label='domLim'),
	NewtonIntegrator(damping=0, gravity=[0,0,-9.81]),
	PyRunner(iterPeriod=6500,command='addBodies()',nDo=7,label='addb'),
	PyRunner(iterPeriod=1000,command='state()',label='state'),
コード例 #7
0
ファイル: conveyor.py プロジェクト: yade/trunk
tc = 0.001
en = 0.3
es = 0.3

import yade.geom

## Import wall's geometry
mat=O.materials.append(ViscElMat(density=Density,frictionAngle=frictionAngle,tc=tc,en=en,et=es))

sp=pack.SpherePack()
sp.makeCloud((-0.3,0.05,0.05),(0.3,0.7,0.5),rMean=0.03, rRelFuzz=0.001)
particles=O.bodies.append([sphere(c,r,mask=3) for c,r in sp])

from yade import ymport
fctIds= O.bodies.append(ymport.gmsh('conveyor.mesh',scale=0.001,color=(1,0,0)))
voxIds= O.bodies.append(geom.facetBunker(center=[0,1.5,-0.7],dBunker=1.1, dOutput=0.2,hBunker=0.2,hOutput=0.2,hPipe=0.1, mask=5))

for i in fctIds:
	O.bodies[i].state.vel=Vector3(0,0.2,0)      # Set conveyor velocity

## Timestep 
O.dt=.2*tc

## Engines 
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
		[Ip2_ViscElMat_ViscElMat_ViscElPhys()],
		[Law2_ScGeom_ViscElPhys_Basic()],