← Back to team overview

yade-users team mailing list archive

Re: [Question #702096]: Learning of ig2_ Sphere_ Sphere_ ScGeom.cpp

 

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

    Status: Open => Answered

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

> I am learning the code of Yade

You should first understand the "python layer" and meaning, interplay and design of the simulation components.
Then learning C++ code is much easier.

> What does cm1, cm2,state1,shift2, force stand for in this function?

As the signature of Ig2_Sphere_Sphere_ScGeom::go tells:
- cmX ... Shape
- stateX ... State
- shift2 ... "periodic shift" of the interacting bodies, used in periodic simulations, zero Vector3 by default

cm1, state1 ... shape and state of 1st interacting body
cm2, state2 ... shape and state of 2nd interacting body

> What does state.se3 stand for ?

state.pos and state.ori as one object [1].
Type declared in [2].

> What does normal stand for in this function?

in this line of code, it is some Vector3r type variable.
Specifically a vector connecting centers of the two bodies.
Later in the function it is normalized and in scm->precompute assigned to geom.normal

Cheers
Jan

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/core/State.hpp#L55
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/lib/high-precision/MathEigenTypes.hpp#L135

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