yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00970
Re: shared_ptr<PhysicalAction>
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Tue, 17 Feb 2009 15:34:52 +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:
<499AB237.9080600@arcig.cz>
Václav Šmilauer said: (by the date of Tue, 17 Feb 2009 13:48:55 +0100)
>
> >>> memset(action[0],0,sizeof(thisAction)) and perhaps would save some
> >>> shared_ptr overhead we have currently. V.
> >>>
> >> feel free to experiment.
> >>
> >
> > you could try memset(.....get(),0,sizeof(thisAction)); maybe?
> >
> My mistake, I wanted to write
> memset(action[0],0,sizeof(thisAction)*numberOfBodies), that would reset
> the whole array at once, which was the point. What you suggest wouldn't
> be any faster thatn the current was, I think, except the reset() call
> overhead. V.
you would need a separate vector<Force> vector<Moment> etc.. for each
type of physical action to do that. If you just store raw pointers in
a vector it won't work (you know why ;). You cannot store different
types of actions without pointers - because only pointers (shared or
not) provide the polymorphic behaviour.
The only alternative is to have vector<vector<Vector3r> >, and remember
that 0th column is Force, and 1st column is Moment .... In fact we
already remember that - it's the classIndex().
I don't know how good/useful it might be, though. And not possible
currently without some extra work, I recall that come physical
actions are overly complex currently (their data is bigger than
sizeof(Vector3r)).
--
Janek Kozicki |
Follow ups
References