Rewrite the force transfer of applyJT functions in the DiscreteCosserat mapping#159
Rewrite the force transfer of applyJT functions in the DiscreteCosserat mapping#159peyronq1 wants to merge 1 commit intoSofaDefrost:masterfrom
Conversation
…pressed in the global frame. Small change required in the computation of the tangentExp in the case of bending and twist only (the base linear def along X should be 1).
hugtalbot
left a comment
There was a problem hiding this comment.
Nice to see you PRing @peyronq1 🔥
My 2 cents review, I let @adagolodjo look more closely
| std::cout<<"Global F = " << global_F_Vec[s] <<" at s = " << s <<std::endl; | ||
| std::cout<<"temp = " << temp <<" at s = " << s <<std::endl; | ||
| std::cout<<"f = " << f <<" at s = " << s <<std::endl; |
There was a problem hiding this comment.
Possibly to remove or using msg API:
| std::cout<<"Global F = " << global_F_Vec[s] <<" at s = " << s <<std::endl; | |
| std::cout<<"temp = " << temp <<" at s = " << s <<std::endl; | |
| std::cout<<"f = " << f <<" at s = " << s <<std::endl; | |
| std::cout<<"Global F = " << global_F_Vec[s] <<" at s = " << s <<std::endl; | |
| std::cout<<"temp = " << temp <<" at s = " << s <<std::endl; | |
| std::cout<<"f = " << f <<" at s = " << s <<std::endl; |
| /* this->computeCoAdjoint( | ||
| m_nodesExponentialSE3Vectors[index], | ||
| coAdjoint); // m_nodesExponentialSE3Vectors computed in apply | ||
| F_tot = coAdjoint * F_tot; | ||
| F_tot = coAdjoint * F_tot;*/ |
| /*const auto _T = Frame(frame[childIndex].getCenter(), | ||
| frame[childIndex].getOrientation()); | ||
| Mat6x6 P_trans = (this->buildProjector(_T)); | ||
| P_trans.transpose(); | ||
|
|
||
| Mat6x6 co_adjoint; | ||
| this->computeCoAdjoint( | ||
| m_framesExponentialSE3Vectors[childIndex], | ||
| co_adjoint); // m_framesExponentialSE3Vectors[s] computed in apply | ||
| co_adjoint);*/ // m_framesExponentialSE3Vectors[s] computed in apply |
| /*Vec6 local_F = | ||
| co_adjoint * P_trans * | ||
| valueConst; // constraint direction in local frame of the beam. | ||
| valueConst;*/ // constraint direction in local frame of the beam. | ||
|
|
||
| /*Vec3 f = matB_trans * temp * | ||
| local_F; // constraint direction in the strain space.*/ |
| /*Mat6x6 coAdjoint; | ||
| this->computeCoAdjoint( | ||
| m_nodesExponentialSE3Vectors[i - 1], | ||
| coAdjoint); // m_nodesExponentialSE3Vectors computed in apply | ||
| CumulativeF = coAdjoint * CumulativeF; | ||
| // transfer to strain space (local coordinates) | ||
| // transfer to strain space (local coordinates)*/ | ||
|
|
alxbilger
left a comment
There was a problem hiding this comment.
I recommend to clean your code:
- Remove commented code
- Remove the traces (
cout)
| } | ||
|
|
||
| template <class TIn1, class TIn2, class TOut> | ||
| auto DiscreteCosseratMapping<TIn1, TIn2, TOut>::getTildeMatrix(const Vec3 &u) |
There was a problem hiding this comment.
Check if it is the same function than sofa::type::Mat::crossProductMatrix. If it is, you can remove this function and use crossProductMatrix instead.
Thank you! But don't congratulate me yet haha. We are working on improvements with Younes but I am not sure he expected me to do a PR on the master branch. I will look at this with him. Thank you for the review! |
|
just a gentle ping @peyronq1 |
Rewrite the force transfer of applyJT functions considering forces expressed in the global frame. Small change required in the computation of the tangentExp in the case of bending and twist only (the base linear def along X should be 1).