[petsc-users] matrix-free method with preconditioning for a linear system

Lailai Zhu lailaizhu00 at gmail.com
Tue Aug 9 11:11:46 CDT 2016


hi, Dear Matt,

thanks very much. I think I found the problem, in the pcshell part, i was
using 'MatGetDiagonal' which is not supported for the shell-type matrix. 
This
caused the problem.

best,
lailai

On 2016/8/9 17:57, Matthew Knepley wrote:
> On Tue, Aug 9, 2016 at 10:27 AM, Lailai Zhu <lailaizhu00 at gmail.com 
> <mailto:lailaizhu00 at gmail.com>> wrote:
>
>     Hi, dear developers,
>
>     I am currently facing such a problem. I would like to use a
>     matrix-free
>     method to solve a linear system. So I use 'MatCreateShell' with
>     user-defined
>     subroutine to evaluate matrix-vector product. This works well, but
>     is much slower
>     than the traditional matrix-assembling approach where different
>     preconditioning
>     can be applied.
>
>     Now I would like to build a user-defined preconditioning for this
>     matrix-free approach,
>     then I used to 'PCSHELL'. However, petsc told me that
>     '[0]PETSC ERROR: No support for this operation for this object type
>     [0]PETSC ERROR: Mat type shell'.
>
>
> Send the ENTIRE error message. You should get a stack trace, which 
> tells us where this
> is happening. Make sure you are checking all return values using 
> CHKERRQ().
>
>   Thanks,
>
>      Matt
>
>     I am using petsc 3.7.2. It seems that this user-defined PC is not
>     supported with the 'MatCreateShell'. Is this
>     indeed the case? Is there any way to circumvent this, for example
>     by using 'MatCreateMFFD'
>     or a SNSE artificially for a linear problem?  Thanks in advance,
>
>     best,
>     lailai
>
>
>
>
> -- 
> What most experimenters take for granted before they begin their 
> experiments is infinitely more interesting than any results to which 
> their experiments lead.
> -- Norbert Wiener

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160809/f5c4211c/attachment.html>


More information about the petsc-users mailing list