Barry,

This was my original idea before I started trying pccomposite stuff.
I will stick to it, thank you for pointing it out.

On 17.08.2012 22:34, Barry Smith wrote:
> On Aug 17, 2012, at 8:54 AM, Alexander Grayver <agrayver at gfz-potsdam.de> 
> wrote:
>
>> you want to compute c?
>> I was planning to do it inside ShellPCApply.
>> The correction itself is calculated as a solution of Poisson equation with 
>> rhs being divergence of current density and current density is calculated 
>> based on x_i
>
>       A preconditioner step can only be written in the form      c  =  B(b  - 
> A x_i)     where B is any linear operator and b is the right hand side and A 
> is the original operator.  So if your calculation of c of this form (note 
> that you need not form B explicitly as a sparse matrix but it must be some 
> linear operator. From you description above "with rhs being divergence of 
> current density and current density is calculated based on x_i" I suspect it 
> cannot be written in this form.
>
>      The way to write this is
>
>       KSPSetInitialGuessNonzero(kspmain);
>       KSPSetTolerance(kspmain,    set number of inner iterations you wish to 
> use before the "filtering step"
>        for j=1,?.. number outer iterations
>                 KSPSolve(kspmain,b,x)
>                 compute    rhs via "rhs being divergence of current density 
> and current density is calculated based on x_i"
>                 KSPSolve(ksppoisson,rhs,c)
>                x = x + c
>        endfor
>
>      I don't think you can, or want to "munge" it into some kind of single 
> complicated KSPSolve

-- 
Regards,
Alexander

Reply via email to