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 <[email protected] <mailto:[email protected]>> 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

Reply via email to