Skip to main content

sparse matrix

On efficient finite element assembly in Matlab

Submitted by Alejandro Orti… on

As we all know, finite element matrices are sparse and many memory can be saved if their sparsity is exploited. Due to the latter, we are often provoked to declare the nxn stiffness matrix as a sparse one just before the element loop. Be careful of this method since the larger the matrix the slower the assembly operations. There is a better and more efficient way to code the assembly procedure in Matlab. I will show how to accomplish this. For the sake of simplicity, the stiffness matrix of the two-dimensional heat conduction problem on the domain (0,1)x(0,1) is considered.