← Back to team overview

yade-dev team mailing list archive

Re: twist plastic moment

 

On 7 December 2010 09:46, Chiara Modenese <c.modenese@xxxxxxxxx> wrote:

> The problem is that I have moved these alphas parameters (not yet in trunk)
> to CohFricMat. I guess in such a case what you say would not apply, right?
> Chiara
>
Ah sorry I got it now. I does apply but I will have to create these
MatchMaker objects into Ip2. Bruno, since it is your code, what do you
prefer? You said you would like to keep only flags in the functor.
Chiara

>
>
>
> 2010/12/6 Václav Šmilauer <eu@xxxxxxxx>
>
>
>>  can I use the MatchMaker to get the harm average of alphas parameter? I
>>> am not sure to understand how it works.
>>> Cheers, Chiara
>>>
>> Hi, yes you can... You will turn (if we speak about
>> Ip2_2xCohFrictMat_CohFrictPhys) alphaKr, alphaKts into MatchMaker objects,
>> which will by default return constant value (so that older code behaves the
>> same), something like (see also Ip2_FrictMat_FrictMat_FrictPhys):
>>
>> ((shared_ptr<MatchMaker>,alphaKr,new MatchMaker(2.0),,"docs"))
>>
>> where the "new MatchMaker(2.0)" will construct new object always returning
>> 2.0 [note: I will be adding this ctor, since you gave me the idea, now, so
>> you will need to update]. In the code then, you will get the value as
>> (*alphaKr)(mat1->id,mat2->id,mat1->alphaKr,mat2->alphaKr) (alphaKr is a
>> pointer, so once needs the *). To use harmonic average between mat1->alphaKr
>> and mat2->alphaKr (of which value are ignored the MatchMaker returns a const
>> value), you do in the python script
>>
>>
>>  Ip2_2xCohFrictMat_CohFrictPhys(...,alphaKr=MatchMaker(fallback='harmAvg'),...)
>>
>> and that's it. One can still set the constant with
>>
>>  Ip2_2xCohFrictMat_CohFrictPhys(...,alphaKr=2.0)
>>
>> There is one margin case that you must handle in the c++ code, and that is
>> if the shared_ptr<MatchMaker> is NULL pointer (is someone says in python
>> alphaKr=None), then throw exception or something similar.
>>
>> Cheers, v.
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
>> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>

Follow ups

References