<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 2, 2013 at 6:31 AM, Lawrence Mitchell <span dir="ltr"><<a href="mailto:lawrence.mitchell@imperial.ac.uk" target="_blank">lawrence.mitchell@imperial.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 2 Dec 2013, at 12:23, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
<br>
> On Mon, Dec 2, 2013 at 2:26 AM, Lawrence Mitchell <<a href="mailto:lawrence.mitchell@imperial.ac.uk">lawrence.mitchell@imperial.ac.uk</a>> wrote:<br>
> Dear petsc-users,<br>
><br>
> I have a 3x3 block system built as a single MatNest (with 9 Mats in it).  I'd like to treat this as a 2x2 system:<br>
> [ A B<br>
>   C D ]<br>
><br>
> where A is 2x2 and precondition the A block with a schur complement.  Since I have a mat nest, the ISes for the three fields are just ISCreateStride(..., mat_i_rows, offset, 1, ...) and these are set on the fieldsplit pc.  If I understand the documentation correctly, I think I should now be able to do:<br>

><br>
> -pc_type fieldsplit -fieldsplit_0_fields 0,1 -fieldsplit_1_fields 2 -fieldsplit_0_pc_type field split -fieldsplit_0_pc_fieldsplit_type schur<br>
><br>
> ...<br>
><br>
> However, when doing so, I get an error: "To use Schur complement preconditioner you must have exactly 2 fields".  Which suggests to me I have failed to inform PETSc that I want the first two fields to be treated as 1.<br>

><br>
> Note that I am not using a DM to build any of these objects.  I build a SNES, pull the KSP out of the SNES and then the PC out of the KSP.  I never explicitly call SetFromOptions on the PC.  Instead, before the SNES solve I call SNESSetFromOptions.  Might this be the problem?<br>

><br>
> This is an unfortunately limitation of the implementation right now. This option works if you are on a DA with collocation, or if you<br>
> use a DM, but not if you just specify the ISes. We should probably write that code. However, the idea is for people to be moving<br>
> to using DM. Could you tell us why DM did not work for you here?<br>
<br>
</div>At the moment, our mesh infrastructure is not plumbed in to use petsc data structures.  We're attempting to migrate to dmplex at the moment but currently we're building Mats from third-party connectivity information.  It's possible that the move to dmplex will happen soon enough that it isn't a big issue, but I don't know the timescales on which we'll be done with that.<br>
</blockquote><div><br></div><div>I was feeling bad about not implementing this, but I remembered the problem with the pure IS solution. The obvious solution</div><div>is to just combine several ISes to create the field for PCFIELDSPLIT. However, once this is done, they lose their identity as</div>
<div>separate fields. Thus, it is not possible to untangle for the second level of FieldSplit that you want. The DM version maintains</div><div>the field identity at the next level so that we can split hierarchically. So, for the above to work, I think you must use a DM.</div>
<div><br></div><div>  Thanks,</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">
Cheers,<br>
<br>
Lawrence</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>