On modification of contact law

Asked by kelaogui

Dear Sir,
I add a new subclass of FrictPhys in FrictPhys.cpp&hpp, and did corresponding modification in Ip2_FrictMat_FrictMat_FrictPhys.cpp&hpp.
Based on this new subclass, I change the contact law of Law2_ScGeom_FrictPhys_CundallStrack in ElasticContactLaw.cpp.
The compilation of the source code is OK. But yade --check can't pass with following throw:

running: checkTestTriax.py
FATAL /home/dylan/yadetrunk201304020lineardamp/pkg/common/InteractionLoop.cpp:152 action: None of given Law2 functors can handle interaction #1+56, types geom:ScGeom=1 and phys:FrictPhys=3 (LawDispatcher::getFunctor2D returned empty functor)

I check the InteractionLoop.cpp at line 152:

if(unlikely(!I->functorCache.constLaw)){
   I->functorCache.constLaw=lawDispatcher->getFunctor2D(I->geom,I->phys,swap);
   if(unlikely(!I->functorCache.constLaw)){
    LOG_FATAL("None of given Law2 functors can handle interaction #"<<I->getId1()<<"+"<<I->getId2()<<", types geom:"<<I->geom->getClassName()<<"="<<I->geom->getClassIndex()<<" and phys:"<<I->phys->getClassName()<<"="<<I->phys->getClassIndex()<<" (LawDispatcher::getFunctor2D returned empty functor)");
    //abort();
    exit(1);
   }

It seems that I->phys didn't pass successfully. Except FrictPhys.cpp&hpp, Ip2_FrictMat_FrictMat_FrictPhys.cpp&hpp, ElasticContactLaw.cpp&hpp, do I need to do modification in other scripts? Or problems exists within these scripts?

Thank you!

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
I don't understand what you did exactly.

>I add a new subclass of FrictPhys in FrictPhys.cpp&hpp

Here, you derived new classes inheriting from FrictPhys if I undersand correctly.

> and did corresponding modification in Ip2_FrictMat_FrictMat_FrictPhys.cpp&hpp. [...] I change the contact law of Law2_ScGeom_FrictPhys_CundallStrack

Here, you modify the existing Ip2 functor and the law which are supposed to handle FrictPhys, not your new class. How is it supposed to work?

I suggest to write new class AND new functors. If you modify existing classes for your needs, it results in some code that you can't share since it modifies existing functionallities.

Can you help with this problem?

Provide an answer of your own, or ask kelaogui for more information if necessary.

To post a message you must log in.