yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #08611
Re: [yade/trunk] 59b663: Give the newly created body an id, which is the si...
> Author: Anton Gladky <gladky.anton@xxxxxxxxx>
> Date: 2012-05-21 (Mon, 21 May 2012)
>
> Changed paths:
> M core/BodyContainer.cpp
> M core/BodyContainer.hpp
>
> Log Message:
> -----------
> Give the newly created body an id, which is the size of
bodyContainer. Remove lowestFree. Nicer fix for LP:1001194
Sure of that?
The size of the container will increase forever, no?
In addition, insert(b,id=size) triggers body.resize(id+1), which is
horrible in terms of cpu time (create a new vector, copy the old vector
into it, erase the old one).
For inserting 100 new bodies in 100k bodies, you will move and delete
~10^7 shared pointers.
lowestFree was a smart trick IMO.
Bruno
Follow ups
References