Bruno Chareyre said: (by the date of Mon, 11 May 2015 13:56:42 +0200) > On 09/05/15 20:59, Janek Kozicki wrote: > > But of course I want to make sure that it works for you also. So what > > do you think, is it better Functor1D or Functor2D? > I can't imagine a situation where 2D is needed. It would need a body > with two materials, which we never had before. > Your 1D suggestion sounds right. > > > BTW: Moving calculation of mass & inertia into such class would > > remove a lot of redundant code in yade :) > Mass and inertia need Shape, not only Material+State. How would it be > done in this new functor?
Usually all the functors pass the most needed arguments (i.e. the one upon which the dispatch is done plus something extra) and also the Body* argument in case if anything else is needed. Hence StateFunctor will have access to Shape through Body*. I have just committed this StateFunctor, please have a look at this diff: https://github.com/cosurgi/trunk/commit/ffbb314dfebb9d5962cacb120ee050fdfd0e4d11 On a side note: it's possible that I also will need access to Shape, because I am somewhat unsure if the quantum wavefunction should belong to State or to Shape :) Funny thing: it is related to interpretations of QM, and there are ongoing debates about it, starting somewhere around 1925, and still unsettled ;-) best regards -- Janek Kozicki http://janek.kozicki.pl/ | _______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

