yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #13321
[Question #374841]: saveTmp and save can not save the state in yadedaily
New question #374841 on Yade:
https://answers.launchpad.net/yade/+question/374841
Hi,
I want to use the function 'saveTmp()' or 'save()' to save the Omega state, but I found it does not work well if I used yadedaily (because I need some functions in yadedaily), the following is my code. If I commented out the"O.load('/tmp/first.gz')", the stress after the second computation will be different with the stress that having "O.load('/tmp/first.gz')". But if I used yade in ubuntu14.04, the question will not exist. Can you give me some suggestions?
############################################################# The initial package
#!/usr/bin/python
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot
O.materials.append(CpmMat(young=24e9,frictionAngle=atan(0.8),poisson=.2,sigmaT=20e6,epsCrackOnset=1e-4,relDuctility=30))
initSize=1.
sp=pack.randomPeriPack(radius=.05,initSize=Vector3(initSize,initSize,initSize))
O.periodic=True
sp.toSimulation()
O.save('/tmp/tt.gz')
######################################################### The state using O.load('/tmp/first.gz')
#!/usr/bin/python
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot
import numpy
O.load('/tmp/tt.gz')
O.dt=PWaveTimeStep()
EnlargeFactor=1.5
EnlargeFactor=1.0
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
[Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
NewtonIntegrator(),
]
O.cell.velGrad=utils.Matrix3(0,0,0,0,0,0,0,0,0)
O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.
ns=10
dstrain = utils.Matrix3(0.00004,-0.0000008,0,0,-0.0001,0,0,0,0)
O.cell.velGrad=dstrain/(ns*O.dt)
O.run(ns,True)
stressValue=utils.getStress()
stressxx=stressValue[0,0]
stressyy=stressValue[1,1]
stressxy=(stressValue[0,1]+stressValue[1,0])/2
print 'stressxx'
print stressxx
print 'stressyy'
print stressyy
print 'stressxy'
print stressxy
O.save('/tmp/first.gz')
O.load('/tmp/first.gz')
ns=10
dstrain = utils.Matrix3(0.00006,-0.0000006,0,0,-0.0001,0,0,0,0)
O.cell.velGrad=dstrain/(ns*O.dt)
O.run(ns,True)
stressValue=utils.getStress()
print "the stress of the second state"
stressxx=stressValue[0,0]
stressyy=stressValue[1,1]
stressxy=(stressValue[0,1]+stressValue[1,0])/2
print 'stressxx'
print stressxx
print 'stressyy'
print stressyy
print 'stressxy'
print stressxy
#################################################### comment out the O.load('/tmp/first.gz')
#!/usr/bin/python
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot
import numpy
O.load('/tmp/tt.gz')
O.dt=PWaveTimeStep()
EnlargeFactor=1.5
EnlargeFactor=1.0
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
[Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
NewtonIntegrator(),
]
O.cell.velGrad=utils.Matrix3(0,0,0,0,0,0,0,0,0)
O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.
ns=10
dstrain = utils.Matrix3(0.00004,-0.0000008,0,0,-0.0001,0,0,0,0)
O.cell.velGrad=dstrain/(ns*O.dt)
O.run(ns,True)
stressValue=utils.getStress()
stressxx=stressValue[0,0]
stressyy=stressValue[1,1]
stressxy=(stressValue[0,1]+stressValue[1,0])/2
print 'stressxx'
print stressxx
print 'stressyy'
print stressyy
print 'stressxy'
print stressxy
O.save('/tmp/first.gz')
#O.load('/tmp/first.gz')
ns=10
dstrain = utils.Matrix3(0.00006,-0.0000006,0,0,-0.0001,0,0,0,0)
O.cell.velGrad=dstrain/(ns*O.dt)
O.run(ns,True)
stressValue=utils.getStress()
print "the stress of the second state"
stressxx=stressValue[0,0]
stressyy=stressValue[1,1]
stressxy=(stressValue[0,1]+stressValue[1,0])/2
print 'stressxx'
print stressxx
print 'stressyy'
print stressyy
print 'stressxy'
print stressxy
--
You received this question notification because your team yade-users is
an answer contact for Yade.