yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #19527
[Question #680317]: different result after scenetostring
New question #680317 on Yade:
https://answers.launchpad.net/yade/+question/680317
Hi:
I noticed that the results of my simulation is different if I use 'scenetostring' and 'stringtoscene' (I also tested save and load). I generated a periotric cell and change to strain from (0,0,0,0,0,0,0,0,0) to (0,0,0,0,0,0,0,0,-0.2) to (0,0,0,0,0,0,0,0,-0.1).
Here are my codes:
from libyade import yade
from yade import*
from yade import pack, Vector3, Vector3, utils
from minieigen import Vector3, Matrix3, Matrix6
def randomPeriPack(radius,initSize,seed):
O.switchScene(); O.resetThisScene()
sp=pack.SpherePack()
O.periodic=True
O.cell.setBox(initSize)
sp.makeCloud(Vector3().Zero,O.cell.refSize,radius,0.,-1,True,seed=seed)
O.engines=[ForceResetter(),InsertionSortCollider([Bo1_Sphere_Aabb()],verletDist=.05*radius),InteractionLoop([Ig2_Sphere_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),PeriIsoCompressor(charLen=2*radius,stresses=[-100e9,-1e8],maxUnbalanced=1e-2,doneHook='O.pause();',globalUpdateInt=20,keepProportions=True),NewtonIntegrator(damping=.8)]
O.materials.append(FrictMat(young=30e9,frictionAngle=.1,poisson=.3,density=1e3))
for s in sp: O.bodies.append(utils.sphere(s[0],s[1]))
O.dt=utils.PWaveTimeStep()
O.timingEnabled=True
O.run(); O.wait()
for b in O.bodies: b.state.pos = O.cell.wrap(b.state.pos)
ret=pack.SpherePack()
ret.fromSimulation()
O.switchScene()
return ret
young = 4e6
O.materials.append(CpmMat(young=young,poisson=.2,epsCrackOnset=1e100,sigmaT=1e100,relDuctility=2))
sp = randomPeriPack(.01,.1*Vector3.Ones,10)
sp.toSimulation()
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5,label='is2aabb')],allowBiggerThanPeriod=True),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.5,label='ss2d3dg')],
[Ip2_CpmMat_CpmMat_CpmPhys()],
[Law2_ScGeom_CpmPhys_Cpm()]),
NewtonIntegrator(damping=.1),
]
O.dt = 0.
O.step()
O.dt = 0.0002
is2aabb.aabbEnlargeFactor = 1.
ss2d3dg.interactionDetectionFactor = 1.
Strain1 = Matrix3(0,0,0,0,0,0,0,0,-0.2)
Strain2 = Matrix3(0,0,0,0,0,0,0,0,-0.1)
I = Matrix3.Identity
trsf1 = Strain1+I
trsf2 = Strain2+I
v1 = (trsf1-O.cell.trsf)/(500*O.dt)
O.cell.velGrad = v1
O.run(500,True)
print(O.cell.trsf)
scene = O.sceneToString() ####!!!!!
O.stringToScene(scene) ####!!!!!
v2 = (trsf2-O.cell.trsf)/(500*O.dt)
O.cell.velGrad = v2
O.run(500,True)
print(O.cell.trsf)
print(utils.getStress())
If you run the script, I think the result of stress[8] should be -567126, and if you delete the scenetostring and stringtoscene, the result is -733878. My yade version is 2017.01a. Maybe my yade version is relatively old??
Yours,
Joe
--
You received this question notification because your team yade-users is
an answer contact for Yade.