adding SNESSetLinearSolve()

Matthew Knepley knepley at gmail.com
Mon Oct 29 14:49:10 CDT 2007


On 10/29/07, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> In practice, the only way to wrap any solver package is
> KSPPREONLY+PCSHELL. And you actually implement the linear solve in PC,
> not KSP.

I disagree here. See below.

> If PETSc internals were implemented in C++, I would simply do:
>
> MyKSP: public KSP {
> void solve(Vec b, Vec x) {
>    /* do something */
>    KSP::solve(b1,x1)
>    /* do more*/
>    KSP::solve(b2, x2)
>   /* fill result */
>   x = ...
> }
> }
>
> But with the current implementation in C, this is possible but not so
> easy to do.

Since this seems specific to this application, why not just make a custom
KSP implementation that does exactly the above. It would probably also
need a SetFromOptions() that configures the two subKSPs.

  Matt

> --
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
-- 
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




More information about the petsc-dev mailing list