<div dir="ltr"><div><div>Great! It's added.<br><br></div>Thanks,<br></div>Sander<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 April 2016 at 16:53, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Go ahead and add it. I will review everything.<div><br></div><div> Thanks,</div><div><br></div><div> Matt</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 3, 2016 at 9:26 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>No problem. I think I solved the problem with the block size, so I wanted to know if I should also add this to my pull request or if I should make a separate one?<br><br></div>Thanks,<br></div>Sander<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 3 April 2016 at 15:17, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Sun, Apr 3, 2016 at 6:55 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Any thoughts on this, Matt?<br></div></div></div></blockquote><div><br></div></span><div>Shoot, this fell out of my working set, and I am behind on incorporating your pull request. I will</div><div>look at both this week.</div><div><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"><div dir="ltr"><div><div></div>Thanks,<br></div>Sander<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 21 March 2016 at 09:49, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Matt,<br><br></div>I think the problem is in DMCreateSubDM_Section_Private. The block size can be counted there (very similar as in DMCreateMatrix_Plex) and then passed down to the IS. I can create a pull request for this if you'd like (or should I just add this to my other pull request for the Neumann bc's)?<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2016 at 18:02, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Ok, thanks for clearing that up!<br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2016 at 18:00, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Mar 3, 2016 at 10:48 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>So is the block size here refering to the dimension of the near-nullspace or has it something to do with the coarsening?<br><br></div>I would have thought to also see the block size in this part:<br></div></div></div></blockquote><div><br></div></span><div>Dang, that is a problem. It should have the correct block size when FS pulls it out of the overall matrix. This should be</div><div>passed down using the block size of the IS. Something has been broken here. I will put it on my list of things to look at.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div> Mat Object: 1 MPI processes<br> type: seqaij<br> rows=1701, cols=1701<br> total: nonzeros=109359, allocated nonzeros=109359<br> total number of mallocs used during MatSetValues calls =0<br> has attached near null space<br> using I-node routines: found 567 nodes, limit used is 5<br><br></div>Thanks,<br></div>Sander<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2016 at 17:29, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can see the block size in the output<div><br></div><div><div> Mat Object: 1 MPI processes</div><div> type: seqaij</div><div> rows=12, cols=12, bs=6</div><div> total: nonzeros=144, allocated nonzeros=144</div><div> total number of mallocs used during MatSetValues calls =0</div><div> using I-node routines: found 3 nodes, limit used is 5</div><div> linear system matrix = precond matrix:</div><div> Mat Object: 1 MPI processes</div><div> type: seqaij</div><div> rows=12, cols=12, bs=6</div><div> total: nonzeros=144, allocated nonzeros=144</div><div> total number of mallocs used during MatSetValues calls =0</div><div> using I-node routines: found 3 nodes, limit used is 5</div></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 10:28 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Sure, here it is.<br><br></div>Thanks,<br></div>Sander<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2016 at 15:33, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Mar 3, 2016 at 8:05 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Yes, the matrix is created by one of the assembly functions in Plex, so that answers my question. I was confused by this because I couldn't see this information when using -snes_view.<br></div></div></div></blockquote><div><br></div></span><div>Hmm, then something is wrong because the block size should be printed for the matrix at the end of the solver in -snes_view, Can you</div><div>send that to me?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div></div>Thanks for the helpful replies,<br></div>Sander<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2016 at 14:52, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Mar 3, 2016 at 7:49 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>And how can I do this? Because when I look at all the options with -help I can strangely enough only find -fieldsplit_pressure_mat_block_size and not -fieldsplit_displacement_mat_block_size.<br></div></div></div></blockquote><div><br></div></span><div>Maybe I am missing something here. The matrix from which you calculate the preconditioner using GAMG must be created somewhere. Why</div><div>is the block size not specified at creation time? If the matrix is created by one of the assembly functions in Plex, and the PetscSection has</div><div>a number of field components, then the block size will already be set.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div></div>Thanks,<br></div>Sander<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2016 at 14:21, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Mar 3, 2016 at 6:20 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Ok, I forgot to call SNESSetJacobian(snes, J, P, NULL, NULL) with J != P, which caused to write the mass matrix into the (otherwise zero) (1,1) block of the Jacobian and which was the reason for the linesearch to fail. <br>However, after fixing that and trying to solve it with FieldSplit with LU factorization for the (0,0) block it failed because there were zero pivots for all rows.<br><br></div>Anyway, I found out that attaching the mass matrix to the Lagrange multiplier field also worked.<br><br></div>Another related question for my elasticity problem: after creating the rigid body modes with DMPlexCreateRigidBody and attaching it to the displacement field, does the matrix block size of the (0,0) block still have to be set for good performance with gamg? If so, how can I do this?<br></div></div></div></blockquote><div><br></div></span><div>Yes, it should be enough to set the block size of the preconditioner matrix.</div><div><br></div><div> Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div></div>Thanks,<br></div>Sander<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 March 2016 at 12:25, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Wed, Mar 2, 2016 at 5:13 AM, Sander Arens <span dir="ltr"><<a href="mailto:Sander.Arens@ugent.be" target="_blank">Sander.Arens@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br><br></div><div>I'm trying to set a mass matrix preconditioner for the Schur complement of an incompressible finite elasticity problem. I tried using the command PetscDSSetJacobianPreconditioner(prob, 1, 1, g0_pre_mass_pp, NULL, NULL, NULL) (field 1 is the Lagrange multiplier field).<br></div><div>However, this causes a DIVERGED_LINE_SEARCH due to to Nan or Inf in the function evaluation after Newton iteration 1. (Btw, I'm using the next branch).<br><br>Is this because I didn't use PetscDSSetJacobianPreconditioner for the other blocks (which uses the Jacobian itself for preconditioning)? If so, how can I tell Petsc to use the Jacobian for those blocks?<br></div></div></blockquote><div><br></div></span><div>1) I put that code in very recently, and do not even have sufficient test, so it may be buggy</div><div><br></div><div>2) If you are using FieldSplit, you can control which blocks come from A and which come from the preconditioner P</div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetDiagUseAmat.html#PCFieldSplitSetDiagUseAmat" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetDiagUseAmat.html#PCFieldSplitSetDiagUseAmat</a></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetOffDiagUseAmat.html#PCFieldSplitSetOffDiagUseAmat" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetOffDiagUseAmat.html#PCFieldSplitSetOffDiagUseAmat</a></div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div></div><div>I guess when using PetscDSSetJacobianPreconditioner the preconditioner is recomputed at every Newton step, so for a constant mass matrix this might not be ideal. How can I avoid recomputing this at every Newton iteration?<br></div></div></blockquote><div><br></div></span><div>Maybe we need another flag like<br></div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetLagPreconditioner.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetLagPreconditioner.html</a></div><div><br></div><div>or we need to expand</div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetLagJacobian.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetLagJacobian.html</a></div><div><br></div><div>to separately cover the preconditioner matrix. However, both matrices are computed by one call so this would</div><div>involve interface changes to user code, which we do not like to do. Right now it seems like a small optimization.</div><div>I would want to wait and see whether it would really be maningful.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div></div><div>Thanks,<br></div><div>Sander<span><font color="#888888"><br></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><span><font color="#888888"><div><br></div>-- <br><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>
</font></span></font></span></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888">
</font></span></blockquote></div></div></div><span><font color="#888888"><div><div><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br><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>
</font></span></div></div></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888">
</font></span></blockquote></div></div></div><span><font color="#888888"><div><div><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br><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>
</font></span></div></div></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888">
</font></span></blockquote></div></div></div><span><font color="#888888"><div><div><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br><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>
</font></span></div></div></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><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>
</font></span></div>
</div></div></blockquote></div><br></div>
</blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br><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></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br><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></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><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>
</div></div></blockquote></div><br></div>