frictAngle matchmaker in Ip2_CohFrictMat_CohFrictMat_CohFrictPhys

Asked by Jan De Pue

Dear all,
I'd like to use a matchmaker to specify the friction angle between different material types.
The simulation uses cohesive materials, so I'm using Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.
However, it seems this functor doesn't accept a frictionangle matchmaker:

frictAngleMatchMaker = MatchMaker(algo='max')
Ip2_FrictMat_FrictMat_FrictPhys(frictAngle = frictAngleMatchMaker)
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(frictAngle = frictAngleMatchMaker)

returns:
   File "/../FrictAngleMatchmaker.py", line 3, in <module>
    Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(frictAngle = frictAngleMatchMaker)
AttributeError: No such attribute: frictAngle.

I was thinking this would be possible, since it's based on Ip2_FrictMat_FrictMat_FrictPhys.
Is there a way to get around this?

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
Last query:
Last reply:
Revision history for this message
Best Robert Caulk (rcaulk) said :
#1

Hello,

frictAngle is not an attribute of Ip2_CohFrictMat [1]. But if you want to add the matchmaker functionality, it will be pretty simple to copy Ip2-FrictMat matchmaker [2][3] into the respective Ip2_CohFrictMat .hpp and .cpp files. Please make sure the default behavior remains the same for frictAngle=none if you decide to commit your changes.

Cheers,

Robert

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Ip2_CohFrictMat_CohFrictMat_CohFrictPhys
[2]https://github.com/yade/trunk/blob/master/pkg/dem/FrictPhys.hpp#L48
[3]https://github.com/yade/trunk/blob/master/pkg/dem/FrictPhys.cpp#L34

Revision history for this message
Jérôme Duriez (jduriez) said :
#2

Hi,

Note that Ip2_CohFrictMat_CohFrictMat_CohFrictPhys is actually not based on (or inherited from) Ip2_FrictMat_FrictMat_FrictPhys, as I also just realized.

See https://github.com/yade/trunk/blob/master/pkg/dem/CohesiveFrictionalContactLaw.hpp#L138 or the inheritance diagram at https://yade-dem.org/doc/yade.wrapper.html#iphysfunctor

Revision history for this message
Jan De Pue (jan-depue-x) said :
#3

Thanks Robert Caulk, that solved my question.

Revision history for this message
Jan De Pue (jan-depue-x) said :
#4

Hi Robert & Jerome,
I don't have much experience with this, but here's my best shot:
https://github.com/yade/trunk/pull/52

I left the original code in comments to be sure, but it seems to work as expected.
Thanks for your advice.