<div dir="ltr"><div dir="ltr">On Sat, Feb 18, 2023 at 6:41 AM Zongze Yang <<a href="mailto:yangzongze@gmail.com">yangzongze@gmail.com</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 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>  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 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:1px solid 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>    plex = mesh.topology_dm<br>    with PETSc.Log.Event("ADD_ADAPT_LABEL"):<br>        plex.createLabel('adapt')<br>        cs, ce = plex.getHeightStratum(0)<br>        for i in range(cs, ce):<br>            plex.setLabelValue('adapt', i, 2)<br>            <br>    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>-- <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><br></div></div></div></div></div></div></div></div>