yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #05451
[Bug 607836] Re: b.dynamic and b->isDynamic() out of synchro in case of save/load
This is expected. The "Sphere" variable holds shared_ptr to the original
sphere. If you reload, too bad, a new body is created, while your
variable still points to the old one. Then of course it will not work.
It is somewhat described in https://yade-
dem.org/sphinx/prog.html?highlight=reference#returning-attribute-by-
value-or-by-reference though there should be a warning about that in the
user's manual -- I will do that. Thanks for pointing it out actually.
PLEASE follow the usual convention for naming in both c++ and python:
only class names are Capitalized, while variables are not. Otherwise
other people will have hard time reading your scripts.
** Changed in: yade
Importance: Undecided => Medium
** Changed in: yade
Status: New => Invalid
--
b.dynamic and b->isDynamic() out of synchro in case of save/load
https://bugs.launchpad.net/bugs/607836
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.
Status in Yet Another Dynamic Engine: Invalid
Bug description:
The attached script will illustrate the title.
It is about a sphere which is created as dynamic=False, then updated to dynamic=True, in order to let rotate it with NewtonIntegrator.
Directly with the script as it is joined, you will observe that the orientation of the sphere is unfortunately not at all modified.
But, "hokus pokus", (magic expression) comment l.27-28 about the save/load, re-run and you will have the orientation which evolves...
The reason is in b->isDynamic() (in C++). In the first case (with save/load), you will have b->isDynamic()=0 (in C++), even if b.dynamic=True (in python)
Whereas, in the second case, things are as they should : b->isDynamic() = b.dynamic = True
You can easily check this with logs from NewtonIntegrator.cpp (I could not attach the file with cout typed I used : no more than one attachment it seems)
References