0

In Finite element method, for making sparse matrix of tangent stiffness matrix we should know the number of nonzero terms because, I am using language : C.

I could not find an optimal algorithm to find the number of nonzero terms using "element connectivity".

Can someone tell me which algorithm to get the number of nonzero terms by using element connectivity, or a library built for this purpose?

For example full index of global tangent matrix is {1, 2, 3, 4}. the element connectivity is like below 1st element - 1 2, 2nd element - 2 3, 3rd element - 3 4. so I just got the element connectivity and then I should make sparse matrix of global tangent matrix in that case How can I get the number of nonzero terms efficiently??

Song
  • 13
  • 3
  • Why exactly you do need nonzero count for stiffness matrix? AFAIK usually total number of non-zeros is not used for assembling global stiffness matrix... – epsi1on May 25 '21 at 04:40
  • In CSR format , I should know the number of non zero terms. And also the nonlinear boundary condition problem such as contact problem, the number of nonzero terms are changing depending on the external force. – Song May 26 '21 at 05:04
  • I think this is not the way that usual FEM codes do. Coding Sparse matrices are far more complicated than dense matrices, so developer usually use ready to use tools. for this example i think you should use CoordinateStorage to first calculate the members, then convert it into CSR format...I think you should first choose a sparse matrix library, what programming language do you work with? – epsi1on Jun 02 '21 at 14:04

0 Answers0