saving the simulation

Asked by Carine Tanissa

How can i save my simulation at certain time steps so that i can later open it and rereun it from a certain point?

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

See O.save [1] and O.load [2].
Be aware that the saved files very likely will not work on different version of Yade (i.e. after update or on a different machine)

Cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Omega.save
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Omega.load

Revision history for this message
Carine Tanissa (carinatanissa) said :
#2

where do the folder save?

Revision history for this message
Jan Stránský (honzik) said :
#3

what is "the folder"?

Revision history for this message
Carine Tanissa (carinatanissa) said :
#4

the simulation.
So if i were to reopen it and continue running it, where would i do that from?

Revision history for this message
Jan Stránský (honzik) said :
#5

It depends on the use case. And also definitions like "from where" etc.
O.save saves the simulation to a specified file.
O.load loads simulation from specified file.

### script1.py
O.bodies.append(sphere((0,0,0),123))
O.save("/tmp/file1.yade")
###

copy /tmp/file1.yade to /tmp/file2.yade
you can use directly file1.yade, just that you can copy, move, ... the files freely

### script2.py
O.load("/tmp/file2.yade")
b = O.bodies[0]
print(b.shape.radius) # should print 123.0
###

Cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask Carine Tanissa for more information if necessary.

To post a message you must log in.