<div dir="ltr"><div dir="ltr">On Fri, Apr 21, 2023 at 4:08 PM Blaise Bourdin <<a href="mailto:bourdin@mcmaster.ca">bourdin@mcmaster.ca</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>
There is one remaining problem: in ones.c:753
<div>
<div style="background-color:rgb(255,255,255);font-family:"Fira Code",Menlo,Monaco,"Courier New",monospace,Menlo,Monaco,"Courier New",monospace;line-height:18px;white-space:pre-wrap">
<div>J = snes->jacobian;</div>
<div>PetscCall(DMGetDS(dm, &prob));</div>
<div></div>
</div>
<div>This call fails if a snes was created but the Jacobian function was not given (for instance when using -snes_type qn)</div>
<div>Would it make sense to have DMGetDS to silently return NULL when no DS is defined instead of throwing and error?</div></div></div></blockquote><div><br></div><div>Yes, I am fine with this change.</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><div>
<div>Regards,</div>
<div>Blaise</div>
<div><br>
</div>
<div><br>
<blockquote type="cite">
<div>On Apr 21, 2023, at 4:09 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Thanks! I guess none of my examples use DMGetMatrix(). They get the Jacobian from the solver, which must just call preallocate.
<div><br>
</div>
<div>  Matt</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Apr 20, 2023 at 3:33 PM Blaise Bourdin <<a href="mailto:bourdin@mcmaster.ca" target="_blank">bourdin@mcmaster.ca</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Actually that was an easy fix… see MR <a href="https://gitlab.com/petsc/petsc/-/merge_requests/6352" style="font-family:"GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";box-sizing:border-box;font-variant-ligatures:none;color:rgb(51,50,56);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600;line-height:16px;display:inline" target="_blank">!6352</a>
<ul style="box-sizing:border-box;font-variant-ligatures:none;margin-top:0px;margin-bottom:0px;padding-left:0px;list-style:none;display:flex;line-height:16px;color:rgb(115,114,120);font-family:"GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:14px">
<li style="box-sizing:border-box;font-variant-ligatures:none;display:flex;min-width:0px;padding:2px 0px">
<a href="https://gitlab.com/petsc/petsc/-/merge_requests/6352" style="box-sizing:border-box;font-variant-ligatures:none;color:rgb(51,50,56);text-decoration:none;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600;line-height:16px" target="_blank"><br>
</a></li></ul>
<div><br>
<blockquote type="cite">
<div>On Apr 20, 2023, at 9:18 PM, Blaise Bourdin <<a href="mailto:bourdin@mcmaster.ca" target="_blank">bourdin@mcmaster.ca</a>> wrote:</div>
<br>
<div>
<div>
<div><font size="2"><span style="font-size:11pt">
<div>Hi,<br>
<br>
I just noticed that b6b5caf99979f50a7774afdccea5ca5661fc1203 Merge branch 'knepley/feature-hybrid-mass' into ‘main’ seems to have introduced a bug<br>
<br>
See the attached example (a very simple update of src/dm/impls/plex/tests/ex98.c)<br>
When calling DMGetMatrix, I get the following error:<br>
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR: Object is in wrong state<br>
[0]PETSC ERROR: Need to call DMCreateDS() before calling DMGetDS()<br>
[0]PETSC ERROR: WARNING! There are option(s) set that were not used! Could be the program crashed before they were used or a spelling mistake, etc!<br>
[0]PETSC ERROR:   Option left: name:-dm_mat_view (no value) source: command line<br>
[0]PETSC ERROR: See <a href="https://petsc.org/release/faq/" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Development GIT revision: v3.18.5-1161-gb6b5caf9997  GIT Date: 2023-03-27 14:14:19 +0000<br>
[0]PETSC ERROR: ./ex98 on a ventura-gcc12.2-arm64-g named sibookpro.home by blaise Thu Apr 20 21:14:40 2023<br>
[0]PETSC ERROR: Configure options --CFLAGS="-Wimplicit-function-declaration -Wunused -Wuninitialized" --FFLAGS="-ffree-line-length-none -fallow-argument-mismatch -Wunused -Wuninitialized" --download-exodusii=1 --download-hdf5=1 --download-netcdf=1 --download-ml=1
 --download-pnetcdf=1 --download-zlib=1 --with-debugging=1 --with-exodusii-fortran-bindings --with-shared-libraries=1 --with-x11=1<br>
[0]PETSC ERROR: #1 DMGetDS() at /opt/HPC/petsc-main/src/dm/interface/dm.c:5419<br>
[0]PETSC ERROR: #2 DMPlexPreallocateOperator() at /opt/HPC/petsc-main/src/dm/impls/plex/plexpreallocate.c:710<br>
[0]PETSC ERROR: #3 DMCreateMatrix_Plex() at /opt/HPC/petsc-main/src/dm/impls/plex/plex.c:2662<br>
[0]PETSC ERROR: #4 DMCreateMatrix() at /opt/HPC/petsc-main/src/dm/interface/dm.c:1476<br>
[0]PETSC ERROR: #5 main() at ex98.c:92<br>
[0]PETSC ERROR: PETSc Option Table entries:<br>
[0]PETSC ERROR: -dm_mat_view (source: command line)<br>
[0]PETSC ERROR: -i /Users/blaise/Development/mef90/mef90-dmplex/TestMeshes/SquareFaceSet.msh (source: command line)<br>
[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint@mcs.anl.gov----------<br>
Abort(73) on node 0 (rank 0 in comm 16): application called MPI_Abort(MPI_COMM_SELF, 73) - process 0<br>
<br>
<br>
Do I now need to use DS in order to use duplex and sections?<br>
<br>
Regards,<br>
Blaise<br>
<br>
</div>
</span></font></div>
<div><font size="2"><span style="font-size:11pt">
<div><br>
— <br>
Canada Research Chair in Mathematical and Computational Aspects of Solid Mechanics (Tier 1)<br>
Professor, Department of Mathematics & Statistics<br>
Hamilton Hall room 409A, McMaster University<br>
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada <br>
<a href="https://www.math.mcmaster.ca/bourdin" target="_blank">https://www.math.mcmaster.ca/bourdin</a> | +1 (905) 525 9140 ext. 27243<br>
<br>
</div>
</span></font></div>
</div>
<span id="m_6462750673141445200m_2061761257045839828cid:02D328350A60C54EB93CEC70996B970F@CANPRD01.PROD.OUTLOOK.COM"><ex98.c></span></div>
</blockquote>
</div>
<br>
<div>
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>— <br>
Canada Research Chair in Mathematical and Computational Aspects of Solid Mechanics (Tier 1)</div>
<div>Professor, Department of Mathematics & Statistics<br>
Hamilton Hall room 409A, McMaster University<br>
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada <br>
<a href="https://www.math.mcmaster.ca/bourdin" target="_blank">https://www.math.mcmaster.ca/bourdin</a> | +1 (905) 525 9140 ext. 27243</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<span>-- </span><br>
<div dir="ltr">
<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>
</blockquote>
</div>
<br>
<div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>— <br>
Canada Research Chair in Mathematical and Computational Aspects of Solid Mechanics (Tier 1)</div>
<div>Professor, Department of Mathematics & Statistics<br>
Hamilton Hall room 409A, McMaster University<br>
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada <br>
<a href="https://www.math.mcmaster.ca/bourdin" target="_blank">https://www.math.mcmaster.ca/bourdin</a> | +1 (905) 525 9140 ext. 27243</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>

</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><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>