← Back to team overview

yade-users team mailing list archive

Re: [Question #684115]: Some basic concepts in FrictPhys.cpp


Question #684115 on Yade changed:

Robert Caulk proposed the following answer:
>const shared_ptr<FrictMat>& mat1 = YADE_PTR_CAST<FrictMat>(b1);

This is saying that no matter what material class b1 actually has, mat1
is going to treat it as if it is a FrictMat. This means that we can use
mat1 later to access members that FrictMat would have (e.g. mat1->young)

>But if b1 is not a pointer to FrictMat, like a CohFrictMat, will it cause a material type mismatch between the particle material and the IPhysFunctor?


>shared_ptr but it is too complicated for a c++ 

> The Ra, Rb here are the stiffness related particle size? Why these two
values could be negative?

No. https://yade-

> Also the conversion of interaction->phys to FrictPhy type. Another is that since the reference contactPhysics has decoration of const, why it is able to change the value of its pointing memory

I think ti is because we are referencing using &. A bit confusing, no

>4. Real Kn = (!kn) ? 2*kna*knb/(kna+knb) : (*kn)(mat1->id,mat2->id,kna,knb);

kn is a shared_ptr<Matchmaker> with a custom () operator [2].



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