> I would just prefer to skip addForce() when the shape is not a sphere. > But it needs to be tested before to be sure we will have a benefit > from this.
_Why_ do you prefer that? I don't think it is systematic: (a) if you add new Shape, then, surprise! It will be silently skipped by GravityEngine... what the heck? (think of Boxes, anyway) (b) How do you check for sphere? Yade's RTTI (getClassIndex etc) results in a virtual function call. That will do certainly more harm than one multiplication and one addition (f+=mass*accel). (c) NewtonIntegrator will skip non-dynamic bodies, hence it incurs no performance penalty either for facets. > Or, another option, I can add SubscribedBodiesID into the > gravityEngine, like an option, to apply the gravity only to subscribed > bodies to escape loop over facets. This would harm most simulations, as we would have to keep huge list of bodies. If you really thing this is so important, create new PartialGravityEngine (or whatever you call it) that will apply gravity just to subscribers. v _______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

