I have been extending my code to work with 2-D geometry problems, which, from the perspective of the dss routines, results in a larger linear system with some additional non-zero elements. The 1-D geometry results in a penta-diagonal system while the 2-D geometry results in a system with 13 diagonals. The only diagonal that has no zero elements is the main diagonal, which has a value of 1. The other diagonals contain zero and non-zero elements. The matrix is square but it is not symmetric.
The structure of the sparse array from a row perspective has five values. In some cases, it is possible that one of those five values to be zero. When that is the case, the MKL routine dss_factor_real raises a "Zero Pivot detected" error.
I added a routine that uses the row index, columns, and values arrays to write the sparse matrix to a file (in dense form). The matrix has the proper structure, so I am confident that I am populating the three arrays properly. I can also successfully invert the matrix in Mathematica, so I know it is not singular.
If I run the program so that most of the five values per row are non-zero, then dss_factor_real works correctly.
How can I better diagnose why dss_factor_real is generating a "Zero Pivot Detected" error. The only cause I can think of for the "Zero Pivot Detected" error is because the determinant is small, e.g. 2E-6. The only problem with that conclusion is that the determinant is also small when it does work.
链接已复制