Hi there, first of all I suggest that you change your e-mail name to read Jan (not Honza) since people not familiar with the Czech language must be confused about your double identity.
> how can I rewrite in C++ this Python statement? > > for i in O.interactions: > length = (O.bodies[i.id2].state.pos - O.bodies[i.id1].state.pos).norm() See Shop::normalShearStressTensor. To make it independent on IGeom type and working for both periodic and aperiodic boundary, you must compute the distance from particle's position where the second particle is moved by the "shift2", which is something like scene->cell->Hsize*I->cellDist.cast<Real>(). (cellDist is a Vector3i, that is why it must be cast to Real (Vector3r) for the matrix-vector product to be syntactically correct). > Or is there any other possibility to compute length of interaction in ScGeom > (or in GenericSpheresContact in general)? I would like to use function > Shop::stressTensorOfPeriodicCell() in new version of peri3dController when it > is tested, but currently this function is written only for Dem3DofGeom.. Great, great! We were actually just thinking, since there are now 4 implementations of computing stress tensor (one by Bruno in PeriTriaxController, another one by you in Peri3dController, your last one in Shop::stressTensorOfPeriodicCell and the last one by us (following Thornton) in Shop::normalShearStressTensor), it would be nice to show analytically that they are identical by doing some index gymnastics. Jan, you are very good for this kind of things, could you try to do that? If they are the same (they should be), we could make one single implementation; ideally, it would be able to provide both normal/shear and summary tensor. A choice left for the user is whether one takes the current contact length (particle distance) or the "reference" contact length (r1+r2 for ScGeom, refLength for Dem3DofGeom) as the particle distance. I don't know if some has ever compared results from both; and it has to do with the unfamous granular ratcheting as well. Cheers, enjoy your time! _______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

