This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Throwing And Catching Dolfin Errors

+1 vote

I am using FEniCS to locate a bifurcation point. At this point FEniCS spits out the error:

Warning: UMFPACK reports that the matrix being solved is singular.

This is good; this is exactly what I want. But I need to be able to catch this error and stop my problem when this error is detected. What happens instead is that the problem keeps running consistently printing this error and then eventually terminates. I want to detect this error, stop the solver, and then add the model parameters to an array. The system isn't producing an error I can catch in the usual sense though. Does anyone know how I can make this detection?

Thanks,
Eric

asked Mar 20, 2014 by singfadamoment FEniCS Novice (170 points)

Hi, are you using python or cpp version?

I am using the Python version.

Any thoughts?

Hi, sorry for late response. I don't think you can do anything from the Python side because many methods of the UmfpackLUSolve are hidden there. However from cpp you could use umfpack_check_status method - there is a status value which indicates singular matrix.

...