[petsc-dev] factortype and -pc_type lu

Hong hzhang at mcs.anl.gov
Wed Aug 17 09:39:24 CDT 2016


Pierre:
See petsc/src/ksp/ksp/examples/tests/ex27.c on how to use MatMatSolve().
Hong

On Wed, Aug 17, 2016 at 9:34 AM, Hong <hzhang at mcs.anl.gov> wrote:

> Pierre:
>
>>
>> [0]PETSC ERROR: Object is in wrong state
>> [0]PETSC ERROR: Unfactored matrix
>>
>
> indicates that your input matrix is an  Unfactored matrix.
>
> If you want to replace KSPSolve() with your own MatMatSolve, you need use
> following blocks
> to replace KSPSolve() :
> Mat F;
>   ierr = KSPGetPC(ksp,&pc);
>   ierr = PCFactorSetMatSolverPackage(pc,MATSOLVERPETSC);
>   ierr = PCFactorSetUpMatSolverPackage(pc); /* call MatGetFactor() to
> create F */
>   ierr = PCFactorGetMatrix(pc,&F);
>   ierr = KSPSetUp(ksp);
>   ierr = MatSolve(F,b,x);
>
> Hong
>
>
>
>> [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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160817/bcc29940/attachment.html>


More information about the petsc-dev mailing list