Re: [Yade-users] [Question #703320]: Confusion about learning code in CohesiveFrictionalContactLaw.cpp

2022-09-28 Thread Jan Stránský
Question #703320 on Yade changed:
https://answers.launchpad.net/yade/+question/703320

Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

TLTR: inheritance

> I don't understand how ... 
> Law2_ScGeom6D_CohFrictPhys_CohesionMoment::go(...)' passes the updated 
> normalForce to Phys.
>  phys->normalForce = Fn * geom->normal;

yes, with this line [1].

I did not find a definition or declaration of normalForce in shared_ptr 
and CohFrictPhys*.
Probably my biggest confusion is not finding a definition or declaration of 
NormalForce.

What editor / IDE are you using?
I think an ordinary IDE should have capability of finding declaration / 
definition (although I do not have experience with C++ in IDE).

The key concept here is inheritance and polymorphism.
Type of "ip" variable is of type IGeom [2] which is then casted to "phys" 
variable of type CohFrictPhys [3].
CohFrictPhys is derived from RotStiffFrictPhys [4].
RotStiffFrictPhys is derived from FrictPhys [5].
FrictPhys is derived from NormShearPhys [6].
NormShearPhys is derived from NormPhys. [7]
(for completeness, NormPhys is derived from IPhys [8], so CohFrictPhys is 
derived from IPhys)
"normalForce" is declared in NormPhys as a Vector3r attribute [9].

You can also see documentation [10,11] and climb up the inheritance
until the origin of normalForce (present in NormPhys, not any more in
IPhys).

Cheers
Jan

[1] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/CohesiveFrictionalContactLaw.cpp#L133
[2] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/CohesiveFrictionalContactLaw.cpp#L109
[3] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/CohesiveFrictionalContactLaw.cpp#L115
[4] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/CohesiveFrictionalContactLaw.hpp#L49
[5] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/FrictPhys.hpp#L43
[6] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/FrictPhys.hpp#L17
[7] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/common/NormShearPhys.hpp#L23
[8] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/common/NormShearPhys.hpp#L9
[9] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/common/NormShearPhys.hpp#L15
[10] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.CohFrictPhys
[11] https://yade-dem.org/doc/yade.wrapper.html#iphys

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #703104]: Changing the periodic cell for cylindrical samples

2022-09-28 Thread Launchpad Janitor
Question #703104 on Yade changed:
https://answers.launchpad.net/yade/+question/703104

Status: Open => Expired

Launchpad Janitor expired the question:
This question was expired because it remained in the 'Open' state
without activity for the last 15 days.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp