yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #05026
Re: [Question #167511]: utils.saveVars() and utils.loadVars()
Question #167511 on Yade changed:
https://answers.launchpad.net/yade/+question/167511
Status: Open => Answered
Anton Gladky proposed the following answer:
Hi Christian,
yo use this function you need to save all your simulation, and then load
it respectively [1].
So in your case the script 1 should look like:
===========
#!/usr/bin/python
# -*- coding: utf-8 -*-
a = 1
b = 2
c = 3
utils.saveVars('savedVars',a=a,b=b,c=c)
O.save("fileNameXML")
===========
test script 2:
===========
#!/usr/bin/python
# -*- coding: utf-8 -*-
O.load("fileNameXML")
utils.loadVars('savedVars')
print yade.params.savedVars.a
print yade.params.savedVars.b
print yade.params.savedVars.c
===========
[1] https://yade-
dem.org/doc/yade.utils.html?highlight=savevars#yade.utils.saveVars
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.