← Back to team overview

yade-users team mailing list archive

[Question #697142]: Writing new Ip2 functor / order of contact partners

 

New question #697142 on Yade:
https://answers.launchpad.net/yade/+question/697142

Dear all,

Currently, I try to write a new Ip2 functor and after some trouble I have a general question on the order of two contacting particles in the interaction class. 

Say I have:
spheres with myMaterial
pfacets with FrictMat
facets with FrictMat

In my engine I have the following:
InteractionLoop(
[Ig2_Sphere_PFacet_ScGridCoGeom(),
Ig2_Facet_Sphere_ScGeom(),],
[Ip2_FrictMat_myMaterial_myPhysics()],
[Law2_ ScGridCoGeom _myPhysics_someLaw(),
Law2_ ScGeom _myPhysics_someOtherLaw()]
)

In this example, I have only one Ip2 functor, which should handle contacts between spheres/pfacets and facets/spheres. 
The Ip2_FrictMat_myMaterial_myPhysics functor is passed two pointers b1, b2 to the material of the two contact partners. In my case, these materials are different. 

Is the order of the contact partners determined by the Ig2 functor?  

With some debugging, it seems that for sphere/pfacet contacts, b1 points to myMaterial and b2 to FrictMat. In contrast, for facet/sphere contacts, b1 points to FrictMat and b2 to myMaterial. 

As the materials have different types of parameters, this is a problem for me.
Do you have any suggestions how I can solve this? Can I check the class to which b1, b2 are pointing?
I tried coding additionally an Ip2_myMaterial_FrictMat_myPhysics functor, but this isn’t chosen for sphere/pfacet contacts, instead the old Ip2_FrictMat_myMaterial_myPhysics functor is used.

Any help would be appreciated.

Best regards,
Bettina


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.