yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #20781
Re: [Question #684115]: Some basic concepts in FrictPhys.cpp
Question #684115 on Yade changed:
https://answers.launchpad.net/yade/+question/684115
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?
Nope.
>shared_ptr but it is too complicated for a c++
[1]
> The Ra, Rb here are the stiffness related particle size? Why these two
values could be negative?
No. https://yade-
dem.org/doc/yade.wrapper.html#yade.wrapper.GenericSpheresContact.refR1
> 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
doubt.
>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].
[1]https://www.yade-dem.org/doc/prog.html#shared-pointers
[2https://gitlab.com/yade-
dev/trunk/blob/master/pkg/common/MatchMaker.hpp#L38
--
You received this question notification because your team yade-users is
an answer contact for Yade.