yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #09846
Re: bool MatchMaker
Hi Klaus,
There are other problems in this line.
* The parameter itself has to be declared as a matchMaker. For instance
Ip2_FrictMat_FrictMat_MindlinPhys::en is a MatchMaker (or None, then
default code is used). includeMoment is not a MatchMaker, so it will not
work.
* The code itself has to use the object as a MatchMaker, not as a
builtin type, for instance in HertzMinlin.cpp:
Real logE = log((*en)(mat1->id,mat2->id));
instead of
Real logE = log(en);
So, it will clearly not work to pick a random attribute of an engine and
make it a MatchMaker in a python script. It needs to be already
anticipated by the c++ side.
* The last thing, is that MM are indeed only returning scalar values,
but it should not be a problem to convert Real to bool.
I see that we don't have a real example script for matchMakers. That is
bad...
Bruno
On 28/08/13 04:18, Klaus Thoeni wrote:
> Hi guys
>
> it seems that MatchMakers are working with Real only. I tried something like
> this:
>
> O.engines=[
> ...
> [Law2_ScGeom_MindlinPhys_Mindlin(includeMoment=MatchMaker(matches=((mat1,mat1,True),
> (mat1,mat2,False))))]
> ...
> ]
>
> which gives the following error:
>
> TypeError: No registered converter was able to produce a C++ rvalue of type
> bool from this Python object of type MatchMaker
>
> When looking into the code it is obvious because the whole class is defined for
> Real only. Is there a workaround for Booleans? If not, any idea how to
> implement it?
>
> Thanks
> Klaus
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>
>
>
--
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53
38041 Grenoble cedex 9
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________
Follow ups
References