<div dir="ltr"><div dir="ltr">On Fri, Dec 10, 2021 at 10:49 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_-6173748380162638319WordSection1">
<p class="MsoNormal"><span>Thank you for your response.<u></u><u></u></span></p>
<p class="MsoNormal">I tried using the flag -dm_view to get mesh information.<u></u><u></u></p>
<p class="MsoNormal">I was hoping it might create a output file with mesh information but it didn’t create any.<u></u><u></u></p>
<p class="MsoNormal">What should I expect with -dm_view?</p></div></div></blockquote><div><br></div><div>-dm_view prints the Plex information to the screen (by default), but it responds to the normal viewer options.</div><div>However, it looks like Mark changes the prefix on the mesh, so I think you need</div><div><br></div><div> -ex56_dm_view</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_-6173748380162638319WordSection1">
<p class="MsoNormal"><span>Best,<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>Friday, 10 December 2021 at 13:04<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 Fri, Dec 10, 2021 at 7:42 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-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hi Matt,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I intend to perform a scaling study – I have a few more questions from ex56<u></u><u></u></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.</span></b><u></u><u></u></p>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028msolistparagraph" style="margin-left:54pt">
i)<span style="font-size:7pt;font-family:"Times New Roman",serif">
</span>What makes the problem non-linear? I believe SNES are used to solve non-linear problems.<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal">It is a linear problem. We use SNES because it is easier to use it for everything. <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-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028msolistparagraph" style="margin-left:54pt">
ii)<span style="font-size:7pt;font-family:"Times New Roman",serif">
</span>2,2,1 does it present the number of elements used in each direction?<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal">You can use -dm_view to show the mesh information actually used in the run.<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-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028msolistparagraph" style="margin-left:54pt">
iii)<span style="font-size:7pt;font-family:"Times New Roman",serif">
</span>What makes the problem unstructured? I believe the geometry is a cube or cuboid – is it because it uses DMPlex?<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal">Yes. <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-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028msolistparagraph" style="margin-left:54pt">
iv)<span style="font-size:7pt;font-family:"Times New Roman",serif">
</span>Do any external FEM package with an unstructured problem domain has to use DMPlex mat type?<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal">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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">its own mesh types. <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-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028msolistparagraph" style="margin-left:54pt">
v)<span style="font-size:7pt;font-family:"Times New Roman",serif">
</span>What about -mat_type (not _dm_mat_type) ajicusparse – will it work with unstructured FEM discretised domains?<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal">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()<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">there may be overhead in converting to that matrix type, but it should work.<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-left:4.8pt;margin-right:0cm">
<div>
<div>
<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:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028p1"><span class="gmail-m_-6173748380162638319gmail-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_-6173748380162638319gmail-m-482615902856798028apple-converted-space"><span style="font-size:10pt">
</span></span><span class="gmail-m_-6173748380162638319gmail-m-482615902856798028s1"><span style="font-size:10pt">-snes_rtol 1.e-10 > output_221.txt</span></span><u></u><u></u></p>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028p1"><span class="gmail-m_-6173748380162638319gmail-m-482615902856798028s1"><span style="font-size:10pt"> </span></span><u></u><u></u></p>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028p1"><span style="font-size:10pt"> </span><u></u><u></u></p>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028p1"><span class="gmail-m_-6173748380162638319gmail-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_-6173748380162638319gmail-m-482615902856798028apple-converted-space"><span style="font-size:10pt">
</span></span><span class="gmail-m_-6173748380162638319gmail-m-482615902856798028s1"><span style="font-size:10pt">-snes_rtol 1.e-10 > output_221.txt</span></span><u></u><u></u></p>
<p class="gmail-m_-6173748380162638319gmail-m-482615902856798028p1"><span class="gmail-m_-6173748380162638319gmail-m-482615902856798028s1"><span style="font-size:10pt"> </span></span><u></u><u></u></p>
<p class="MsoNormal">Below is the SNES iteration for problem with 2,2,1 cells which converges after two non-linear iterations:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">0 SNES Function norm 0.000000000000e+00
<u></u><u></u></p>
<p class="MsoNormal"> 0 SNES Function norm 7.529825940191e+01<u></u><u></u></p>
<p class="MsoNormal"> 1 SNES Function norm 4.734810707002e-08<u></u><u></u></p>
<p class="MsoNormal"> 2 SNES Function norm 1.382827243108e-14<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Your KSP tolerance is too high, so it takes another iterate. Use -ksp_rtol 1e-10.<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-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">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></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> 0 SNES Function norm 2.892801019593e+01<u></u><u></u></p>
<p class="MsoNormal"> 1 SNES Function norm 5.361683383932e-07
<u></u><u></u></p>
<p class="MsoNormal"> 2 SNES Function norm 1.726814199132e-14
<u></u><u></u></p>
<p class="MsoNormal"> 0 SNES Function norm 1.085975028558e+01<u></u><u></u></p>
<p class="MsoNormal"> 1 SNES Function norm 2.294074693590e-07<u></u><u></u></p>
<p class="MsoNormal"> 2 SNES Function norm 2.491900236077e-14<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">You are solving the problem twice, probably because ex56 is in its refinement loop.<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-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Kind regards,<u></u><u></u></p>
<p class="MsoNormal">Karthik.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></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</span><u></u><u></u></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,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Are there example tutorials on unstructured mesh in ksp? Can some of them run on gpus?<u></u><u></u></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,<u></u><u></u></p>
<p class="MsoNormal">Karthik.<u></u><u></u></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><u></u><u></u></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>
<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>