JWock82 / PyNite

A 3D structural engineering finite element library for Python.
MIT License
421 stars 86 forks source link

Speed Improvement #189

Open angelmusonda opened 3 months ago

angelmusonda commented 3 months ago

During analysis, if the sparse option is on, PyNite performs partitioning of the stiffness matrix on scipy's lil_matrix(). This tends to be slow for large models. Noticeable improvement can be made if the partitioning is done on a csr_matrix or csc_matrix. According to scipy's documentation, the only advantage of lil_matrix over csr_matrix is faster construction and efficiency in the modification of the sparsity structure. Since the matrices are not undergoing further changes after partitioning, it is more efficient to convert directly from coo_matrix to csr_matrix before partitioning.

JWock82 commented 3 months ago

Thank you for bringing this up. I would like to look into this further. I've got a few other items to take care of first, but any suggestions that improve speed are something I'd like to take up for sure.