User-difined PC

Barry Smith bsmith at mcs.anl.gov
Mon Sep 22 11:18:38 CDT 2008


On Sep 22, 2008, at 11:14 AM, Dave May wrote:

> Having the first argument for PCSHELL operations being PC sounds  
> great.
> That's in keeping with the petsc pattern of the first argument being
> the object being manipulated.
> Then users just call PCShellGetContext() within their user defined  
> operations.
>
    I think one of the motivators for the current approach is usage  
from Fortran 77.
PCShellGetContext() cannot return much of anything in Fortran 77, not  
even an array :-(
while an array can be passed into the PCApply etc Fortran  
implementations directly
as the first argument.

    This is unlikely to be a good enough reason for keeping the  
current form,
especially since Fortran 90 has some (not perfect) alternatives.

     Barry

>
> On Tue, Sep 23, 2008 at 2:08 AM, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>>
>> On Sep 22, 2008, at 7:59 AM, Dave May wrote:
>>
>>>
>>>
>>> Why is the first pointer in PCSHELL operations the user context
>>> whereas in MATSHELL the first pointer is of type Mat ?? Seems  
>>> slightly
>>> inconsistent.
>>>
>>  Good question, these were done at different times and only later
>> did we realize the inconsistency. This is something that should be  
>> fixed in
>> petsc-dev.
>>
>>  Barry
>>
>> I guess the first argument for the PCSHELL should become the pc.
>>
>>>
>>>
>>> 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