← Back to team overview

yade-users team mailing list archive

Re: [Question #655866]: Rel. to Uniaxial test

 

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

Swapnil posted a new comment:
Here is the script Jan:

from yade import pack,plot
pred=pack.inCylinder((0,0,0),(0,0,0.2),0.05) 
sp=pack.randomDensePack(pred,radius=0.008) 
O.bodies.append(sp) 
bb=uniaxialTestFeatures()
negIds,posIds,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']
O.dt=0.005*PWaveTimeStep()
O.engines=[ForceResetter(),InsertionSortCollider([Bo1_Sphere_Aabb()]),InteractionLoop([Ig2_Sphere_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),NewtonIntegrator(),UniaxialStrainer(strainRate=-0.00005,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=False,blockRotations=False,setSpeeds=False,label='strainer'),PyRunner(virtPeriod=1e-6/0.5,realPeriod=1,command='addPlotData()',label='plotDataCollector',initRun=True)] 
plot.plots={'eps':('sigma')}

def addPlotData():
yade.plot.addData(t=O.time,i=O.iter,eps=-strainer.strain,sigma=-strainer.avgStress)

O.run(10,True)
-------
saved as file script1.py. I am typing "yade script1.py" in the terminal and I get the following error:
 
File "<ipython-input-1-0669567f7eda>", line 1
    yade script1.py
               ^
SyntaxError: invalid syntax

---

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.