← Back to team overview

yade-users team mailing list archive

[Question #261965]: Saving/loading simulations

 

New question #261965 on Yade:
https://answers.launchpad.net/yade/+question/261965

Hi,

I'm saving a simple simulation(the script is copied here) at some time step. When I quit Yade and load the save file again, the plot functions are lost. Do we need to save functions as well?

In the loaded XML file, I've got the spheres and loads on them but the function to plot is not defined. 

#========================
O.reset()
from yade import utils, plot
from yade import pack, qt

id_Mat2=O.materials.append(FrictMat(young=1e4,poisson=0.3,density=2600,frictionAngle=1))
Mat2=O.materials[id_Mat2]

s1=utils.sphere([0.0,0.0,0.0],0.01,fixed=True,material=Mat2)
s2=utils.sphere([0.0,0.0,2.0e-2],0.01,fixed=False,material=Mat2)
O.bodies.append(s1)
O.bodies.append(s2)


O.engines=[
ForceResetter(),
ForceEngine(force=(0,0,-2e-3),ids=[1],label='fEngine'),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(damping=0.7,gravity=[0,0,0]),
PyRunner(command="fEngine.force=(0,0,0)", iterPeriod=5000000),
PyRunner(command='AutoData()',iterPeriod=100000)
]

def AutoData():
	
        plot.addData(t=O.time,d_numerical=0.02-(O.bodies[s2.id].state.pos[2]))


plot.plots={'t':('d_numerical'),}
plot.plot()

O.dt=1e-6

qt.View() 

#=======================



-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.