Possible identification of Yucang's new implementation bug
Hello, I do not know if I should use the bug report tool or this is the adecuate channel.
Reading the code of RotFricInteract
The piece of code is (I will insert comments in the code)
/**
* Yucang's new implementation which takes into
* account rigid body rotaton of two particles.
* Unit tests failing for this implementation.
*/
void CRotFrictionInt
{ //cout << "wyc in RotFric:: calcF " <<endl;
Vec3 pos;
Vec3 force;
Vec3 dv,ds ;
Vec3 d_Ffric ;
// calculate distance
//*****
Vec3 D=m_p2-
//**** this line is different than in other modules. It defines D as a vector that goes from particle 1 to particle 2
//**** In other parts including the working implementation is defined as the opposite: particle 2 to particle 1
double dist=D*D;
double eq_dist=
// check if there is contact
if(dist<
//--- elastic force ---
dist=
force=
m_normal_
//*****
pos=
//** Here is the problem ... as D goes from 1 to 2, the vector D/eq_dist is a unit vector from 1 to 2, so the vector
//** pos points to one point in the opposite part of the sphere than the contact.
Then as the rest of the code seems to work like the others, the forces are applied in a wrong point.
By the way, I've tested the interaction law with a relative velocity dependent damping and it works. Gives the 'correct' restitution coefficient. I say 'correct' because as indicated in the book of Poschel, in eliminating the attractive forces during the contact, the restitution coefficient is somewhat bigger than the theoretical.
I'm waiting impatiently the tutorial for implementing these new interaction laws because unfortulately I can not assist to the course in Aachen.
Regards,
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Diego Peinado Martín
- Solved:
- Last query:
- Last reply: