← Back to team overview

yade-dev team mailing list archive

Re: Interesting tidbit from Quantum Mechanics

 

Hi Bruno,

Bruno Chareyre said:     (by the date of Fri, 8 May 2015 22:19:06 +0200)
> Hi Janek,
> Interesting point. It may be linked to some situations we faced for adding
> additional variables to bodies.
> The material->state makes full sense in this situation (e.g. if the
> material is a wetted solid, surrounding fluid pressure could be a state
> variable of the body).
> I'll need more thinking to understand all aspects of what you point out.
> What will you do? Additional dispatchers in engines will take care of the
> extra things?
> Bruno


yes, exactly, a new dispatcher and a new functor, it's all in
pkg/common/Dispatching.cpp. Now I think that StateFunctor will be
enough. And ShapeFunctor (which I mentioned in previous email) would
unnecessarily split code, which anyway is always executed together.

But I have a question for you, because I am pondering if we should
use Functor2D or Functor1D. The question is following:

1. when you will want to generate State from Material, is it possible that
sometimes you will want to use two different classes of Material to
generate the same State class? If yes, then we need Functor 2D which
will dispatch both on Material class and State class. It's like this:

Material_1 → State_1
Material_2 → State_1   --- 2D functor needed, because State_1 accepts different materials
Material_2 → State_2


2. If the only possibility is opposite: using the same Material class to
generate two (or more) different State classes then Functor1D
(dispatching only on State type) may be enough. It's like this:

Material_1 → State_1
Material_1 → State_2   --- 1D functor is enough, because each state works with only 1 material
Material_2 → State_3



In my case it is always the second case, I need only Functor1D. each
State class works with a specific Material class and not the others.
Several State classes can accept the same Material. So Functor1D
is enough for me.

At first I wanted to make it a Functor2D, but then I realized that
this may be an overkill too. After all the BoundFunctor is Functor1D.

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?


BTW: Moving calculation of mass & inertia into such class would
remove a lot of redundant code in yade :)

best regards
-- 
Janek Kozicki                               http://janek.kozicki.pl/  |


Follow ups

References