<div class="gmail_quote">On Tue, Mar 13, 2012 at 07:32, Klaij, Christiaan <span dir="ltr"><<a href="mailto:C.Klaij@marin.nl">C.Klaij@marin.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":117">Thanks, I get the idea now and changed the code to:<br>
<br>
KSP *subksp;<br>
<div class="im"> PetscInt n=2;<br>
ierr = PCFieldSplitGetSubKSP(pc,&n,&subksp); CHKERRQ(ierr);<br>
<br>
</div>which removes the compiler error but gives the following runtime<br>
error in MatSchurComplementGetKSP():<br>
<br>
[0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
[0]PETSC ERROR: Null argument, when expecting valid pointer!<br>
[0]PETSC ERROR: Null Object: Parameter # 1!</div></blockquote></div><br><div>You have to have set the matrix and called PCSetUp() for this inner context to have been created. This is an unfortunate property of nested methods (with every programming system I know of), it's difficult to bootstrap so that a certain inner object is configured without setting up more than is strictly necessary. If it's just the constant null space, then you can do it on the command line. Note that with petsc-dev, you can use MatSetNullSpace() and it will be used by the KSP, thus avoiding the need to drill down into the KSP like this.</div>