<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 19 Mar 2020, at 7:56 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Fri, Mar 13, 2020 at 11:20 AM Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" class="">pierre.jolivet@enseeiht.fr</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 13 Mar 2020, at 2:36 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Fri, Mar 13, 2020 at 3:19 AM Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank" class="">pierre.jolivet@enseeiht.fr</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 12 Mar 2020, at 11:40 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class="">On Thu, Mar 12, 2020 at 5:59 PM Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank" class="">jed@jedbrown.org</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank" class="">pierre.jolivet@enseeiht.fr</a>> writes:<br class=""><br class="">> Hello,<br class="">> Has there been any follow-up on this<span class=""> </span><a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/024020.html" rel="noreferrer" target="_blank" class="">https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/024020.html</a><span class=""> </span><<a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/024020.html" rel="noreferrer" target="_blank" class="">https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/024020.html</a>>?<br class="">> Given a 3x3 MatNest A = [A_00,0,0 ; 0,A_11,0 ; 0,0,A_22], I’d like to setup a two-way fieldsplit coupling [A_00,0 ; 0,A_11] and [A_22] but I can’t figure out the proper options.<br class=""><br class="">Are you looking for a Schur split or additive/multiplicative?</blockquote></div></div></div></blockquote><div class=""><br class=""></div><div class="">Don’t know yet which will perform best, do you have a specific solution in mind for one scenario or the other?</div><div class="">I was mostly wondering if it was possible in a general context, not taking -pc_fieldsplit_type into account.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class="">-pc_fieldsplit_field_0 0,1 -pc_fieldsplit_field_1 2 -pc_fieldsplit_type schur</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">These flags, used with my .cpp, yield:</div><div class=""><div class="">[0]PETSC ERROR: Arguments are incompatible</div><div class="">[0]PETSC ERROR: To use Schur complement preconditioner you must have exactly 2 fields</div><div class="">If I use -pc_fieldsplit_%d_fields <a,b,..> as advocated in the manual (instead of -pc_fieldsplit_field_%d as you suggested), I get the same error.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Okay it is  -pc_fieldsplit_%d_fields. When you use this, how many fields does it think you have?</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Three.</div><div class="">In case it’s not clear, the MWE is at the bottom of my first email (nest.cpp).</div><div class="">$ mpicxx nest.cpp -I$PETSC_DIR/$PETSC_ARCH/include -I$PETSC_DIR/include -L$PETSC_DIR/$PETSC_ARCH/lib -lpetsc</div><div class="">$ ./a.out -pc_type fieldsplit -pc_fieldsplit_0_fields 0,1 -pc_fieldsplit_1_fields 2 -pc_fieldsplit_type schur</div><div class="">[…]</div><div class=""><div class="">[0]PETSC ERROR: Arguments are incompatible</div><div class="">[0]PETSC ERROR: To use Schur complement preconditioner you must have exactly 2 fields</div><div class="">[…]</div><div class=""><div class="">   <span class="Apple-converted-space"> </span>Split info:</div><div class="">   <span class="Apple-converted-space"> </span>Split number 0 Defined by IS</div><div class="">   <span class="Apple-converted-space"> </span>Split number 1 Defined by IS</div><div class="">   <span class="Apple-converted-space"> </span>Split number 2 Defined by IS</div><div class="">[…]</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I see now. If you call PCFieldsplitSetIS(), this overrides anything else. We do not even try to discover the split. If you want</div><div class="">a split determined by command line arguments, you have to defer the split. It looks like it can get splits from the MatNest,</div><div class="">so just do not call SetIS().</div></div></div></div></blockquote><div><br class=""></div><div>So, I’ve commented the three PCFieldSplitSetIS.</div><div>$ ./a.out -pc_type fieldsplit -pc_fieldsplit_0_fields 0,1 -pc_fieldsplit_1_fields 2 -pc_fieldsplit_block_size 3</div><div>is starting to give me something meaningful in the KSPView, i.e.:</div><div>[…]</div><div>  Split number 0 Fields  0, 1</div><div>[…]</div><div>  Split number 1 Fields  2</div><div>But it’s surrounded by a bunch of errors such as:</div><div><div>[0]PETSC ERROR: Arguments are incompatible</div><div>[0]PETSC ERROR: Could not find index set</div><div><br class=""></div><div>Do I need some other command-line options?</div><div><br class=""></div><div>Thanks,</div><div>Pierre</div></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="gmail_quote"><div class=""> <span class="Apple-converted-space"> </span>Thanks,</div><div class=""><br class=""></div><div class="">     Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><div class=""><div class="">Thanks,</div><div class="">Pierre</div></div></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class=""><div class="gmail_quote"><div class="">   Matt</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class="">I believe.</div><div class=""><br class=""></div><div class="">   Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">> Jed, in this answer<span class=""> </span><a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/023993.html" rel="noreferrer" target="_blank" class="">https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/023993.html</a><<a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/023993.html" rel="noreferrer" target="_blank" class="">https://lists.mcs.anl.gov/pipermail/petsc-users/2015-January/023993.html</a>>, you recommend not to use MatNest. What would you recommend instead?<br class=""><br class="">See src/snes/examples/tutorials/ex28.c for my preferred approach.</blockquote></div></div></div></blockquote><div class=""><br class=""></div><div class="">I’m not using DM, so in terms of Mat, I guess this example shows that I pretty much need to reimplement the field splitting myself?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pierre</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">--<span class=""> </span><br class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></body></html>