yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #07425
Re: Reloading simulations
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Thu, 7 Apr 2011 09:52:59 +0200
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
-
In-reply-to:
<4D9C990C.5070904@geo.hmg.inpg.fr>
Jerome Duriez said: (by the date of Wed, 06 Apr 2011 18:47:08 +0200)
> Hello Chiara,
>
> our kind of problem can occur for example when some variables disappear
> from code or change of name.
boost::serialization has built-in system for class version management.
Exactly for this purpose. Upon loading the loaded version is checked,
and if different a proper conversion can be done. Problem is that we
never started using this class versioning in yade.
Maybe it's time to start using it? :)
http://www.boost.org/doc/libs/1_46_1/libs/serialization/doc/index.html
http://www.boost.org/doc/libs/1_46_1/libs/serialization/doc/tutorial.html#versioning
void serialize(Archive & ar, const unsigned int version)
{
// only save/load this for newer classes, when friction was introduced
if(version > 0)
ar & friction;
ar & stiffness;
}
However, I didn't even look at how Vaclav integrated
boost::serialization with existing serialization framework. Maybe
introducing class versioning into yade could be done a simply as
adding to those nifty macros additional parameter saying in which
version the variable was introduced.
best regards
--
Janek Kozicki http://janek.kozicki.pl/
References