- This topic has 7 replies, 5 voices, and was last updated 3 years, 1 month ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › Extraction of the equation , mass and stiffness matrix of liver from SOFA
Hi،
I started working with Sofa recently.
I want to extract the equation, the mass matrix and the stiffness matrix of the liver model from the SOFA. How can I achieve them?
I want to solve its equations in a way other than fem.
Thank you
Hi Sahar,
sorry but I don’t know how to extract the properties you want. I only know how to extract positions, velocities, forces and energies using Monitor
and ExtraMonitor
.
Here you have the documentation.
I hope it helps.
Cheers,
Juan.
Hi,
first you need to know that a matrix is not always built. When a template parameter GraphScattered is used in a linear system, it means the matrix is not built. It is for example possible for a conjugate gradient algorithm, where a matrix-vector product is directly computed.
In the cases where the system matrix is built, I am not aware of a way to extract local matrices (mass or force fields). The reason is that mass and force fields directly push their contributions into the global system matrix. It avoids to build local matrices and unnecessary copies.
If you want to extract the global system matrix, it is built here: https://github.com/sofa-framework/sofa/blob/027635f0f0157700f2a01d5bb90afc5802e5f0cb/SofaKernel/modules/SofaBaseLinearSolver/src/SofaBaseLinearSolver/MatrixLinearSolver.inl#L144
You can print it just after if you want.
Your question is legitimate, and we are working towards the possibility to extract matrices. But it is not yet ready. Stay tuned.
Hope it helps.
Alex
You can have a look on https://github.com/sofa-framework/sofa/pull/2303.
The component GlobalSystemMatrixExporter allows to export the global linear system to solve.
Alex
Hi @alexbilger,
I am very interesting by the different components of your two previous answers. If I want to use them, do I have to build the last version of SOFA or is it possible do get it with my current SOFA v19.06. version.
Cheers,
Benjamin
GlobalSystemMatrixExporter is now part of Sofa in its master branch. But it is not yet in any release. It will be in v21.12.
Ok thank you for this information.
Cheers,
Benjamin
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.