yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #06411
[Question #208644]: How to save a confined pack and later load it for shear
New question #208644 on Yade:
https://answers.launchpad.net/yade/+question/208644
Hi,
I want to save a packing using O.save after confining and to load it for shear in another script. This is my sample code:
============================================================================================
from yade import pack
O.materials.append(FrictMat(young=1.e8,poisson=.7,frictionAngle=0.5,density=2650))
sp = pack.SpherePack()
sp.makeCloud(minCorner=(0,0,0),maxCorner=(.2,.2,.2),rMean=.005,rRelFuzz=.5,num=1500,periodic=True,seed=1)
sp.toSimulation()
O.cell.hSize = Matrix3(.2,0,0, 0,.2,0, 0,0,.2)
O.dt = utils.PWaveTimeStep()
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]), # detect new collisions
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
PeriTriaxController(
dynCell=True,
goal=(-5.e3,-5.e3,-5.e3),
stressMask=7,
relStressTol=.001,
maxUnbalanced=.01,
maxStrainRate=(.1,.1,.1),
label='conf'
),
NewtonIntegrator(damping=.2)
]
O.run();O.wait()
O.cell.trsf=Matrix3.Identity
O.save('./conf.xml.bz2')
O.pause()
=============================================================================================
Then I want to load it like this:
=============================================================================================
from yade import plot
O.load('conf.xml.bz2')
def saveAddData():
stress = utils.getStress()
plot.addData(
stress_yy = stress[4],
strain_yy = O.cell.trsf[4]
)
O.engines = O.engines + [PyRunner(command='saveAddData()',iterPeriod=1000)]
conf.goal=(-5.e3,-1.e-1,-5.e3)
conf.stressMask=5
conf.maxStrainRate=(1.,.1,1.)
O.run();O.wait()
plot.saveDataTxt('result_drained.txt',vars=('stress_yy','strain_yy'))
O.pause()
=============================================================================================
Are these two scripts correct? (I got endless running...) Or how to use O.save and O.load for this purpose. (In my case I want to get rid of doneHook)
Ning
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.