<div dir="ltr"><div dir="ltr">On Fri, Dec 10, 2021 at 7:42 AM Karthikeyan Chockalingam - STFC UKRI <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk">karthikeyan.chockalingam@stfc.ac.uk</a>> wrote:<br></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 lang="EN-GB" style="overflow-wrap: break-word;">
<div class="gmail-m_-482615902856798028WordSection1">
<p class="MsoNormal"><span>Hi Matt,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>I intend to perform a scaling study – I have a few more questions from ex56<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><b><span style="font-size:10pt;font-family:"Courier New";color:black">3D, tri-quadratic hexahedra (Q1), displacement finite element formulation.<u></u><u></u></span></b></p>
<p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt">
<u></u><span><span>i)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span>What makes the problem non-linear? I believe SNES are used to solve non-linear problems.</span></p></div></div></blockquote><div>It is a linear problem. We use SNES because it is easier to use it for everything. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-482615902856798028WordSection1"><p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt"><span><u></u><u></u></span></p>
<p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt">
<u></u><span><span>ii)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span>2,2,1 does it present the number of elements used in each direction?</span></p></div></div></blockquote><div>You can use -dm_view to show the mesh information actually used in the run.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-482615902856798028WordSection1"><p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt"><span><u></u><u></u></span></p>
<p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt">
<u></u><span><span>iii)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span>What makes the problem unstructured? I believe the geometry is a cube or cuboid – is it because it uses DMPlex?</span></p></div></div></blockquote><div>Yes. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-482615902856798028WordSection1"><p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt"><span>
<u></u><u></u></span></p>
<p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt">
<u></u><span><span>iv)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span>Do any external FEM package with an unstructured problem domain has to use DMPlex mat type?</span></p></div></div></blockquote><div>DMPlex is not a Mat type, but rather a DM type. I do not understand the question. For example, LibMesh uses PETSc solvers but has</div><div>its own mesh types. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-482615902856798028WordSection1"><p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt"><span>
<u></u><u></u></span></p>
<p class="gmail-m_-482615902856798028MsoListParagraph" style="margin-left:54pt">
<u></u><span><span>v)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span>What about -mat_type (not _dm_mat_type) ajicusparse – will it work with unstructured FEM discretised domains?</span></p></div></div></blockquote><div>dm_mat_type is just a way of setting the MatType that the DM creates. You can set it to whatever type you want. Since it uses MatSetValues()</div><div>there may be overhead in converting to that matrix type, but it should work.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-482615902856798028WordSection1">
<p class="MsoNormal">I tried to run two problems of ex56 with two different domain size ( - attached you find the log_view outputs of both on<u>
</u><b>gpus</b>) using _pc_type asm:<b><u></u><u></u></b></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="gmail-m_-482615902856798028p1"><span class="gmail-m_-482615902856798028s1"><span style="font-size:10pt">./ex56 -cells 2,2,1 -max_conv_its 2 -lx 1. -alpha .01 -petscspace_degree 1 -ksp_type cg -ksp_monitor -ksp_rtol 1.e-8 -pc_type asm -snes_monitor -use_mat_nearnullspace true</span></span><span class="gmail-m_-482615902856798028apple-converted-space"><span style="font-size:10pt">
</span></span><span class="gmail-m_-482615902856798028s1"><span style="font-size:10pt">-snes_rtol 1.e-10 > output_221.txt<u></u><u></u></span></span></p>
<p class="gmail-m_-482615902856798028p1"><span class="gmail-m_-482615902856798028s1"><span style="font-size:10pt"><u></u> <u></u></span></span></p>
<p class="gmail-m_-482615902856798028p1"><span style="font-size:10pt"><u></u> <u></u></span></p>
<p class="gmail-m_-482615902856798028p1"><span class="gmail-m_-482615902856798028s1"><span style="font-size:10pt">./ex56 -cells 10,10,5 -max_conv_its 2 -lx 1. -alpha .01 -petscspace_degree 1 -ksp_type cg -ksp_monitor -ksp_rtol 1.e-8 -pc_type asm -snes_monitor -use_mat_nearnullspace true</span></span><span class="gmail-m_-482615902856798028apple-converted-space"><span style="font-size:10pt">
</span></span><span class="gmail-m_-482615902856798028s1"><span style="font-size:10pt">-snes_rtol 1.e-10 > output_221.txt<u></u><u></u></span></span></p>
<p class="gmail-m_-482615902856798028p1"><span class="gmail-m_-482615902856798028s1"><span style="font-size:10pt"><u></u> <u></u></span></span></p>
<p class="MsoNormal"><span>Below is the SNES iteration for problem with 2,2,1 cells which converges after two non-linear iterations:<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>0 SNES Function norm 0.000000000000e+00
<u></u><u></u></span></p>
<p class="MsoNormal"><span> 0 SNES Function norm 7.529825940191e+01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 1 SNES Function norm 4.734810707002e-08<u></u><u></u></span></p>
<p class="MsoNormal"><span> 2 SNES Function norm 1.382827243108e-14</span></p></div></div></blockquote><div><br></div><div>Your KSP tolerance is too high, so it takes another iterate. Use -ksp_rtol 1e-10.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-482615902856798028WordSection1">
<p class="MsoNormal"><span>Below is the SNES iteration for problem with 10,10,5 cells– why does it first decrease and then increase to
<b>0 SNES Function norm 1.085975028558e+01</b> and finally converge?<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span> 0 SNES Function norm 2.892801019593e+01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 1 SNES Function norm 5.361683383932e-07
<u></u><u></u></span></p>
<p class="MsoNormal"><span> 2 SNES Function norm 1.726814199132e-14
<u></u><u></u></span></p>
<p class="MsoNormal"><span> 0 SNES Function norm 1.085975028558e+01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 1 SNES Function norm 2.294074693590e-07<u></u><u></u></span></p>
<p class="MsoNormal"><span> 2 SNES Function norm 2.491900236077e-14</span></p></div></div></blockquote><div><br></div><div>You are solving the problem twice, probably because ex56 is in its refinement loop.</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:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-482615902856798028WordSection1">
<p class="MsoNormal"><span>Kind regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span>Karthik.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From: </span></b><span style="font-size:12pt;color:black">Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Date: </b>Thursday, 2 December 2021 at 10:57<br>
<b>To: </b>"Chockalingam, Karthikeyan (STFC,DL,HC)" <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>><br>
<b>Cc: </b>"<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject: </b>Re: [petsc-users] Unstructured mesh<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">On Thu, Dec 2, 2021 at 3:33 AM Karthikeyan Chockalingam - STFC UKRI <<a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank">karthikeyan.chockalingam@stfc.ac.uk</a>> wrote:<u></u><u></u></p>
</div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Are there example tutorials on unstructured mesh in ksp? Can some of them run on gpus?</p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">There are many unstructured grid examples, e.g. SNES ex13, ex17, ex56. The solver can run on the GPU, but the vector/matrix<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">FEM assembly does not. I am working on that now.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> Matt<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">Kind regards,</p>
<p class="MsoNormal">Karthik.</p>
</div>
<p><span style="font-size:6pt">This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify
the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own
virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses. </span></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>