Open SustechShenCong opened 2 months ago
In this issue I only consider the shape of the matrix, not the detailed values!!!
Solution refers to https://github.com/sofa-framework/sofa/discussions/3134
I assume that you use MeshMatrixMass.
In MeshMatrixMass, the mass integration is distributed on vertices and edges. In a hexahedron, some vertices are not connected by edges. Therefore, this type of interaction is not taken into account in the mass matrix. And that is why, you see a lot more zeros in the matrix in SOFA.
I guess you will have more accurate results with tetrahedra, where this situation does not happen.
Thank you very much for your prompt reply! Your suggestions will be very helpful to me!
Another question, If there are some ways to extract the Constraints Matrix and "Internal Force Vector and its Jacobian". Some simple examples would be greatly appreciated!
There is a work in progress to extract the constraint matrix.
The internal force vector is available in the MechanicalObject, in the force
Data field (but it is merged with all the other forces).
Thank you very much for your reply!
In my work I need to extract the dynamical model from SOFA, i.e. extracting mass and stiffness matrices from SOFA. I follow the SOFA instructions which use "mass_matrix = root.mass.assembleMMatrix()" & "stiffness_matrix = root.force_field.assembleKMatrix()" to obtain the mass and stiffness matrices. My test example is a cube with 8 Square unit, which results 27 nodes, i.e. 81dofs. see The COMSOL result of mass matrix is below: The SOFA result of mass matrix is below: