Home › Forum › SOFA › Using SOFA › [SOLVED] What is the mechanism of BilateralInteractionConstraint?
Tagged: 64_bits, constraint, SOFA_1512, Windows_7
- This topic has 1 reply, 2 voices, and was last updated 5 years, 8 months ago by Hugo.
-
AuthorPosts
-
20 July 2016 at 13:44 #7220WongBlocked
Hello everyone,
I wanted to know more about the mechanism and the theory of the constraint component but later I found the code so hard to comprehend.
Then I noticed the post https://www.sofa-framework.org/community/forum/topic/how-to-create-bilateral-constraint/ . Eventually, I understood a part of the component BilateralInteractionConstraint. Three functions are important: buildConstraintMatrix, getConstraintViolation and getConstraintResolution.
But currently, I still cannot really understand some content of the BilateralInteractionConstraint.
The function buildConstraintMatrix has two parameters:DataMatrixDeriv &c1_d, DataMatrixDeriv &c2_d. What is the specific form(or data structure) of the type DataMatrixDeriv? I think the method c1_it.addCol must be use in to add constraints in function buildConstraintMatrix.But its utility is flexible:
MatrixDerivRowIterator c2_it = c2.writeLine(cid[pid]);
c2_it.addCol(tm2, cx); (in BilateralInteractionConstraint.inl)MatrixDerivRowIterator c2_it = c2.writeLine(cid[pid]);
c2_it.addCol(tm2, Deriv(cx, vZero)); (in BilateralInteractionConstraint.cpp)MatrixDerivRowIterator c2_it = c2.writeLine(cid);
c2_it.addCol(tm2a, -dir1 * (1-r2));
c2_it.addCol(tm2b, -dir1 * r2); (in SlidingConstraint.inl)And I do not konw the type DataMatrixDeriv and DataMatrixDeriv.
Likewise,in getConstraintResolution, BilateralConstraintResolution is flexible:
resTab[offset] = new BilateralConstraintResolution3Dof(&prevForces[pid]);(in BilateralInteractionConstraint.inl)
resTab[offset] = new BilateralConstraintResolution3Dof();(in BilateralInteractionConstraint.cpp)
resTab[offset++] = new BilateralConstraintResolution();(in SlidingConstraint.inl)
And I also cannot understand the parameter &prevForces[pid].
Maybe it is just because I do not know the solving process of the constraint. So I want to understand the theory of the constraint solvers.
For instance, what is the meaning of the equation trans(H).A.H λ = trans(H).y – d ?(at https://www.sofa-framework.org/community/forum/topic/how-to-create-bilateral-constraint/)
And the code about solving process is not in the constraint component. Need I read the code of the GenericConstraintSolver?
What kind of reference can I find some content about constraint or constraint solver in?
Any help and hits are appreciated.
Wong
25 February 2019 at 18:22 #13116HugoKeymasterDear @outtt
This thread is very old and a doc page is now available.
I close it.
Open a new one if you have further issue.Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.