<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="">Thanks, this makes (slightly) more sense to me know.<div class="">For some reason my application is still not acting properly but I must be screwing somewhere else the nested FieldSplit…</div><div class=""><br class=""></div><div class="">Thank you,</div><div class="">Pierre<br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 24 Mar 2019, at 11:42 PM, Dave May via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Matt is right.<div class=""><br class=""></div><div class="">When you defined the operator S, you basically invalidate the operator N (in the sense that they are no longer consistent). Hence when you use KSP nest to solve your problem your A matrix looks like </div><div class=""><div class=""> A = diag[1, 2, 4, 0, 8]</div></div><div class="">but the B matrix you have defined looks like</div><div class=""><div class=""> B = diag[1, 2, 4, 0.00001]</div></div><div class=""><br class=""></div><div class="">The only way to obtain the correct answer with your code is thus to use the option</div><div class="">-ksp_type preonly<br class=""></div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Dave</div><div class=""><br class=""><div class=""><br class=""></div></div></div></div></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 24 Mar 2019 at 22:09, Mark Adams via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank" class="">petsc-dev@mcs.anl.gov</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">I think he is saying that this line seems to have no effect (and the comment is hence wrong):<div class=""><br class=""></div><div class=""><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="font-family: "Courier New", Courier, monospace, arial, sans-serif; margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 14px;">KSPSetOperators(subksp[nsplits - 1], S, S);</pre></div><div class=""><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="margin-top:0px;margin-bottom:0px"><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="font-family: "Courier New", Courier, monospace, arial, sans-serif; font-size: 14px; white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px;">// J2 = [[4, 0] ; [0, 0.00001]]</pre><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="font-family: "Courier New", Courier, monospace, arial, sans-serif; font-size: 14px; white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px;"><br class=""></pre><font face="arial, helvetica, sans-serif" class="">J2 is a 2x2 but this block has been changed into two single equation fields. Does this KSPSetOperators supposed to copy this 1x1 S matrix into the (1,1) block of the "J2", or do some sort of correct mixing internally, to get what he wants?</font><br class=""></pre><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" class=""><br class=""></font></pre><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" class="">BTW, this line does not seem necessary to me so maybe I'm missing something.</font></pre><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" class=""><br class=""></font></pre><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="margin-top:0px;margin-bottom:0px"><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="font-family: "Courier New", Courier, monospace, arial, sans-serif; margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 14px;">KSPSetOperators(sub, J2, J2);</pre><pre class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-aLF-aPX-K0-aPE" style="font-family: "Courier New", Courier, monospace, arial, sans-serif; margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 14px;"><br class=""></pre></pre></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 24, 2019 at 4:33 PM Matthew Knepley via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank" class="">petsc-dev@mcs.anl.gov</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div dir="ltr" class="">On Sun, Mar 24, 2019 at 10:21 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:1px solid rgb(204,204,204);padding-left:1ex"><div class="">It’s a 4x4 matrix.<div class="">The first 2x2 diagonal matrix is a field.<div class="">The second 2x2 diagonal matrix is another field.</div><div class="">In the second field, the first diagonal coefficient is a subfield.</div><div class="">In the second field, the second diagonal coefficient is another subfield.</div><div class="">I’m changing the operators from the second subfield (last diagonal coefficient of the matrix).</div><div class="">When I solve a system with the complete matrix (2 fields), I get a different “partial solution" than when I solve the “partial system” on just the second field (with the two subfields in which I modified the operators from the second one).</div></div></div></blockquote><div class=""><br class=""></div><div class="">I may understand waht you are doing.</div><div class="">Fieldsplit calls MatGetSubMatrix() which can copy values, depending on the implementation,</div><div class="">so changing values in the original matrix may or may not change it in the PC.</div><div class=""> </div><div class=""> Matt</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class=""><div class="">I don’t know if this makes more or less sense… sorry :\</div><div class="">Thanks,</div><div class="">Pierre<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 24 Mar 2019, at 8:42 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-m_4707396507371526411gmail-m_-4800910044753334158Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">On Sat, Mar 23, 2019 at 9:12 PM Pierre Jolivet via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank" class="">petsc-dev@mcs.anl.gov</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I’m trying to figure out why both solutions are not consistent in the following example.<br class="">
Is what I’m doing complete nonsense?<br class=""></blockquote><div class=""><br class=""></div><div class="">The code does not make clear what you are asking. I can see its a nested fieldsplit.</div><div class=""><br class=""></div><div class=""> 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:1px solid rgb(204,204,204);padding-left:1ex">
Thanks in advance for your help,<br class="">
Pierre<br class="">
<br class="">
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-m_4707396507371526411gmail-m_-4800910044753334158gmail_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><br class=""></div></div></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail-m_8767326949575149941gmail-m_928777800623408844gmail-m_4707396507371526411gmail_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><br class=""></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>