← Back to team overview

yade-dev team mailing list archive

Re: Contact damping

 

Hi Chiara,

I have a better suggestion that would not need a new class. You could add a variant of ScGeom::rotateAndGetShear() that would return incident velocity instead of shear increment. It will not be a big deal to compute normal and shear increments in your constitutive law if you have incident velocity, so you don't have to use getShear. Currently, ScGeom::rotateAndGetShear() has two parts : one is rotating a vector, the other is returning shear increment. The best would be to split all that in three functions : rotate, getShear, and getIncidentVel, so I think everything could be computed only once even in your case. You could for now try and implement rotate/getIncidentVel, and let rotateAndGetShear be as it is now since removing it will need to commit changes in many classes. Later it will have to be splitted as well, which will need to commit (minimal) changes in all functors using it.

Cheers.

Bruno


The best would be to split that into two functions :

All I would need is the relativeVelocity to compute incidentVn and incidentVs, having the normal. If I inherit from ScGeom, relativeVelocity is not a member of it. So how would you access it?

class ScGeomWithVel: public ScGeom: {
...
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(ScGeomWithVel,ScGeom,....
       ((Vector3r,incidentV,"incident velocity. |ycomp|"))
}

Vector3r ScGeomWithVel:::rotateAndGetShear(){//I'd have to make it virtual in ScGeom too, not a problem
   ...
Vector3r relativeVelocity = (rbp2->vel+rbp2->angVel.cross(c2x)) - (rbp1->vel+rbp1->angVel.cross(c1x));
   relativeVelocity+=shiftVel;
incidentV = relativeVelocity; <------------------------------------------ updating your variable here
   //keep the shear part only
relativeVelocity = relativeVelocity-normal.dot(relativeVelocity)*normal;
   ...
}

Later in the constitutive law, you just access ig->incidentV.
Other suggestions?

Bruno



_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp



--
_______________
Bruno Chareyre
Associate Professor
Grenoble INP
Lab. 3SR
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43
________________




Follow ups

References