<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 27 Feb 2023, at 4:42 PM, Matthew Knepley <knepley@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;"><div dir="ltr">On Mon, Feb 27, 2023 at 10:26 AM Pierre Jolivet <<a href="mailto:pierre@joliv.et">pierre@joliv.et</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div><div><blockquote type="cite"><div>On 27 Feb 2023, at 4:16 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr" style="font-family: Helvetica; font-size: 12px; 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;"><div dir="ltr">On Mon, Feb 27, 2023 at 10:13 AM Pierre Jolivet <<a href="mailto:pierre@joliv.et" target="_blank">pierre@joliv.et</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div><div><blockquote type="cite"><div>On 27 Feb 2023, at 3:59 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr" style="font-family: Helvetica; font-size: 12px; 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;"><div dir="ltr">On Mon, Feb 27, 2023 at 9:53 AM Zongze Yang <<a href="mailto:yangzongze@gmail.com" target="_blank">yangzongze@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr"><div>Hi, Matt,</div><div><br></div>I tested coarsening a mesh by using ParMMg without firedrake, and found some issues:<div> see the code and results here: <a href="https://gitlab.com/petsc/petsc/-/issues/1331" target="_blank">https://gitlab.com/petsc/petsc/-/issues/1331</a></div><div><br></div><div>Could you have a look and give some comments or suggestions?</div></div></blockquote><div><br></div><div>I replied on the issue. More generally, the adaptive refinement software has not seen wide use</div></div></div></div></blockquote><div><br></div><div>:)</div><div>Matt probably meant “the _DMPlex interface_ to adaptive refinement software has not seen wide use”, Mmg has been rather widely used for 10+ years (here is a 13-year old presentation <a href="https://www.ljll.math.upmc.fr/hecht/ftp/ff++days/2010/exposes/Morice-MeshMetric.pdf" target="_blank">https://www.ljll.math.upmc.fr/hecht/ftp/ff++days/2010/exposes/Morice-MeshMetric.pdf</a>).</div></div></div></blockquote><div><br></div><div>The interface is certainly new, but even ParMMG is only from Nov 2016, which is very new if you are an old person :)</div></div></div></div></blockquote><div><br></div><div>Indeed. In fact, I do believe we should add a DMPlex mechanism to centralize (redistribute on a single process) a DMPlex and to call Mmg instead of ParMmg.</div><div>It would certainly not be scalable for large meshes but:</div><div>1) there is no need for ParMmg on small-/medium-scale meshes</div><div>2) Mmg is more robust than ParMmg at this point in time</div><div>3) Mmg has more feature than ParMmg at this point in time, e.g., implicit remeshing using a level-set</div><div>4) there is more industry money funnelled into Mmg than into ParMmg </div><div>I think the mechanism I mentioned initially was in the TODO list of the Firedrake people (or yours?), maybe it’s already done, but in any case it’s not hooked in the Mmg adaptor code, though it should (erroring out in the case where the communicator is of size greater than one would then not happen anymore).</div></div></div></blockquote><div><br></div><div>Yes, we used to do the same thing with partitioners. We can use DMPlexGather().</div><div><br></div><div>I thought MMG only did 2D and ParMMG only did 3D, but this must be wrong now. Can MMG do both?</div></div></div></div></blockquote><div><br></div><div>Mmg does 2D, 3D, and 3D surfaces.</div><div>ParMmg only does 3D (with no short-term plan for 2D or 3D surfaces).</div><div><br></div><div>Thanks,</div><div>Pierre</div><br><blockquote type="cite"><div><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;"><div class="gmail_quote"><div> <span class="Apple-converted-space"> </span>Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div><div><div>Thanks,</div><div>Pierre</div><br><blockquote type="cite"><div><div dir="ltr" style="font-family: Helvetica; font-size: 12px; 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;"><div class="gmail_quote"><div> <span> </span>Thanks,</div><div><br></div><div> <span class="Apple-converted-space"> </span>Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div><div><div>Thanks,</div><div>Pierre</div><br><blockquote type="cite"><div><div dir="ltr" style="font-family: Helvetica; font-size: 12px; 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;"><div class="gmail_quote"><div>, and I expect</div><div>more of these kinds of bugs until more people use it.</div><div><br></div><div> <span> </span>Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr"><div><div><div><div dir="ltr"><div dir="ltr">Best wishes,<div>Zongze</div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 27 Feb 2023 at 20:19, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr"><div dir="ltr">On Sat, Feb 18, 2023 at 6:41 AM Zongze Yang <<a href="mailto:yangzongze@gmail.com" target="_blank">yangzongze@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr">Another question on mesh coarsening is about `DMCoarsen` which will fail when running in parallel.<div><br></div><div>I generate a mesh in Firedrake, and then create function space and functions, after that, I get the dmplex and coarsen it.</div><div>When running in serials, I get the mesh coarsened correctly. But it failed with errors in ParMMG when running parallel.</div><div><br></div><div>However, If I did not create function space and functions on the original mesh, everything works fine too.</div><div><br></div><div>The code and the error logs are attached.</div></div></blockquote><div><br></div><div>I believe the problem is that Firedrake and PETSc currently have incompatible coordinate spaces. We are working</div><div>to fix this, and I expect it to work by this summer.</div><div><br></div><div> <span> </span>Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr"><div>Thank you for your time and attention。<br></div><div><br clear="all"><div><div dir="ltr"><div dir="ltr">Best wishes,<div>Zongze</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 18 Feb 2023 at 15:24, Zongze Yang <<a href="mailto:yangzongze@gmail.com" target="_blank">yangzongze@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr"><div>Dear PETSc Group,</div><div><br></div><div>I am writing to inquire about the function DMAdaptLabel in PETSc. </div><div>I am trying to use it coarse a mesh, but the resulting mesh is refined.</div><div><br></div><div>In the following code, all of the `adpat` label values were set to 2 (DM_ADAPT_COARSEN).</div><div>There must be something wrong. Could you give some suggestions?</div><div> <br></div><div>```python</div><div>from firedrake import *<br>from firedrake.petsc import PETSc<br><br>def mark_all_cells(mesh):<br> <span> </span>plex = mesh.topology_dm<br> <span> </span>with PETSc.Log.Event("ADD_ADAPT_LABEL"):<br> <span> </span>plex.createLabel('adapt')<br> <span> </span>cs, ce = plex.getHeightStratum(0)<br> <span> </span>for i in range(cs, ce):<br> <span> </span>plex.setLabelValue('adapt', i, 2)<br> <span> </span><br> <span> </span>return plex<br><br>mesh = RectangleMesh(10, 10, 1, 1)<br><br>x = SpatialCoordinate(mesh)<br>V = FunctionSpace(mesh, 'CG', 1)<br>f = Function(V).interpolate(10 + 10*sin(x[0]))<br>triplot(mesh)<br><br>plex = mark_all_cells(mesh)<br>new_plex = plex.adaptLabel('adapt')<br>mesh = Mesh(new_plex)<br>triplot(mesh)<br></div><div>```</div><div><br>Thank you very much for your time.<br></div><br>Best wishes,<br><div><div dir="ltr"><div dir="ltr"><div>Zongze</div></div></div></div></div></blockquote></div></blockquote></div><br clear="all"><div><br></div>--<span> </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div></blockquote></div></blockquote></div><br clear="all"><div><br></div>--<span> </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br></div></blockquote></div><br clear="all"><div><br></div>--<span> </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br></div></blockquote></div><br clear="all"><div><br></div>--<span class="Apple-converted-space"> </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br></body></html>