- Thank you received: 6
Safty check for matrix inversion
- Guosheng Fu
- Topic Author
- Offline
- Elite Member
Less
More
5 years 1 month ago #1925
by Guosheng Fu
Safty check for matrix inversion was created by Guosheng Fu
Hello,
When umfpack direct solver fails to factorize the linear system (due to singularity), the code simply crashes.
Is there a safer way to proceed other than producing the following error message and exit the code?
I noticed pardiso solver will still proceed with the factorization, but producing nan values.
Best,
Guosheng
When umfpack direct solver fails to factorize the linear system (due to singularity), the code simply crashes.
Is there a safer way to proceed other than producing the following error message and exit the code?
Code:
netgen.libngpy._meshing.NgException: UmfpackInverse: Numeric factorization failed.
Best,
Guosheng
- mneunteufel
- Offline
- Premium Member
Less
More
- Thank you received: 59
5 years 1 month ago #1927
by mneunteufel
Replied by mneunteufel on topic Safty check for matrix inversion
Hi Guosheng,
you can use the try - except syntax of Python
Then the code does not exit.
Best,
Michael
you can use the try - except syntax of Python
Code:
try:
a.mat.Inverse(fes.FreeDofs(), inverse="umfpack")
except:
print("Singular matrix")
#...
Then the code does not exit.
Best,
Michael
Time to create page: 0.100 seconds