How we add iteration for the same test
Hi everyone,
I try to model the 3 bending point test.
I put 1 million iteration for the test and when i see the results
i want to add the iteration and not remake again.
This is my code.
Jabrane.
from yade import ymport, utils, pack, export
from yade import plot
from pylab import *
import math
#---------------- SIMULATIONS DEFINED HERE (assembly, material, boundary conditions)
#### packing (previously constructed)
PACKING=
OUT=PACKING+
#### Simulation Control
DAMP=0.4 # numerical damping
saveData=100 # data record interval
iterMax=1000000 # maximum number of iteration (to be adjusted)
saveVTK=10000 # Vtk files record interval
#### Material microproperties -> Lac du Bonnet granite (cf. A DEM model for soft and hard rock, Scholtes & Donze, JMPS 2013)
intR=1.65# allows near neighbour interaction and coordination number K=13 (determined with coordinationNum
DENS=4000 # could be adapted to match material density: dens_DEM=
YOUNG=65e9
FRICT=10
ALPHA=0.4
TENS=8e6
COH=160e6
#### material definition
sphereMat = JCFpmMat(
wallMat = JCFpmMat(
for mat in (sphereMat,
O.materials.
#### preprocessing to get dimensions
O.bodies.
dim=utils.
xinf=dim[0][0]
xsup=dim[1][0]
X=xsup-xinf
yinf=dim[0][1]
ysup=dim[1][1]
Y=ysup-yinf
zinf=dim[0][2]
zsup=dim[1][2]
Z=zsup-zinf
r=X/15.
#### preprocessing to get dimensions
R=0
Rmax=0
numSpheres=0.
for o in O.bodies:
if isinstance(
numSpheres+=1
R+=o.
if o.shape.
Rmax=
Rmean=R/numSpheres
O.reset() # all previous lines were for getting dimensions of the packing to create walls at the right positions (below) because walls have to be genrated after spheres for FlowEngine
O.bodies.
O.bodies.
piston=
p0=O.bodies[
### packing
beam=O.
# Definition of the facets for joint's geometry
alpha = 90 #angle of the crack with horizontal (pi/4.)
c = 0.375*Y # length of the crack
# 4 points pour l'entaille
ptA = gts.Vertex( X/2., c, 8./7.*Z)
ptB = gts.Vertex( X/2., 0, 8./7.*Z)
ptApr = gts.Vertex(X/2., c, -1./7.*Z)
ptBpr = gts.Vertex(X/2., 0, -1./7.*Z)
e1 = gts.Edge(ptA,ptB)
e2 = gts.Edge(ptA,ptApr)
e3 = gts.Edge(ptApr,ptB)
f1 = gts.Face(e1,e2,e3)
e4 = gts.Edge(ptB,ptBpr)
e5 = gts.Edge(
f2 = gts.Face(e4,e5,e3)
s1 = gts.Surface()
s1.add(f1)
s1.add(f2)
facet = gtsSurface2Face
O.bodies.
### set a color to the spheres
for o in O.bodies:
if isinstance(
o.shape.
#---------------- ENGINES DEFINED HERE
#### simulation is defined here (DEM loop, interaction law, servo control, recording, etc...)
##### simulation piston's motion
for i in range(0,
O.bodies[
##### simulation beam's grains motion
O.engines=[
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
]
#### custom recording functions
tensCks=
def recorder():
global tensCks, shearCks
tensCks=0
shearCks=0
for o in O.bodies:
if isinstance(
tensCks+
shearCks+
yade.
,'i':O.iter
)
yade.
# if you want to plot during simulation
plot.plots=
#plot.plot()
#---------------- SIMULATION STARTS HERE
#### manage interaction detection factor during the first timestep and then set default interaction range ((cf. A DEM model for soft and hard rock, Scholtes & Donze, JMPS 2013))
O.step();
### initializes the interaction detection factor
SSgeom.
Saabb.aabbEnlar
#### coordination number verification and reinforcement of boundary particles
numSSlinks=0
numCohesivelinks=0
numFrictionalLi
for i in O.interactions:
if not i.isReal : continue
if isinstance(
numSSlinks+=1
if i.phys.isCohesive :
numCohesi
else :
numFricti
print "nbSpheres=", numSpheres," | coordination number =", 2.0*numCohesive
O.run(iterMax)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Yor1
- Solved:
- Last query:
- Last reply: