← Back to team overview

yade-users team mailing list archive

Re: [Question #238797]: Update interaction physics after changing material of spheres

 

Question #238797 on Yade changed:
https://answers.launchpad.net/yade/+question/238797

Alexander Eulitz [Eugen] posted a new comment:
What do you think of changing the IP2-Functor?
instead of:
        if(interaction->phys) return; // no updates of an already existing contact necessary
        shared_ptr<MindlinPhys> contactPhysics(new MindlinPhys());
        interaction->phys = contactPhysics;
        FrictMat* mat1 = YADE_CAST<FrictMat*>(b1.get());
        FrictMat* mat2 = YADE_CAST<FrictMat*>(b2.get());


something like:
        FrictMat* mat1 = YADE_CAST<FrictMat*>(b1.get());
        FrictMat* mat2 = YADE_CAST<FrictMat*>(b2.get());
        if(interaction->phys->mat1==mat1 and interaction->phys->mat2=mat2) return;
        shared_ptr<MindlinPhys> contactPhysics(new MindlinPhys());
        interaction->phys = contactPhysics;
        // update reference to materials of bodies in contact
        interaction->phys->mat1=mat1 
        interaction->phys->mat1=mat1 

This way a reference to the materials from the last timestep of the
bodies in interaction has to be stored in the contactPhysics.

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.