<div dir="ltr"><div dir="ltr">On Thu, Mar 20, 2025 at 12:09 PM Joe Alexandersen via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
<div dir="auto">Great, thanks for the input so far. We will wait for Matt's response soonish.</div></div></blockquote><div><br></div><div>Looking at the code, as Barry says, it should work. Please let us know if it does not.</div><div><br></div><div>You can also do this with Plex, as Mark says. The drawback here is that I do not have code</div><div>to determine that this kind of refinement is nested. Therefore it will fall back to the slow code</div><div>for constructing arbitrary interpolators. If you really wanted this, we could improve the interpolator</div><div>code to be fast for this kind of nesting.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div dir="auto" id="m_675422107470562095ms-outlook-mobile-signature">
<div dir="auto"><span style="font-size:12pt">Sincerely,</span><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Joe Alexandersen</div>
<div dir="auto">Associate Professor</div>
<div dir="auto">DFF Sapere Aude Research Leader</div>
<div dir="auto"><br>
</div>
<div dir="auto">The Faculty of Engineering</div>
<div dir="auto">Institute of Mechanical and Electrical Engineering</div>
<div dir="auto">SDU Mechanical Engineering</div>
<div dir="auto"><br>
</div>
<div dir="auto">T <span style="font-size:12pt">+45 65 50 74 65</span></div>
<div dir="auto">M <span style="font-size:12pt">+45 93 50 72 44</span></div>
<div dir="auto"><br>
</div>
<div dir="auto"><a href="mailto:joal@sdu.dk" target="_blank">joal@sdu.dk</a></div>
<div dir="auto"><a href="https://urldefense.us/v3/__http://www.sdu.dk/ansat/joal__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaaOKv14zQ$" target="_blank">www.sdu.dk/ansat/joal</a></div>
<div dir="auto"><br>
</div>
<div dir="auto">University of Southern Denmark</div>
<div dir="auto">Campusvej 55</div>
<div dir="auto">DK-5230 Odense M</div>
<div dir="auto"><a href="https://urldefense.us/v3/__http://www.sdu.dk__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaYjcKBeNw$" target="_blank">www.sdu.dk</a></div>
<div dir="auto"><br>
</div>
<div>Sent from <a href="https://urldefense.us/v3/__https://aka.ms/AAb9ysg__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaYUzarulQ$" target="_blank">Outlook for Android</a></div>
</div>
<div dir="auto" id="m_675422107470562095mail-editor-reference-message-container"><br>
<hr style="display:inline-block;width:98%">
<div id="m_675422107470562095divRplyFwdMsg" style="font-size:11pt"><strong>From:</strong> Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>><br>
<strong>Sent:</strong> Thursday, March 20, 2025 5:00:31 pm<br>
<strong>To:</strong> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>><br>
<strong>Cc:</strong> Joe Alexandersen <<a href="mailto:joal@sdu.dk" target="_blank">joal@sdu.dk</a>>; <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>
<strong>Subject:</strong> Re: [petsc-users] Semi-coarsening for GMG using DMDA?<br>
</div>
<br>
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" style="color:revert;background-color:revert;background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;direction:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;border:0px;display:table;width:100%;table-layout:fixed;float:none;border-spacing:0px">
<tbody style="color:revert;background-color:revert;background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;width:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;display:block">
<tr style="color:revert;background-color:revert;background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;display:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;width:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert">
<td valign="middle" width="1px" cellpadding="7px 2px 7px 2px" style="color:revert;background-color:rgb(166,166,166);background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;display:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;padding:7px 2px;width:0px">
</td>
<td valign="middle" width="100%" cellpadding="7px 5px 7px 15px" style="color:rgb(33,33,33);background-color:rgb(234,234,234);background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;display:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;table-layout:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;width:100%;padding:7px 5px 7px 15px;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:12px;font-weight:normal;text-align:left">
<div style="color:revert;background-color:revert;background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;display:revert;font-size:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;padding:revert;table-layout:revert;text-align:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;width:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert">
You don't often get email from <a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>. <a href="https://urldefense.us/v3/__https://aka.ms/LearnAboutSenderIdentification__;!!G_uCfscf7eWS!aMq_eBTTAvLdy-GtpWdAVq8zqDaObi_eL0EKi7yFbh6VUSQCx-pDonMSd9Rejkpr3DBMyE15NaasFl50jQ$" style="color:revert;background-color:revert;background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;direction:revert;display:revert;font-size:revert;opacity:revert" target="_blank">
Learn why this is important</a> </div>
</td>
<td valign="middle" align="left" width="75px" cellpadding="7px 5px 7px 5px" style="color:rgb(33,33,33);background-color:rgb(234,234,234);background-image:revert;background-position:revert;background-size:revert;background-repeat:revert;background-origin:revert;background-clip:revert;border:revert;direction:revert;display:revert;height:revert;letter-spacing:revert;line-height:revert;margin:revert;opacity:revert;outline:revert;overflow:revert;table-layout:revert;text-indent:revert;text-orientation:revert;text-overflow:revert;text-transform:revert;vertical-align:revert;white-space:revert;word-break:revert;word-spacing:revert;writing-mode:revert;zoom:revert;width:75px;padding:7px 5px;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:12px;font-weight:normal;text-align:left">
</td>
</tr>
</tbody>
</table>
<div>
<div dir="ltr">We have worked on semi coarsening in DMPlex, but it is not finished and we are not working on it now.
<div><br>
</div>
<div>I'm not sure about how easy it would be in DMDA, but Barry is suggesting that it is doable.</div>
<div><br>
</div>
<div>We need to wait for Matt and he is on travel so his response may be delayed.</div>
<div><br>
</div>
<div>Mark</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Mar 20, 2025 at 11:34 AM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div><br>
</div>
   In theory you can do as you propose. In the context below uniform refinement" only means that the coordinates of the DMDA are ignored so each refinement. The interpolation is fine woth different refinements in the different coordinate directions.
<div><br>
</div>
<div>  Barry</div>
<div><br id="m_675422107470562095m_-8071402959755348940lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On Mar 20, 2025, at 5:56 AM, Joe Alexandersen via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:</div>
<br>
<div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
Dear PETSc developers,</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
We are working with a code that uses regular meshes (DMDA) and geometric multigrid. We would like to go from uniform coarsening/refinement to semi-coarsening/refinement, due to anisotropy in our underlying equations. We have tried to figure out if we can do
 this using built-in functions of PETSc, but it is unclear to us whether we can get it done relatively easily.</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
It seems that we can go from the coarsest grid and refine differently in each direction using DMDASetRefinementFactor and then use DMRefine to define the finer levels. However, from the doc page for DMCreateInterpolation, it states that it only works for "uniform
 refinement" which to me seems to indicate it will not work with different refinement in each direction. But on the other hand, it states that it should work if using DMRefine, which I assume used the information from DMDASetRefinementFactor upon creation?</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
So our questions are: is there are feasible and relatively simple way to do semi-coarsening/refinement of DMDAs for geometric multigrid hierarchies? Would the above work?</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
Thanks in advance!</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
Sincerely,</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
Joe Alexandersen</div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
University of Southern Denmark</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
</div>
<br>
</div>
</div>

</blockquote></div><div><br clear="all"></div><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!cacecPogIX0oMUXWnjWaHZ7dJFfObkYjqmStlNjP3kCbpcRSU1p7oCURf7NF9Zx80rIwseka_1xx3SzbE9he$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>