[petsc-users] Matrix-free preconditioner using shell matrix

Praveen C cpraveen at gmail.com
Fri May 18 23:23:45 CDT 2018


Thanks Barry and Jed.


> On 18-May-2018, at 10:35 PM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
> 
>   This is wrong. If you have a ApplyPC you need to attach it to the PC not the mat. So you would have 
> 
>       SNESGetPC(snes,&pc);
>       PCSetType(pc,PCSHELL);
>       PCShellSetAppy(pc,ApplyPC)


I am now setting up with PCSHELL, but face a doubt on Mat objects.

So in my case (-snes_mf and PCSHELL), I dont have any jacobian and precond matrix. In fortran should I do something like this

call TSSetRHSJacobian(ts, PETSC_NULL_MAT, PETSC_NULL_MAT, RHSJacobian, ctx, ierr)

But this gives segmentation violation when TSSetRHSJacobian is called.

Thanks
praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180519/29bc8086/attachment.html>


More information about the petsc-users mailing list