<div dir="ltr"><div dir="ltr">On Thu, Jun 1, 2023 at 1:46 AM Duan Junming via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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 class="msg-2782878179779794701">
<div dir="ltr">
<div id="m_-2782878179779794701divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:"Times New Roman",Times,serif,Times,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Dear all,</p>
<p><br>
</p>
<p>I have a simple demo code attached below, which gives a <span>segmentation violation error.</span></p>
<p><span>Can you help me with this problem? I think the problem is due to the destroy function.</span></p>
<p><span>I am using version 3.19.2 with debugging.</span></p></div></div></div></blockquote><div><br></div><div>Yes, the check is wrong. I will fix it. For now, you can just pass in the transpose argument as well.</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 class="msg-2782878179779794701"><div dir="ltr"><div id="m_-2782878179779794701divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:"Times New Roman",Times,serif,Times,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span></span></p>
<div>
<div>#include <petsc.h></div>
<div><br>
</div>
<div>static char help[] = "test.\n";</div>
<div>int main(int argc, char *argv[]) {</div>
<div> PetscCall(PetscInitialize(&argc, &argv, 0, help));</div>
<div> PetscScalar *nodes;</div>
<div> PetscScalar *weights;</div>
<div> PetscScalar **diff;</div>
<div> PetscInt n = 3;</div>
<div> PetscCall(PetscMalloc2(n, &nodes, n, &weights));</div>
<div> PetscCall(PetscDTGaussLobattoLegendreQuadrature(n, PETSCGAUSSLOBATTOLEGENDRE_VIA_LINEAR_ALGEBRA, nodes, weights));</div>
<div> PetscCall(PetscGaussLobattoLegendreElementGradientCreate(n, nodes, weights, &diff, NULL));</div>
<div> PetscCall(PetscGaussLobattoLegendreElementGradientDestroy(n, nodes, weights, &diff, NULL));</div>
<div> PetscCall(PetscFree2(nodes, weights));</div>
<div> PetscCall(PetscFinalize());</div>
<div> return 0;</div>
<div>}</div>
<br>
</div>
<p></p>
<p><br>
</p>
<p>Junming</p>
<div id="m_-2782878179779794701Signature">
<div id="m_-2782878179779794701divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,Times,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p style="font-family:Calibri,Helvetica,sans-serif;font-size:16px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt"></span></p>
</div>
</div>
</div>
</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>