← Back to team overview

yade-users team mailing list archive

Re: [Question #209832]: saveDataTxT

 

Question #209832 on Yade changed:
https://answers.launchpad.net/yade/+question/209832

    Status: Answered => Open

Christian Sommerfeld is still having a problem:
Hi,

sorry for that! Here is the hole script:


from yade import pack, plot, geom, utils


O.materials.append(FrictMat(young=5e7,poisson=0.5,frictionAngle=.5,density=10000,
label='mat_box'))

O.materials.append(FrictMat(young=5e6,poisson=0.5,frictionAngle=.5,density=2400,
label='mat_spheres'))

O.materials.append(FrictMat(young=5e7,poisson=0.5,frictionAngle=.5,density=2400,
label='mat_cylinder'))


for l in O.bodies:
	g=l.id
	print g


smallcylinder=O.bodies.append(utils.geom.facetCylinder((.1,.01,.2),.004,.01,orientation=Quaternion(((math.pi)/2, 0, 0),1),segmentsNumber=5,wallMask=7, color=(1,1,1), fixed=True))


for l in O.bodies:
	g=l.id
	print g

bigcylinder=O.bodies.append(utils.geom.facetCylinder((.1,0,.2),.05,.01,orientation=Quaternion(((math.pi)/2, 0, 0),1
), segmentsNumber=20,wallMask=7, color=(0,0,1), fixed=True))

pot=O.bodies.append(utils.geom.facetCylinder((0,0,.25),.25,.5,orientation=Quaternion((0,
0, 0),0),segmentsNumber=20,wallMask=6, color=(0,1,0), fixed=True))


tool=bigcylinder+smallcylinder


sphereRadius = 0.006
nbSpheres = (10,10,30)

for i in xrange(nbSpheres[0]):
    for j in xrange(nbSpheres[1]):
        for k in xrange(nbSpheres[2]):
            x = (i*2 - nbSpheres[0])*sphereRadius*1.1
            y = (j*2 - nbSpheres[1])*sphereRadius*1.1
            z = (k*2 - nbSpheres[2])*sphereRadius*1.1
            sp1=utils.sphere([x,y,z+2],sphereRadius,color=(1,0,0),material='mat_spheres')
            O.bodies.append(sp1)

sphereRadius = 0.006
nbSpheres = (10,10,30)

for i in xrange(nbSpheres[0]):
    for j in xrange(nbSpheres[1]):
        for k in xrange(nbSpheres[2]):
            x = (i*2 - nbSpheres[0])*sphereRadius*1.1
            y = (j*2 - nbSpheres[1])*sphereRadius*1.1
            z = (k*2 - nbSpheres[2])*sphereRadius*1.1
            sp2=utils.sphere([x,y,z+1],sphereRadius,color=(1,0,0),material='mat_spheres')
            O.bodies.append(sp2)


O.engines=[

   ForceResetter(),

   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(

      [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],

      [Ip2_FrictMat_FrictMat_FrictPhys()],

      [Law2_ScGeom_FrictPhys_CundallStrack()]

   ),

  NewtonIntegrator(damping=0.4, gravity=(0,0,-9.81)),

RotationEngine(rotateAroundZero=True,zeroPoint=(0,0,0),rotationAxis=(0,0,1),angularVelocity=100*(2*pi/60),ids=tool,label='rotor'),

 PyRunner(iterPeriod=20,command="myAddPlotData()"),
	VTKRecorder(iterPeriod=100,fileName='/tmp/QuaderAufnahme-',recorders=['spheres','facets'])
]


O.dt=1*utils.PWaveTimeStep()


def myAddPlotData():
	force=plot.addData(t=O.time,F=O.forces.f(0).norm()+O.forces.f(1).norm()+O.forces.f(2).norm()+O.forces.f(3).norm()+O.forces.f(4).norm()+O.forces.f(5).norm()+O.forces.f(6).norm()+O.forces.f(7).norm()+O.forces.f(8).norm()+O.forces.f(9).norm()+O.forces.f(10).norm()+O.forces.f(11).norm()+O.forces.f(11).norm()+O.forces.f(11).norm()+O.forces.f(11).norm()+O.forces.f(12).norm()+O.forces.f(13).norm()+O.forces.f(14).norm()+O.forces.f(15).norm()+O.forces.f(16).norm()+O.forces.f(17).norm()+O.forces.f(18).norm()+O.forces.f(19).norm())

plot.plots={'t':('F')}
plot.plot()


from yade import qt
v=qt.View()
v.axes=True; v.sceneRadius=1

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.