<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBannerjx1u7e6 { all: revert !important; display: block !important; 
    visibility: visible !important; opacity: 1 !important; 
    background-color: #D0D8DC !important; 
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtonjx1u7e6:hover, .pfptPrimaryButtonjx1u7e6:focus {
    background-color: #b4c1c7 !important; }
  .pfptPrimaryButtonjx1u7e6:active {
    background-color: #90a4ae !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
 On Wed, May 1, 2024 at 4: 23 PM Ferrand, Jesus A. <FERRANJ2@ my. erau. edu> wrote: Matt: My bad again, I need to clarify something that I just realized doesn't make sense. I said: "The nature of the I/O makes it so that I need to
</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
          This Message Is From an External Sender
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          This message came from outside your organization.
        </td></tr>

      </table>

    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr"  id="pfptBannerjx1u7e6" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
    <div id="pfptBannerjx1u7e6" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
      <div id="pfptBannerjx1u7e6" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
        This Message Is From an External Sender
      </div>
      <div id="pfptBannerjx1u7e6" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
      </div>

    </div>

    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<div dir="ltr"><div dir="ltr">On Wed, May 1, 2024 at 4:23 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu">FERRANJ2@my.erau.edu</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="msg478286811837034506">




<div dir="ltr">
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Matt:<br>
<br>
My bad again, I need to clarify something that I just realized doesn't make sense.</div>
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I said: "The nature of the I/O makes it so that I need to read the connectivity before I get a semblance of buffer sizes."</div>
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Scratch that, obviously, if I can read the connectivity, I know the buffer sizes.</div>
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
What I should have said is that I cannot know the "chart" that one sets in DMPlexSetChart() a priori like in most cases.</div>
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I need to determine the chart from the connectivity lists.</div></div></div></blockquote><div><br></div><div>You know the number of cells if you can read connectivity. Do you mean that the format does not tell you</div><div>the number of vertices?</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="msg478286811837034506"><div dir="ltr">
<hr style="display:inline-block;width:98%">
<div id="m_478286811837034506divRplyFwdMsg" dir="ltr" style="color:inherit;background-color:inherit">
<span style="font-family:Calibri,sans-serif;font-size:11pt;color:rgb(0,0,0)"><b>From:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:17 PM<br>
<b>To:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</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: [EXTERNAL] Re: [petsc-users] Is there anything like a "DMPlexSetCones()" ?</span>
<div> </div>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Matt:</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
"I do not understand the "flag check". What is that?"</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
      My bad, I should have referred to the "dm->setupcalled".<br>
      I believe this PetscBool is checked by the other DM (not just DMPlex) APIs.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
      The subsequent checks for dm->setupcalled == PETSC_TRUE is what I meant to say.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
      Here's a copy of DMSetUp().</div>
<pre style="width:80px"><div style="direction:ltr;margin-right:80px;margin-left:80px;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)"><b><a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbEGErkJ-$" id="m_478286811837034506OWA584aa1d4-edb6-60bd-5deb-f91144368942" target="_blank">PetscErrorCode</a> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DMSetUp/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbHlKVRsv$" id="m_478286811837034506OWAee8ffec2-b719-bd5e-caba-518db51191f5" target="_blank">DMSetUp</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbLTlKr33$" id="m_478286811837034506OWA3616444b-12cb-5c6e-4bc4-2ed41a565772" target="_blank">DM</a> dm)</b>
817: {
818:   <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionBegin/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbO3Lr_yl$" id="m_478286811837034506OWAc4311b67-9870-d0e2-1ee4-91bbb4af9897" target="_blank">PetscFunctionBegin</a>;
820:   if (dm->setupcalled) <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbIQ_4i0Z$" id="m_478286811837034506OWAd6efe15d-f606-32e3-e6d1-cd6019950f9d" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbEGErkJ-$" id="m_478286811837034506OWAefa8868d-743e-61c6-0199-4a6232bbd97a" target="_blank">PETSC_SUCCESS</a>);
821:   <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscTryTypeMethod/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbAvZ6cYM$" id="m_478286811837034506OWAef63a750-3ca0-e48e-c615-5d8e140b643f" target="_blank">PetscTryTypeMethod</a>(dm, setup);
822:   dm->setupcalled = <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PETSC_TRUE/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbDXZdzLl$" id="m_478286811837034506OWA0a74d419-3406-eb21-730c-249b244d24ef" target="_blank">PETSC_TRUE</a>;
823:   <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbIQ_4i0Z$" id="m_478286811837034506OWA077d38f2-b064-f5f4-70e9-ddec399435dc" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbEGErkJ-$" id="m_478286811837034506OWA291d9c37-9b72-4bca-2be4-d92dcb362ddc" target="_blank">PETSC_SUCCESS</a>);
824: }</div></pre>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
"We could make a DMPlexSetCones(), but as you point out, the workflow for DMSetUp() would have to change. Where does the memory come from for your connectivity?"</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
      It's a memory that I myself allocate based on a file's contents.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
      The nature of the I/O makes it so that I need to read the connectivity before I get a semblance of buffer sizes.<br>
      Otherwise, I would stick to the tried and tested way.<br>
<br>
Also, when replying to the PETSc developers, users must reply to <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a> and not just to the individual email accounts of the developers, right?</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="m_478286811837034506x_appendonsend" style="color:inherit;background-color:inherit"></div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_478286811837034506x_divRplyFwdMsg" dir="ltr" style="color:inherit;background-color:inherit">
<span style="font-family:Calibri,sans-serif;font-size:11pt;color:rgb(0,0,0)"><b>From:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:07 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" target="_blank">FERRANJ2@my.erau.edu</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> [EXTERNAL] Re: [petsc-users] Is there anything like a "DMPlexSetCones()" ?</span>
<div> </div>
</div>
<table style="direction:ltr;text-align:left;line-height:1.5;border-color:rgb(136,136,136);border-style:solid;border-width:1px;background-color:rgb(255,235,156);width:100%;min-width:100%;color:black;box-sizing:border-box;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr>
<td style="direction:ltr;text-align:left;line-height:1.5;padding:5px 10px">
<div style="direction:ltr;text-align:left;line-height:1.5;font-family:Arial,sans-serif;font-size:14px">
<span style="color:rgb(214,0,0)"><b>CAUTION:</b></span><span style="color:black"> This email originated outside of Embry-Riddle Aeronautical University. Do not click links or open attachments unless you recognize the sender and know the content is safe.</span></div>
</td>
</tr>
</tbody>
</table>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">On Wed, May 1, 2024 at 3:34 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_478286811837034506OWAcff6ba0e-2d0c-2d92-3a16-57020f9a3f3a" target="_blank">FERRANJ2@my.erau.edu</a>> wrote:</div>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)">
<div dir="ltr" id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="display:block;text-align:left;margin:16px 0px;padding:8px 16px;border-radius:4px;min-width:200px;background-color:rgb(208,216,220);border-top:4px solid rgb(144,164,174);color:inherit">
<div id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="float:left;display:block;margin:0px 0px 1px;max-width:600px;color:inherit;background-color:inherit">
<div id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="display:block;background-color:rgb(208,216,220);color:rgb(0,0,0);font-family:Arial,sans-serif;font-weight:bold;font-size:14px;line-height:18px">
This Message Is From an External Sender</div>
<div id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="font-weight:normal;display:block;background-color:rgb(208,216,220);color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:12px;line-height:18px;margin-top:2px">
This message came from outside your organization.</div>
</div>
<div style="line-height:0;display:block;font-size:0.01px"> </div>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Dear PETSc team:<br>
<br>
For a project that I'm working on, I need to manually build a DMPlex.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
>From studying the source code of the various APIs in which the plex is built from some supported file format, I get that the workflow is this:</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<ol style="direction:ltr;margin-top:0px;margin-bottom:0px" start="1">
<li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"1) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexSetChart() <-- Input nCells + nVerts</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"2) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexSetConeSize() <-- Input ConeSize for each point in [0,nCells)</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"3) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMSetUp() – Allocates memory internally.</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"4) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexGetCones() --> Gives you the memory onto which to write the cell connectivity.</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"5) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
*Write connectivity*</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"6) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexReorderCell() <-- For each point in [0,nCells)</div>
</li></ol>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I'm in a situation where the memory given by step (4) is available a-priori.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I was hoping to skip steps 2, 3 , and 4 with something like a "DMPlexSetCones()", but such an API does not exist.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
My current workaround is to implement steps 2 through 4 as always and have double the memory allocated in the interim (my instance + DM's internal instance).</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I was thinking of looking for the name of the struct member and = it to my memory, but I can't overcome the flag check in DMSetUp() during later calls to DMPlexGetCones() or DMPlexGetTransitiveClosure().</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">I do not understand the "flag check". What is that?</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">We could make a DMPlexSetCones(), but as you point out, the workflow for DMSetUp() would have to change. Where does the memory come from for your connectivity?</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">  Thanks,</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">    Matt</div>
<div style="direction:ltr"> </div>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)">
<div id="m_478286811837034506x_x_m_-2907562466910451345Signature" style="color:inherit;background-color:inherit">
<div style="background-color:rgb(255,255,255);font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div dir="ltr" id="m_478286811837034506x_x_m_-2907562466910451345divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;background-color:inherit">
<p style="line-height:normal;background-color:white;margin:0px 0px 11px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">Sincerely:</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Courier New",monospace;font-size:14pt;color:red"><b><u>J.A. Ferrand</u></b></span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">Embry-Riddle Aeronautical University - Daytona Beach - FL<br>
Ph.D. Candidate, Aerospace Engineering</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">M.Sc. Aerospace Engineering</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">B.Sc. Aerospace Engineering</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">B.Sc. Computational Mathematics</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)"><br>
</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black"><u>Phone:</u> (386)-843-1829</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black"><u>Email(s):</u> <a href="mailto:ferranj2@my.erau.edu" id="m_478286811837034506OWAed1a4422-632a-2bc9-7d0c-fdd8cbb84892" style="margin-top:0px;margin-bottom:0px" target="_blank">ferranj2@my.erau.edu</a></span></p>
<p style="text-indent:0.5in;line-height:normal;background-color:white;margin:0px">
<span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">   
<a href="mailto:jesus.ferrand@gmail.com" id="m_478286811837034506OWA3aa21571-8401-c879-4848-2621bbe0465a" style="margin-top:0px;margin-bottom:0px" target="_blank">
jesus.ferrand@gmail.com</a></span></p>
</div>
</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">--</div>
<div style="direction:ltr">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 style="direction:ltr"><br>
</div>
<div style="direction:ltr"><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbKClgWhj$" id="m_478286811837034506OWAc1da9e97-cc12-a51c-de50-3b7e7cacebc2" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_478286811837034506x_appendonsend" style="color:inherit;background-color:inherit"></div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_478286811837034506x_divRplyFwdMsg" dir="ltr" style="color:inherit;background-color:inherit">
<span style="font-family:Calibri,sans-serif;font-size:11pt;color:rgb(0,0,0)"><b>From:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:07 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" target="_blank">FERRANJ2@my.erau.edu</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> [EXTERNAL] Re: [petsc-users] Is there anything like a "DMPlexSetCones()" ?</span>
<div> </div>
</div>
<table style="direction:ltr;text-align:left;line-height:1.5;border-color:rgb(136,136,136);border-style:solid;border-width:1px;background-color:rgb(255,235,156);width:100%;min-width:100%;color:black;box-sizing:border-box;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr>
<td style="direction:ltr;text-align:left;line-height:1.5;padding:5px 10px">
<div style="direction:ltr;text-align:left;line-height:1.5;font-family:Arial,sans-serif;font-size:14px">
<span style="color:rgb(214,0,0)"><b>CAUTION:</b></span><span style="color:black"> This email originated outside of Embry-Riddle Aeronautical University. Do not click links or open attachments unless you recognize the sender and know the content is safe.</span></div>
</td>
</tr>
</tbody>
</table>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">On Wed, May 1, 2024 at 3:34 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_478286811837034506OWAd202a882-da56-cf44-cb6d-00d21c8fbd5b" target="_blank">FERRANJ2@my.erau.edu</a>> wrote:</div>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)">
<div dir="ltr" id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="display:block;text-align:left;margin:16px 0px;padding:8px 16px;border-radius:4px;min-width:200px;background-color:rgb(208,216,220);border-top:4px solid rgb(144,164,174);color:inherit">
<div id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="float:left;display:block;margin:0px 0px 1px;max-width:600px;color:inherit;background-color:inherit">
<div id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="display:block;background-color:rgb(208,216,220);color:rgb(0,0,0);font-family:Arial,sans-serif;font-weight:bold;font-size:14px;line-height:18px">
This Message Is From an External Sender</div>
<div id="m_478286811837034506x_x_m_-2907562466910451345pfptBanner5674lmf" style="font-weight:normal;display:block;background-color:rgb(208,216,220);color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:12px;line-height:18px;margin-top:2px">
This message came from outside your organization.</div>
</div>
<div style="line-height:0;display:block;font-size:0.01px"> </div>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Dear PETSc team:<br>
<br>
For a project that I'm working on, I need to manually build a DMPlex.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
>From studying the source code of the various APIs in which the plex is built from some supported file format, I get that the workflow is this:</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<ol style="direction:ltr;margin-top:0px;margin-bottom:0px" start="1">
<li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"1) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexSetChart() <-- Input nCells + nVerts</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"2) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexSetConeSize() <-- Input ConeSize for each point in [0,nCells)</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"3) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMSetUp() – Allocates memory internally.</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"4) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexGetCones() --> Gives you the memory onto which to write the cell connectivity.</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"5) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
*Write connectivity*</div>
</li><li style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0);list-style-type:"6) "">
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
DMPlexReorderCell() <-- For each point in [0,nCells)</div>
</li></ol>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I'm in a situation where the memory given by step (4) is available a-priori.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I was hoping to skip steps 2, 3 , and 4 with something like a "DMPlexSetCones()", but such an API does not exist.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
My current workaround is to implement steps 2 through 4 as always and have double the memory allocated in the interim (my instance + DM's internal instance).</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
I was thinking of looking for the name of the struct member and = it to my memory, but I can't overcome the flag check in DMSetUp() during later calls to DMPlexGetCones() or DMPlexGetTransitiveClosure().</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">I do not understand the "flag check". What is that?</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">We could make a DMPlexSetCones(), but as you point out, the workflow for DMSetUp() would have to change. Where does the memory come from for your connectivity?</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">  Thanks,</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">    Matt</div>
<div style="direction:ltr"> </div>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)">
<div id="m_478286811837034506x_x_m_-2907562466910451345Signature" style="color:inherit;background-color:inherit">
<div style="background-color:rgb(255,255,255);font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div dir="ltr" id="m_478286811837034506x_x_m_-2907562466910451345divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;background-color:inherit">
<p style="line-height:normal;background-color:white;margin:0px 0px 11px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">Sincerely:</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Courier New",monospace;font-size:14pt;color:red"><b><u>J.A. Ferrand</u></b></span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">Embry-Riddle Aeronautical University - Daytona Beach - FL<br>
Ph.D. Candidate, Aerospace Engineering</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">M.Sc. Aerospace Engineering</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">B.Sc. Aerospace Engineering</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">B.Sc. Computational Mathematics</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)"><br>
</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black"><u>Phone:</u> (386)-843-1829</span></p>
<p style="line-height:normal;background-color:white;margin:0px"><span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black"><u>Email(s):</u> <a href="mailto:ferranj2@my.erau.edu" id="m_478286811837034506OWA41fc8cd1-1810-77b6-926b-326591846547" style="margin-top:0px;margin-bottom:0px" target="_blank">ferranj2@my.erau.edu</a></span></p>
<p style="text-indent:0.5in;line-height:normal;background-color:white;margin:0px">
<span style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:black">   
<a href="mailto:jesus.ferrand@gmail.com" id="m_478286811837034506OWA304e1462-e04c-b5c5-bed1-78b0133bc708" style="margin-top:0px;margin-bottom:0px" target="_blank">
jesus.ferrand@gmail.com</a></span></p>
</div>
</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">--</div>
<div style="direction:ltr">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 style="direction:ltr"><br>
</div>
<div style="direction:ltr"><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbKClgWhj$" id="m_478286811837034506OWA0c629e0e-c014-53ea-79d4-04dc21b18366" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dYZsj6bNyjrW3n2ZUHSK0N1eCUS5ylIPHxjjS0SQT-DSlMCOeipzRVmuuasQCL9GHi7tXPQbRftLbKClgWhj$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>