yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #02428
Re: Accessing bodies from interactions
> > Better suggestion where to store it? In the engine?>
> That, or ncb could be just a static pointer in each Yade instance (in
> Omega?). Just suggestions, passing ncb is not a big problem.
I also used to think it could be static...
Bot sometimes it is handy to have 2 simulation in memory (not running at
the same time, of course). There is Omega::rootBody and
Omega::rootBodyAnother; if you use O.switchWorld(), they are swapped.
This is used in the pack module, where packing generation
(TriaxialTest/PeriIsoCompressor) is run in the another world (while not
destroying the first one), then the results are transferred and again
O.switchWorld() swaps the pointers.
Sotring it inside the engines sounds good (like Engine::world), we could
even assign it in each step in moveToNextTimeStep before calling the
engine to action, no big deal. But first, we would have to unify all the
rootBody, ncb, rb, ... that are used as local MetaBody* vars, so that
then we only change the prototype for action and it will work. I suggest
world, since I would like to rename MetaBody to World as well ;-)
v
Follow ups
References