Cannot run the script for periodic simple shear test, with periodic boundary
Dear All,
I copy the example from the website, but I can't run it. There are some errors shows. Could you please check it for me? Thank you in advance. My script is as follows:
# encoding: utf-8
# script for periodic simple shear test, with periodic boundary
# first compresses to attain some isotropic stress (checkStress),
# then loads in shear (checkDistorsion)
#
# the initial packing is either regular (hexagonal), with empty bands along the boundary,
# or periodic random cloud of spheres
#
# material friction angle is initially set to zero, so that the resulting packing is dense
# (sphere rearrangement is easier if there is no friction)
#
# setup the periodic boundary
O.periodic=True
O.cell.
EY=1e5 #Young modulus
compFricDegree=1.
def mat(): return CohFrictMat(
from yade import pack,plot
'''
# the "if 0:" block will be never executed, therefore the "else:" block will be
# to use cloud instead of regular packing, change to "if 1:" or something similar
#if 0:
# create cloud of spheres and insert them into the simulation
# we give corners, mean radius, radius variation
# sp=pack.
# sp.makeCloud(
# insert the packing into the simulation
sp.toSimulat
else:
# in this case, add dense packing
'''
O.bodies.append(
pack.
)
#sp.makeCloud(
#O.materials.
#O.bodies.
# create "dense" packing by setting friction to zero initially
#O.materials[
# simulation loop (will be run at every step)
O.engines=[
ForceResetter(),
InsertionSor
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
NewtonIntegr
# run checkStress function (defined below) every second
# the label is arbitrary, and is used later to refer to this engine
PyRunner(
PyRunner(
]
# set the integration timestep to be 1/2 of the "critical" timestep
O.dt=.5*
# prescribe isotropic normal deformation (constant strain rate)
# of the periodic cell
O.cell.
yade.qt.View()
# when to stop the isotropic compression (used inside checkStress)
limitMeanStress
def checkStress():
stress=
print 'mean stress', stress.trance()/3.
if stress.
O.cell.
checker.
if O:
for b in O.bodies:
b.state.
b.state.
for b in O.bodies:
b.mat.
for i in O.interactions: i.phys.
def checkDistorsion():
if abs(O.cell.
plot.
O.pause()
def addData():
stress=
plot.addData(
for b in O.bodies:
b.shape.
# define what to plot (3 plots in total)
## exz(i), [left y axis, separate by None:] szz(i), sxz(i)
## szz(exz), sxz(exz)
## tanPhi(i)
# note the space in 'i ' so that it does not overwrite the 'i' entry
plot.plots=
# better show rotation of particles
Gl1_Sphere.
yade.qt.
# open the plot on the screen
plot.plot()
#O.run(1000)
#O.saveTmp()
O.run(1000,1)
Merci beaucoup!
Cheers, Liqing
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Bruno Chareyre
- Solved:
- Last query:
- Last reply: