<!-- 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;">
Matt: "I do not understand the "flag check". What is that?" My bad, I should have referred to the "dm->setupcalled". I believe this PetscBool is checked by the other DM (not just DMPlex) APIs. The subsequent
</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="pfptBannertm0pqgu" 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="pfptBannertm0pqgu" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
<div id="pfptBannertm0pqgu" 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="pfptBannertm0pqgu" 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 -->
<html>
<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannertm0pqgu { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #D0D8DC !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtontm0pqgu:hover, .pfptPrimaryButtontm0pqgu:focus {
background-color: #b4c1c7 !important; }
.pfptPrimaryButtontm0pqgu:active {
background-color: #90a4ae !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
Matt:</div>
<div class="elementToProof" style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="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 class="elementToProof" style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="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 class="elementToProof" style="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 class="elementToProof" style="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="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!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUtLMeB-Q$" id="OWA2363a34a-34f7-e380-1e8c-c11d8886da80" class="OWAAutoLink" data-loopstyle="linkonly">PetscErrorCode</a> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DMSetUp/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUPgF7MMU$" id="OWAc8e3c2a2-d216-3ec6-302c-654d2a6c326b" class="OWAAutoLink" data-loopstyle="linkonly">DMSetUp</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUht3yJz4$" id="OWAcfb410f7-0eb8-3180-9844-16e368d7b72a" class="OWAAutoLink" data-loopstyle="linkonly">DM</a> dm)</b>
817: {
818: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionBegin/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUFggIo3o$" id="OWA0fcd4f0e-a508-752c-0b3b-cb6a421f2bb1" class="OWAAutoLink" data-loopstyle="linkonly">PetscFunctionBegin</a>;
820: if (dm->setupcalled) <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoU7-1kX1w$" id="OWA1d52f42f-3f0a-6e6f-239b-d0904978ee02" class="OWAAutoLink" data-loopstyle="linkonly">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUtLMeB-Q$" id="OWA56a43b87-29bd-d137-15c2-29e08cff0fc4" class="OWAAutoLink" data-loopstyle="linkonly">PETSC_SUCCESS</a>);
821: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscTryTypeMethod/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUmqkFeuk$" id="OWA2d6d4064-2cb7-494a-cb13-72e366b7895f" class="OWAAutoLink" data-loopstyle="linkonly">PetscTryTypeMethod</a>(dm, setup);
822: dm->setupcalled = <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PETSC_TRUE/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUVfOOOpc$" id="OWAe3b1e690-8474-1afb-f867-24c3fb0ec57f" class="OWAAutoLink" data-loopstyle="linkonly">PETSC_TRUE</a>;
823: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoU7-1kX1w$" id="OWAde329e69-8751-8db2-9cf9-0801d912e015" class="OWAAutoLink" data-loopstyle="linkonly">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoUtLMeB-Q$" id="OWA2b3e921d-28bd-ebff-d630-13a0a5505255" class="OWAAutoLink" data-loopstyle="linkonly">PETSC_SUCCESS</a>);
824: }</div></pre>
<div class="elementToProof" style="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 class="elementToProof" style="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 class="elementToProof" style="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 petsc-users@mcs.anl.gov and not just to the individual email accounts of the developers, right?</div>
<div class="elementToProof" style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend" style="color: inherit; background-color: inherit;"></div>
<div style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="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 <knepley@gmail.com><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:07 PM<br>
<b>To:</b> Ferrand, Jesus A. <FERRANJ2@my.erau.edu><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> [EXTERNAL] Re: [petsc-users] Is there anything like a "DMPlexSetCones()" ?</span>
<div> </div>
</div>
<table style="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; border-collapse: collapse; border-spacing: 0px; box-sizing: border-box;">
<tbody>
<tr>
<td style="text-align: left; line-height: 1.5; padding: 5px 10px;">
<div style="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>
<br>
<div style="direction: ltr;">On Wed, May 1, 2024 at 3:34 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="OWA9fc7d4b7-5a64-1bc6-afc6-b7d7ad13f379" class="OWAAutoLink" data-loopstyle="linkonly">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="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="x_m_-2907562466910451345pfptBanner5674lmf" style="float: left; display: block; margin: 0px 0px 1px; max-width: 600px; color: inherit; background-color: inherit;">
<div id="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="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;" data-listchain="__List_Chain_785" 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="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="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="OWAe0fde336-e0f3-5e2a-58ea-59005d3efc4e" class="OWAAutoLink" style="margin-top: 0px; margin-bottom: 0px;" data-loopstyle="linkonly">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="OWAdc7a9d35-da30-616d-34ba-a05b749df518" class="OWAAutoLink" style="margin-top: 0px; margin-bottom: 0px;" data-loopstyle="linkonly">
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!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoU4UlOUm0$" id="OWAa0c72336-a786-dc89-f378-e7f8d66f2bc9" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="appendonsend" style="color: inherit; background-color: inherit;"></div>
<div style="font-family: "Times New Roman", Times, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="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 <knepley@gmail.com><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:07 PM<br>
<b>To:</b> Ferrand, Jesus A. <FERRANJ2@my.erau.edu><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> [EXTERNAL] Re: [petsc-users] Is there anything like a "DMPlexSetCones()" ?</span>
<div> </div>
</div>
<table style="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; border-collapse: collapse; border-spacing: 0px; box-sizing: border-box;">
<tbody>
<tr>
<td style="text-align: left; line-height: 1.5; padding: 5px 10px;">
<div style="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>
<br>
<div style="direction: ltr;">On Wed, May 1, 2024 at 3:34 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="OWAcdf83e05-a7d9-8dab-c0ba-39c90c9ba1d1" class="OWAAutoLink" data-loopstyle="linkonly">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="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="x_m_-2907562466910451345pfptBanner5674lmf" style="float: left; display: block; margin: 0px 0px 1px; max-width: 600px; color: inherit; background-color: inherit;">
<div id="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="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;" data-listchain="__List_Chain_786" 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="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="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="OWA893cdc5d-a79c-4a9c-256f-a207b670cc5f" class="OWAAutoLink" style="margin-top: 0px; margin-bottom: 0px;" data-loopstyle="linkonly">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="OWA17a32e21-b853-01a2-d519-7b4595c8ea06" class="OWAAutoLink" style="margin-top: 0px; margin-bottom: 0px;" data-loopstyle="linkonly">
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!YFXAyokfQwnPYORwZQ6qcxVJHF6uyeDin1NgKfpvqUZafCX_TGDCu_5NYVR63aFhpdQwl9zaJ_woQpUfaXoU4UlOUm0$" id="OWA81f4808e-e930-85c5-e9d7-07c151739f17" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">https://www.cse.buffalo.edu/~knepley/</a></div>
</body>
</html>