User-difined PC

Dave May dave.mayhem23 at gmail.com
Mon Sep 22 07:59:50 CDT 2008


Michel,
    I noticed a few things. Not sure any would cause an error, but

1) You should hand control of destroying the user data type to the
PCSEHLL via PCShellSetDestroy().

2) I would also let the PCSHELL decide when the object should be setup
by calling PCShellSetSetUp(). I suppose you will need to add a
reference to A or the PC on each of your context's so you are able to
extract the blocks.

Why is the first pointer in PCSHELL operations the user context
whereas in MATSHELL the first pointer is of type Mat ?? Seems slightly
inconsistent.

3) I would call MatDestroyMatrices() rather than just destroying the
individual matrices. The array of matrices is not being released in
your code.

Cheers,
    Dave



On Mon, Sep 22, 2008 at 8:31 PM, Michel Cancelliere
<fernandez858 at gmail.com> wrote:
> Hello,
>
> I have problems with the implementation of a user-defined pc, basically my
> program is in a cycle, for with which he is called by matlab each time it
> seeks to solve a linear system, the problem is that in the first iteration
> of the for-cycle  the preconditioner works very well, then fails to
> convergence. It may be some parameters that I setting wrong?
> I'am attaching my program code.
>
> Thank you,
>
> Michel
>




More information about the petsc-users mailing list