<div dir="ltr">On Mon, Aug 19, 2013 at 7:40 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">"Garth N. Wells" <<a href="mailto:gnw20@cam.ac.uk">gnw20@cam.ac.uk</a>> writes:<br>

<br>
> I'm using PCFIELDSPLIT for a mixed problem, with fields indicated via<br>
> an index set (using PCFieldSplitSetIS). I'd like to attach an<br>
> approximate null space to the A00 block of the system. Is there a way<br>
> to attach the null space to one block?<br></div></div></blockquote><div><br></div><div>There is a better way. You can attach the null space to the IS that forms the split</div><div><br></div><div>  PetscObjectAttach((PetscObject) is0, "nullspace", nullspace);</div>
<div><br></div><div>and PCFIELDSPLIT will pull it out and attach it to the preconditioner for block 0.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">
</div></div>With MatNest, you can use MatSetNearNullSpace on sub-blocks and it will<br>
be used automatically.  This is also the low-memory way to use<br>
PCFieldSplit.  Note that if you use MatSetValuesLocal, you can use the<br>
NEST format with identical code in assembly; only matrix creation is<br>
different, see src/snes/example/tutorials/ex28.c for an example that<br>
works with both AIJ and NEST formats.<br>
<br>
Otherwise, you should be able to PCSetUp, then get out the sub-solvers<br>
PCFieldSplitGetSubKSP, pull out their matrices, and call<br>
MatSetNearNullSpace.  Those submatrices should not be overwritten as<br>
long as you use SAME_NONZERO_PATTERN, so the null space would still work<br>
in future iterations.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>