<div dir="ltr"><div dir="auto"><div dir="auto">Thanks Matt - I was trying to write it in linear algebra notation, but the nature of the problem might produce some confusion.  <span class="gmail_default" style="font-size:small">I was also originally a bit confused by a fairly major typo in the paper I was following, but I'm almost sure I have it clear now.  </span>I'll try to be concise<span class="gmail_default" style="font-size:small"> - the meat is in the last two paragraphs.</span><div dir="auto"><br></div><div dir="auto">My system of nonlinear equations, F(x)=0, has dimension m.  Traditional methods for solving, like Newton's method, tend to reach points at which the Jacobian becomes singular.  I'm trying the homotopy trick, which involves introducing an additional scalar variable, s, and solving the system H(x,s) = sF(x) + (1-s)(x-x_0), starting at s=0 and following the zero curve to, hopefully, a solution at s=1.</div><div dir="auto"><br></div><div dir="auto"><span class="gmail_default" style="font-size:small">The homotopy map </span>H only has m components, so its Jacobian J is m x (m+1), and has rank m.  I need to find a vector <span class="gmail_default" style="font-size:small">u</span> in its null space: J <span class="gmail_default" style="font-size:small">u</span> = 0.  Note that <span class="gmail_default" style="font-size:small">u</span> is size m+1.  <span class="gmail_default" style="font-size:small">Rather than solve J u = 0, I make an augmented matrix A, which is (m+1)x(m+1), and consists of J in its first m rows, then a somewhat arbitrary vector </span><span class="gmail_default" style="font-size:small">in the last row.  Then the vector u is the solution to A u = b, where b is zero everywhere except its last element.  This solve seems to be working fine.</span></div><div dir="auto"><span class="gmail_default" style="font-size:small"><br></span></div><div><span class="gmail_default" style="font-size:small">The SNES should then solve for a particular solution y of the Newton update, J y = - H(y).  A (unique) particular solution can also be found by solving A y = [-H(y) 0]^T.  Finally - and this is the step I can't figure out how to implement properly, I want to find the norm-minimizing solution z for the Newton update:</span></div><div><span class="gmail_default" style="font-size:small">z = y - u(y^T u)/(u^T u).<br></span></div><div dir="auto"><span class="gmail_default" style="font-size:small"><br></span></div><div><span class="gmail_default" style="font-size:small">I doubt there is any way to do this elegantly within the existing routines, because u is not in the nullspace of A.  Rather, it's in the nullspace of J, which is the submatrix I care about.  I think what I need is a way to just apply the orthogonal projection in the preceding paragraph, after the SNES solves the linear system but before the Newton update is applied.  I don't know the SNES internals well at all.  Is it possible to hook this in somehow, or put it in an existing function?</span></div><div><span class="gmail_default" style="font-size:small"><br></span></div><div><span class="gmail_default" style="font-size:small">Thanks again for all your help.<br></span></div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Oct 1, 2018 6:49 AM, "Matthew Knepley" <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br type="attribution"><blockquote class="m_-4914772938043270241m_-1442225393396874495quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div class="m_-4914772938043270241m_-1442225393396874495elided-text"><div dir="ltr">On Sun, Sep 30, 2018 at 6:06 PM zakaryah <<a href="mailto:zakaryah@gmail.com" rel="noreferrer" target="_blank">zakaryah@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">OK, thanks.</font></div><div><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">I'm using a composite DM, DM_packer.  To make a separate KSP, I did the following in the FormJacobian() routine, after assembling the Jacobian matrix A and the RHS for the tangent vector, b:</font></div><div><ul><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">KSPCreate(PETSC_COMM_WORLD,&ksp)</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">KSPSetDM(ksp,DM_packer)</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">KSPSetDMActive(ksp,PETSC_FALSE) - because I want to set the operators</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">KSPSetOperators(ksp,A,P)</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">VecSet(n,0) - set initial guess to zero</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">KSPSolve(ksp,b,n) - this solve works correctly</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">VecNormalize(n,NULL)</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">MatNullSpaceCreate(PetscObjectComm((PetscObject)A),PETSC_FALSE,1,&n,&nullsp)</font></li><li><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">MatSetNullSpace(A,nullsp)</font></li></ul></div><div><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">Then, with -snes_type newtonls -pc_type none -ksp_monitor -ksp_monitor_true_residual -ksp_view, the output for the KSPSolve described above, i.e. for the tangent vector, looks correct:</font></div><div><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s3" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><br></font></span></div><div><font face="arial, helvetica, sans-serif" color="#000000" style="background-color:rgb(255,255,255)"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s3" style="font-variant-ligatures:no-common-ligatures">  0 KSP</span><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures"> preconditioned resid norm 1.000000000000e+03 true resid norm 1.000000000000e+03 ||r(i)||/||b|| 1.000000000000e+00</span><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000" style="background-color:rgb(255,255,255)">...</font></div><div>





<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">185 KSP preconditioned resid norm 9.900713131874e-03 true resid norm 9.900713131904e-03 ||r(i)||/||b|| 9.900713131904e-06</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">Linear solve converged due to CONVERGED_RTOL iterations 185</font></span></p></div><div><font color="#000000" face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)"><br></font></div><div>





<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font color="#000000" face="arial, helvetica, sans-serif">KSP Object: 1 MPI processes</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>type: gmres</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>happy breakdown tolerance 1e-30</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>maximum iterations=10000, initial guess is zero</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>tolerances:<span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>relative=1e-05, absolute=1e-50, divergence=10000.</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>left preconditioning</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>using PRECONDITIONED norm type for convergence test</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">PC Object: 1 MPI processes</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>type: none</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>linear system matrix = precond matrix:</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>Mat Object: 1 MPI processes</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>type: seqaij</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>rows=78247, cols=78247</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>total: nonzeros=6063481, allocated nonzeros=6063481</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>total number of mallocs used during MatSetValues calls =0</font></span></p>
<p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">      </span>using I-node routines: found 26083 nodes, limit used is 5</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><br></font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">But the next KSP, i.e. the one in the SNES, doesn't converge in the true residual:</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><br></font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">





</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">  0 KSP preconditioned resid norm 2.045599092896e-04 true resid norm 2.803828296212e-04 ||r(i)||/||b|| 1.000000000000e+00</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal">





</p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">191 KSP preconditioned resid norm 2.009941278534e-09 true resid norm 1.636010142734e-04 ||r(i)||/||b|| 5.834915586465e-01</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><br></font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">KSP Object: 1 MPI processes</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>type: gmres</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>happy breakdown tolerance 1e-30</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>maximum iterations=10000, initial guess is zero</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>tolerances:<span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>relative=1e-05, absolute=1e-50, divergence=10000.</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>left preconditioning</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>using PRECONDITIONED norm type for convergence test</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">PC Object: 1 MPI processes</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>type: none</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><font face="arial, helvetica, sans-serif" color="#000000" style="background-color:rgb(255,255,255)"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span></span><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s2" style="font-variant-ligatures:no-common-ligatures">linear</span><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures"> system matrix = precond matrix:</span></font></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">  </span>Mat Object: 1 MPI processes</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>type: seqaij</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>rows=78247, cols=78247</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>total: nonzeros=6063481, allocated nonzeros=6063481</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">    </span>total number of mallocs used during MatSetValues calls =0</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">      </span>has attached null space</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">






















</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-Apple-converted-space">      </span>using I-node routines: found 26083 nodes, limit used is 5</font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"><br></font></span></p><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000">My guess about what's going on is that the tangent vector n isn't really in the nullspace of A. </font></span></p></div></div></blockquote><div><br></div></div><div>I do not understand the rest, but this is the problem. Maybe it would make more sense if you wrote things</div><div>in linear algebraic notation.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div class="m_-4914772938043270241m_-1442225393396874495quoted-text"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872m_3181896160715294774gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif" color="#000000"> Rather, it's in the nullspace of the m x (m+1) submatrix of A.  So, An=c e_{m+1}, where c is an arbitrary constant and e_{m+1} is the m+1 th basis vector.  The nonlinear function also has an added row, F_{m+1}, which is set to zero in the FormFunction() routine.  I don't care about the value of F_{m+1}, but I suppose that if it's included in the true residual, and NOT in the "preconditioned" residual, even with pc_type none, then it will be tricky to diagnose the performance.  Should I be using my own routine to evaluate the residual, so that F_{m+1} is not included?</font></span></p></div></div>
</blockquote></div></div><br clear="all"><div class="m_-4914772938043270241m_-1442225393396874495quoted-text"><div><br></div>-- <br><div dir="ltr" class="m_-4914772938043270241m_-1442225393396874495m_3044508991706460872gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div></div>
</blockquote></div><br></div>