[petsc-dev] factortype and -pc_type lu

Pierre Jolivet pierre.jolivet at enseeiht.fr
Wed Aug 17 05:24:24 CDT 2016


Hello,
I slightly changed petsc/src/ksp/ksp/examples/tutorials/ex1.c by adding a simple call to MatSolve(A, b, x) before the destruction of x, b, and ksp.
If I do:
$ mpirun -np 1 ./ex1 -pc_type lu
I end up with:
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Object is in wrong state
[0]PETSC ERROR: Unfactored matrix
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision: v3.7.3-1165-gfeaa1dd  GIT Date: 2016-08-16 11:58:28 -0500

Is this the expected behavior? How should I call MatSolve?
The rationale for calling MatSolve instead of KSPSolve (for which there is obviously no error) is that I need to use MatMatSolve in my application—because there is no KSPSolve(KSP, Mat, Mat), and the behavior is the same for both MatSolve and MatMatSolve.

Thank you,
Pierre


More information about the petsc-dev mailing list