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