yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #08072
Re: [Branch ~yade-dev/yade/trunk] Rev 2962: - make body iterators jump empty slots, as suggested and discussed here: http://www.mail-archive....
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Wed, 23 Nov 2011 16:30:01 +0100
-
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:
<CALF6qJmNxZw02kbEnKMfY1GVRcHUN+un9VxLgEfJsKx827ALeQ@mail.gmail.com>
FOREACH has to work with an iterator fix. Of course.
Anton, do you agree that we cannot fix a bug in hundred places in the
code, everywhere the container is used?
This implies that the container has a bug: it does not handle
deleted bodies correctly.
The simplest approach is to modify the iterator. If iterator is
working according to specification, (no matter how convoluted code it
has) it will never break FOREACH. I am not sure if Bruno's change
follows that. For start it seems to look good.
A more complicated approach is to make special handling in container
when a body is deleted. After all a C++ ISO container has method
erase() in it's specification. So It would be a matter of
implementing it correctly. As Bruno pointed that will need some more
thinking, to handle redirections.
Do you see some other solution?
best regards
Janek Kozicki
Anton Gladky said: (by the date of Wed, 23 Nov 2011 14:53:18 +0100)
> Bruno, the bug #891540 is again here.
> Please, revert 2 last commits and we will think about better fix, if
> it is really necessary.
>
> Anton
>
>
>
>
> On Wed, Nov 23, 2011 at 1:43 PM, Anton Gladky <gladky.anton@xxxxxxxxx> wrote:
> > Hi, Bruno,
> >
> > I am not quite agree with this commit. It looks like a hack, sorry.
> > Also we have FOREACH statement in a lot of places iterating . I am not
> > sure your fix will work correctly with them.
> >
> > Anton
> >
> >
> >
> >
> > On Wed, Nov 23, 2011 at 1:11 PM, <noreply@xxxxxxxxxxxxx> wrote:
> >> ------------------------------------------------------------
> >> revno: 2962
> >> committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
> >> branch nick: trunk
> >> timestamp: Wed 2011-11-23 13:05:49 +0100
> >> message:
> >> - make body iterators jump empty slots, as suggested and discussed here: http://www.mail-archive.com/yade-dev@xxxxxxxxxxxxxxxxxxx/msg07406.html
> >> - revert the (now useless) fix of r2961, similar tests can be removed in many places after the change in pointer logic is well tested.
> >> - remove a script, as agreed by Christian (https://answers.launchpad.net/yade/+question/178830)
> >> removed:
> >> examples/generate-psd-with-poro-example.py
> >> modified:
> >> core/BodyContainer.hpp
> >> pkg/dem/GlobalStiffnessTimeStepper.cpp
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>
--
Janek Kozicki http://janek.kozicki.pl/ |
Follow ups
References