<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannerqkr26u4 { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #D0D8DC !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtonqkr26u4:hover, .pfptPrimaryButtonqkr26u4:focus {
background-color: #b4c1c7 !important; }
.pfptPrimaryButtonqkr26u4: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 Mon, May 6, 2024 at 4: 33 PM Ferrand, Jesus A. <FERRANJ2@ my. erau. edu> wrote: "What is the argument for this optimization?" Ah! That's all I had really. That you would skip this one malloc step but without regard to the
</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="pfptBannerqkr26u4" 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="pfptBannerqkr26u4" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
<div id="pfptBannerqkr26u4" 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="pfptBannerqkr26u4" 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 Mon, May 6, 2024 at 4:33 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="msg-9024502671646608584">
<div dir="ltr">
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
"What is the argument for this optimization?"<br>
<br>
Ah!</div>
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
That's all I had really.<br>
That you would skip this one malloc step but without regard to the grander picture.<br>
I had a gut feeling that it is a sizeable double malloc because it is the cell connectivity.</div>
<div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
However, once you bring into perspective all the other stuff (CellOrientation, Vecs, etc.) it does seem like a micro-optimization.<br>
If in your estimation this isn't worth the development, then I'll continue to follow the guidance from the PETSc source code.<br></div></div></div></blockquote><div><br></div><div>Once everything is coded, we can put in monitoring, and see if it would make a difference.</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-9024502671646608584"><div dir="ltr"><div style="font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)"></div>
<hr style="display:inline-block;width:98%">
<div id="m_-5822931619874815348divRplyFwdMsg" 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> Monday, May 6, 2024 10:55 AM<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> Re: [EXTERNAL] Re: [petsc-users] Is there anything like a "DMPlexSetCones()" ?</span>
<div> </div>
</div>
<div style="direction:ltr">On Mon, May 6, 2024 at 10:17 AM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA438bc70e-694c-fc6d-9697-3a449ddbb2df" 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 style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
"The cone sizes are used to allocate the array to hold the cones. How would you have an array holding the cone information without knowing the sizes?"</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)">
You're right, I must first know the sizes (which I determine from the file).</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
It lists the number of cells and their types by sequential chunks.</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)">
The issue I am trying to describe, is that because I cannot know the number of local vertices a priori, the pipeline DMSetChart()->DMPlexSetConeSize()->DMSetUp() essentially produces a redundant array (because I already have the connectivity that I read
from the file).</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
As far as I can tell, in my case, the end result of calling these APIs is already available, hence my wish for a "DMPlexSetCones()".</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
If such an API existed, I would then attempt to retroactively set the Chart and the ConeSizes.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
<br>
Like you hinted in a reply, for this extra array to be worthwhile, I would have to keep it as a global numbering list (which I want to by the way).<br>
I was hoping to at least keep them in the DM's global PetscSection as offsets.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Unfortunately, PetscSection has a similar workflow to DM: PetscSectionSetChart(), PetscSectionAddDof(), PetscSectionSetUp(), PetscSectionSetOffset().</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">I looked at the other parallel code. It does maintain two arrays, so that you can compute this stuff.</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">I am reluctant to add this interface, since I think the optimization is very small and it is not a good pattern.</div>
<div style="direction:ltr">You will save allocating the cell connectivity. However, if you interpolate the mesh, this is small. This is the</div>
<div style="direction:ltr">same size as the cell orientations, which we will also have to allocate. We are likely to allocate vectors over the mesh. It does not seem likely that this allocation will increase the peak allocation, and it will be freed after
creation, so total size will not be affected. What is the argument for this optimization?</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317divRplyFwdMsg" 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" id="m_-5822931619874815348OWA7bb98600-9d6d-dbb3-bc14-78ebf9db8d17" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Monday, May 6, 2024 7:52 AM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA18d6de4a-71aa-5c0c-87bc-95f140ce4a18" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA6a2ef89f-4f13-2eb6-3f2b-4620b3b0936a" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA1a0ca420-7a00-444b-0717-7c8017dee4a7" 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">On Fri, May 3, 2024 at 7:32 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA8fec15ca-a149-8d63-9eba-5369df667c7a" 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 style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
"Right, but that means that the connectivity you read in is not in local numbering. You will have to renumber it, so making a copy is probably necessary anyway. This is the same sort of processing I do for the parallel read."</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)">
True, the connectivity is read in global numbering.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Renumbering is facilitated by the table from PetscHashSetI.<br>
The connectivity list I am able to renumber in place though, I don't see the need to have another interim copy of the numbers.</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
My concern is that I have two memory chunks that both contain the same information.<br>
The only reason It has to be this way is because I can't manually set the Cones first and the Chart/ConeSizes second.</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">The cone sizes are used to allocate the array to hold the cones. How would you have an array holding the cone information without knowing the sizes?</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670divRplyFwdMsg" 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" id="m_-5822931619874815348OWA3a0691dd-5fcb-27b6-67a0-184b307b8f4a" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Friday, May 3, 2024 6:45 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWAc180fb58-2a98-621e-ae16-70dcd4fb56f5" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA42f9cf05-932b-8f68-466b-6d747837158e" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA30c8753c-fccf-c989-3979-9f6e70f6f731" 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">On Wed, May 1, 2024 at 6:30 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA284aa8d3-3c0d-b597-f4b9-d3289f0d6ec9" 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 style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
"You know the number of cells if you can read connectivity. Do you mean that the format does not tell you</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
the number of vertices?"</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;margin:0px 40px;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Sort of...</div>
<div style="direction:ltr;margin:0px 40px;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
So, the format does provide the number of vertices, however, due to the way I read the data in parallel I don't know immediately how many local vertices there will be.</div>
<div style="direction:ltr;margin:0px 40px;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Which prevents me from knowing the chart a priori.<br>
I figured out the number of vertices using PetscHashSetI to determine the number of unique entries in the connectivity list.</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">Right, but that means that the connectivity you read in is not in local numbering. You will have to renumber it, so making a copy is probably necessary anyway. This is the same sort of processing I do for the parallel read.</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829divRplyFwdMsg" 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" id="m_-5822931619874815348OWA4566759f-4466-ec2f-5d16-d23d7f4816cb" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:52 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWAc1becc73-ac4b-6055-b444-d41f0a7ddbb2" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA843f6e5f-0def-f9fd-3b64-4bdb068d84cb" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA33f1e1e6-9ee2-56a2-d4fe-5aca77061049" 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">On Wed, May 1, 2024 at 4:23 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWAd4a8a879-5958-ec9d-ad8c-509c3aad7fdd" 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 style="direction:ltr;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="direction:ltr;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="direction:ltr;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="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)">
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="direction:ltr;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>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">You know the number of cells if you can read connectivity. Do you mean that the format does not tell you</div>
<div style="direction:ltr">the number of vertices?</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWAe7524fd8-c2a4-2ee2-b279-2cf897e74bca" 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" id="m_-5822931619874815348OWAc4dad534-4513-905e-9b7c-8ba62dc9d3f6" target="_blank">knepley@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA3bcbacdf-1648-2d0f-2182-065ca7b7d77e" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAcfcb1051-b481-e19d-fa35-2a15745e27ff" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWA5e1b32fa-96c7-0f9b-ebac-cbed86b9baf3" target="_blank">PetscErrorCode</a> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DMSetUp/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEFRaFnFP$" id="m_-5822931619874815348OWAd27e322d-8c54-9d06-975a-b1eafdaa1796" target="_blank">DMSetUp</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEOsMzn8I$" id="m_-5822931619874815348OWA18c0b4ab-310a-924a-97ef-dd81e367d6ec" target="_blank">DM</a> dm)</b>
817: {
818: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionBegin/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYECLIvlTF$" id="m_-5822931619874815348OWAcc03ab81-66f3-bdb1-94ba-16cec1c7b907" target="_blank">PetscFunctionBegin</a>;
820: if (dm->setupcalled) <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWA5d2c862d-d614-d79e-4b42-000c0f06d3c6" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAde771e89-f2d2-be29-d09e-a97cebf37061" target="_blank">PETSC_SUCCESS</a>);
821: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscTryTypeMethod/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEMNOEPZO$" id="m_-5822931619874815348OWA3d8a955c-a847-0381-1ed3-b02bd534d431" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEEwtC_Xx$" id="m_-5822931619874815348OWA1d61bb28-98b0-9d08-ff1f-5f01057a5e70" target="_blank">PETSC_TRUE</a>;
823: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWA1873ee73-f597-0978-dc5a-ebafb143db1b" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAe8449719-feb1-fc53-58c5-6e7828380852" 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" id="m_-5822931619874815348OWA4b7c2c6f-1a14-c8cd-a1f1-763c5f00e6cd" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA2d2ef464-dfe3-d028-98f6-4522e67b745c" 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" id="m_-5822931619874815348OWAf52becc1-4022-7612-57b5-16f46203f5f6" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA54e20dee-72f2-62c7-380a-bdd29d11da1b" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA6a0a07c2-104a-26a1-0ba8-e465ce60a893" 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_-5822931619874815348OWA22e5c66e-6840-ef4b-e5e9-59fbdc0f0369" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWA9da039c9-082e-3ad0-f938-1deba470ee6b" 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_-5822931619874815348OWAf49e8d2c-1f1e-5258-5a63-2447dc3346d6" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA7904603e-9760-65bc-e663-ece37b1aca8f" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA9adb94ed-2dd9-7418-a0c9-d97a1834b498" 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" id="m_-5822931619874815348OWAc3fc2831-779a-12b6-cc20-55399f64026c" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA624cc2af-db90-7d88-3871-b3ebf7fa0ad9" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA61564148-0de2-6d03-eabe-f6b9ed2e2244" 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_-5822931619874815348OWAd354de41-0cd8-8407-780a-11651054d2a9" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWA6d5d30e0-fbe2-0ba2-b176-aeb3a8b7d160" 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_-5822931619874815348OWAd78e4ff5-9e56-b82b-93c1-e30b133bde28" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA6fa8fd52-cd4b-69c4-a840-29edb876af21" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA14a2698c-a785-91cb-7053-56b50b48ce58" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829appendonsend" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829divRplyFwdMsg" 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" id="m_-5822931619874815348OWAbaa3f3e3-35b0-5e90-6735-9c959c01397b" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:52 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA3fcdf1a4-d70b-5490-df8c-eeaa959af4e0" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA83101533-def7-38d9-853a-778d32ec0cbf" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA5dbfc57a-bfed-6503-9285-c8005799f0e9" 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">On Wed, May 1, 2024 at 4:23 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWAd109b09e-8c26-31cb-e3dc-5a37862cbc2f" 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 style="direction:ltr;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="direction:ltr;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="direction:ltr;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="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)">
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="direction:ltr;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>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">You know the number of cells if you can read connectivity. Do you mean that the format does not tell you</div>
<div style="direction:ltr">the number of vertices?</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA3695cc76-e03b-58e8-34ae-905bb0540998" 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" id="m_-5822931619874815348OWA8a15bcf9-4bb3-2a1b-02f2-fbdf44917465" target="_blank">knepley@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA5d35acff-b32d-55f7-af6b-0bf3bbf50cf7" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA77c0888a-5e74-5fb0-cc3f-b0cb2f9af321" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWA9a0fe07b-55df-e3e0-5bc4-7e0ce056e2db" target="_blank">PetscErrorCode</a> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DMSetUp/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEFRaFnFP$" id="m_-5822931619874815348OWAd7079e30-7c8d-70e3-07eb-e555e5eaf7b6" target="_blank">DMSetUp</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEOsMzn8I$" id="m_-5822931619874815348OWA0cc0eedd-7098-6606-dff2-5a72e676e1da" target="_blank">DM</a> dm)</b>
817: {
818: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionBegin/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYECLIvlTF$" id="m_-5822931619874815348OWAa8140f9e-c83a-f2ef-a9b4-97a2579d53db" target="_blank">PetscFunctionBegin</a>;
820: if (dm->setupcalled) <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWA2cb0d969-f223-82d1-a1fc-837c2e4fd45d" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAf6d8c94f-855c-9ed1-0de5-b57dc2090a92" target="_blank">PETSC_SUCCESS</a>);
821: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscTryTypeMethod/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEMNOEPZO$" id="m_-5822931619874815348OWA5d9f34a6-c752-20f2-b34f-bd93523e12b6" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEEwtC_Xx$" id="m_-5822931619874815348OWAb77d07e3-0304-954a-7542-9f6a328cdbab" target="_blank">PETSC_TRUE</a>;
823: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWAb57adb07-8316-7568-b847-5b4427afe187" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAa5e55690-4666-849f-30f7-474b8128716d" 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" id="m_-5822931619874815348OWA0e209a80-0f96-ad1b-90fd-9b668c80bed6" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA9c3aeff3-d0e0-1197-36e4-b09b46a80a09" 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" id="m_-5822931619874815348OWA1b6f5895-4e7d-7127-7851-43f19ad61809" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA090e93a2-cb57-b323-a688-1a49243070e4" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA18fa8dc9-c08a-50fc-44bd-b80ce3868f2c" 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_-5822931619874815348OWA891adb47-c709-13c9-b0b5-9a7d4b28f7fa" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWAc4810480-3976-735c-7467-b90153552d05" 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_-5822931619874815348OWA29083368-d202-34e4-b0ba-921c22e64c4a" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA68cf7efd-8757-5da4-0ce5-5297a639f9dd" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA12f665fd-ead7-c343-3433-9b2e49ddd345" 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" id="m_-5822931619874815348OWA26052068-9eb9-b345-f440-fb032409ca05" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA9d8c4e2d-5ef0-994f-50cf-10d124c54a6c" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA459ed3e7-3770-b873-a0c2-c1428e4f3793" 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_-5822931619874815348OWA9cfc962a-eea6-7ba2-f80f-e00b50aa34ff" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWAd38ed4d4-7173-ed98-bd22-06d9f93ae094" 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_-5822931619874815348OWAc8d61afe-8ed8-0cbc-c4a2-14614b52bb6f" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWAb5bdcdb1-eab7-4ca4-61bb-857d23d40ad0" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWAc73d42a2-7b1a-4657-802a-65f412d4da9c" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA22ff36b9-eb6e-71b1-377b-4768944d8722" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670appendonsend" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670divRplyFwdMsg" 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" id="m_-5822931619874815348OWA88319e18-96f6-afb2-dc86-36841b7ab7f5" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Friday, May 3, 2024 6:45 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA5fa05744-31b6-837a-a230-3c64621d5dda" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA7d71eb85-a3de-d005-e735-66a7c4a59a7b" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA0506d098-ecab-5ca1-50fe-805178a08ffd" 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">On Wed, May 1, 2024 at 6:30 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA5023af4c-6e8f-5ba1-f5e2-5cadb59c9908" 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 style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
"You know the number of cells if you can read connectivity. Do you mean that the format does not tell you</div>
<div style="direction:ltr;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
the number of vertices?"</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;margin:0px 40px;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Sort of...</div>
<div style="direction:ltr;margin:0px 40px;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
So, the format does provide the number of vertices, however, due to the way I read the data in parallel I don't know immediately how many local vertices there will be.</div>
<div style="direction:ltr;margin:0px 40px;font-family:"Times New Roman",Times,serif;font-size:12pt;color:rgb(0,0,0)">
Which prevents me from knowing the chart a priori.<br>
I figured out the number of vertices using PetscHashSetI to determine the number of unique entries in the connectivity list.</div>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">Right, but that means that the connectivity you read in is not in local numbering. You will have to renumber it, so making a copy is probably necessary anyway. This is the same sort of processing I do for the parallel read.</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829divRplyFwdMsg" 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" id="m_-5822931619874815348OWAc6b04277-0dfa-7e37-130c-68cc6b8c58b6" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:52 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA1a2fc4db-9fd0-a3d1-8eb9-85ebc601f9b4" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAeeec0b47-969a-ccf9-7f19-bfb8415aac93" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAa2cf339a-744a-9304-0ee9-dd38ba6e965a" 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">On Wed, May 1, 2024 at 4:23 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA98e8405e-c239-ca49-7b29-9629d8a45a61" 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 style="direction:ltr;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="direction:ltr;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="direction:ltr;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="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)">
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="direction:ltr;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>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">You know the number of cells if you can read connectivity. Do you mean that the format does not tell you</div>
<div style="direction:ltr">the number of vertices?</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWAebf5af04-d4d4-f69a-b110-8df45a02e7fd" 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" id="m_-5822931619874815348OWA2464fbea-d7b3-74ca-f1c8-17a2d9dd281b" target="_blank">knepley@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA007b5e5c-8107-0263-3ad4-f310ab871dd9" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAf22f7e6c-01e1-d586-a126-2252a1395017" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAe89b8121-2496-c9b7-5181-e2335ab8be82" target="_blank">PetscErrorCode</a> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DMSetUp/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEFRaFnFP$" id="m_-5822931619874815348OWA474f6a41-daeb-1f37-361f-ca370f53ea30" target="_blank">DMSetUp</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEOsMzn8I$" id="m_-5822931619874815348OWAe338b1dd-e7b5-d374-8098-5e622ed307f2" target="_blank">DM</a> dm)</b>
817: {
818: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionBegin/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYECLIvlTF$" id="m_-5822931619874815348OWAfbc60578-4e36-f198-832f-4a0eaf0a2804" target="_blank">PetscFunctionBegin</a>;
820: if (dm->setupcalled) <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWAbdc8f24b-811f-f5a5-07d8-10fb2322fb64" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWA495204ff-e24a-76cc-d6c8-a100563280b5" target="_blank">PETSC_SUCCESS</a>);
821: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscTryTypeMethod/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEMNOEPZO$" id="m_-5822931619874815348OWA89c724b0-a4b9-fce9-608b-ea1fa71b2ebd" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEEwtC_Xx$" id="m_-5822931619874815348OWA00377105-8fc5-b7f1-99f0-2409b8723656" target="_blank">PETSC_TRUE</a>;
823: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWA8e21d0f0-3cf7-1fac-5a3d-fb4d025d69b5" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWA62409d09-4afa-aece-606c-5a5a06fd0223" 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" id="m_-5822931619874815348OWA9e7c294d-0546-c2e5-65ff-7293d8d677e5" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA1e4310f5-8f45-5d06-e148-8c243aee0be1" 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" id="m_-5822931619874815348OWAfa9ca5a6-991c-463d-5a77-d648ac59711e" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA0de88c52-de08-f10e-5de9-a7713280015d" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAfa2b9afd-8727-2e17-623b-c5ad803cf475" 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_-5822931619874815348OWA797c6e3c-3568-8587-42df-59e798ca9043" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWA3de75662-0fbb-c601-ac4b-128930e7bd88" 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_-5822931619874815348OWA60951ae7-bc52-3838-28f1-79442e42dd9e" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA8f7d5c99-66b7-919b-f331-0cf5ae0648fa" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWAf41f1b9c-5550-f2fd-acac-00abe50024ec" 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" id="m_-5822931619874815348OWA1bd60177-527f-0f5d-923d-ac7ec2eb6c7e" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA08024eb0-e454-750a-572b-9f565ca17662" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA0769eb51-34b6-03c8-7cec-1866e80d37b8" 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_-5822931619874815348OWA1f78058b-b856-cadb-b75f-d9e48d0699e1" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWAc6330071-c3e3-c3bd-1228-3f93fcd0c810" 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_-5822931619874815348OWA92f73a1f-c79b-8917-4861-cbbaa476d7cb" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA2c4abef4-9811-5c4f-9755-115d8755f565" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA6897eceb-edc2-a626-b234-f1465adefb8c" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829appendonsend" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829divRplyFwdMsg" 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" id="m_-5822931619874815348OWAcddbda9d-fb66-3add-9ef9-8573dc2845c1" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Wednesday, May 1, 2024 8:52 PM<br>
<b>To:</b> Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWAe35b5080-1c6f-cb12-3af8-a4a8bc890e5c" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAc65cb76b-d825-e8ec-284f-081f57c48c2a" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA7c05e21c-6939-5319-fcfc-b5c3fd67ae7a" 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">On Wed, May 1, 2024 at 4:23 PM Ferrand, Jesus A. <<a href="mailto:FERRANJ2@my.erau.edu" id="m_-5822931619874815348OWA396d9073-3c79-4da6-31ac-ec86e5356a89" 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 style="direction:ltr;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="direction:ltr;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="direction:ltr;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="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)">
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="direction:ltr;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>
</blockquote>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">You know the number of cells if you can read connectivity. Do you mean that the format does not tell you</div>
<div style="direction:ltr">the number of vertices?</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)">
<hr style="direction:ltr;display:inline-block;width:98%">
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA0619d299-8f65-7b38-e6f2-95a8cdcc99fe" 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" id="m_-5822931619874815348OWA9a68fe3f-efcf-fe09-7699-f31aae8b51fd" target="_blank">knepley@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA71dd1d01-6248-3a38-58b1-01bfa8682734" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAbce7241b-db14-8deb-3021-a67bfcfdff83" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAdcf2aac4-a637-8200-ab2d-f56cceb704c5" target="_blank">PetscErrorCode</a> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DMSetUp/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEFRaFnFP$" id="m_-5822931619874815348OWAd7afb680-1554-f458-baad-983048e1de93" target="_blank">DMSetUp</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEOsMzn8I$" id="m_-5822931619874815348OWA9e8deb8a-750d-b947-c2a3-6948f9244ba9" target="_blank">DM</a> dm)</b>
817: {
818: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionBegin/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYECLIvlTF$" id="m_-5822931619874815348OWAa84beeb6-b6db-f7fc-dbe2-43cdb6c38d19" target="_blank">PetscFunctionBegin</a>;
820: if (dm->setupcalled) <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWA22db9da2-2f0e-6b38-bc54-49d48d79325c" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAfcd1045f-09b6-49aa-9eff-d8216dfbac95" target="_blank">PETSC_SUCCESS</a>);
821: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscTryTypeMethod/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEMNOEPZO$" id="m_-5822931619874815348OWA1d74ad24-5006-45e7-d36b-5ac8f098683e" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEEwtC_Xx$" id="m_-5822931619874815348OWA9ad97880-f36f-9881-0690-7f0dfba00f8a" target="_blank">PETSC_TRUE</a>;
823: <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscFunctionReturn/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEPMSYHRs$" id="m_-5822931619874815348OWAfe1bf050-e308-9b2f-230d-e68cad5ffa7b" target="_blank">PetscFunctionReturn</a>(<a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Sys/PetscErrorCode/__;!!G_uCfscf7eWS!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEKC-qu2V$" id="m_-5822931619874815348OWAebfeeaf9-426c-1fad-7883-0427f824142c" 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" id="m_-5822931619874815348OWAbc620bc1-024c-b4cc-47ed-3a0032f91460" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWA67d31c20-19b4-c810-0ea6-4e1b45c4a5d0" 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" id="m_-5822931619874815348OWAd24b5e24-989f-1f05-f06b-ceceaa810eba" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA2f1ea625-c301-421a-8141-31dd9c222d7a" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWAf045b829-1e51-6eed-3bc1-4264cf69985e" 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_-5822931619874815348OWA15c94f36-f989-c08d-05be-947537528d3d" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWA234e6b48-b3ac-8dde-45e7-6123551e50df" 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_-5822931619874815348OWA4b5ef144-6f3f-b983-8501-2099df7d2486" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWA77c1228f-6551-2f9d-fb24-b30e2fe2895d" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
<div id="m_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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" id="m_-5822931619874815348OWAd56093d0-a4a4-5294-2eb5-e6e6c7f66efa" 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" id="m_-5822931619874815348OWAd074b48d-800e-6f8a-4032-5ab8e741060c" target="_blank">FERRANJ2@my.erau.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA6ea44506-6648-ea50-6363-abae995d6136" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="m_-5822931619874815348OWA4698809c-09ed-12c9-e0ae-ac7dd10632b5" 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_-5822931619874815348OWAcaa0078b-3d4e-c305-04ea-f875f8052783" 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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348x_m_5639659620372591317x_m_-6243239857549940670x_m_4321204284333071829x_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_-5822931619874815348OWA291a6963-cc6a-df93-8d6a-ceaec2dd533c" 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_-5822931619874815348OWA6395b9c9-31d6-730c-52c6-03d3a6672532" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWAa7072c4b-4363-08ce-2c56-7504f5633440" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWAba0fb755-1e48-b276-acce-26727df12972" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWAf54eec75-93e4-3777-0858-6435a8702989" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWAc3a5a851-8710-d9e1-1665-cec0de6a82f2" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" id="m_-5822931619874815348OWAb7e69984-2da5-da95-982b-f3243d786f4a" 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!e9WPKXONc0pLYPYlljjUQFKHdYCzY9jNdMc8ArfhWOkp0rNjus9LqI5q44BmF41a_NqGuSVzGofYEDpqhdq6$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>