[petsc-users] dmplex, triangle and generating unstructured mesh

Matthew Knepley knepley at gmail.com
Mon Jun 16 06:53:19 CDT 2025


On Mon, Jun 16, 2025 at 7:38 AM Nicolas Barral <
nicolas.barral at math.u-bordeaux.fr> wrote:

> On 14/06/2025 18:45, Steven Dargaville wrote:
> > Hi, I'm just wondering if it is possible to generate a simple
> > unstructured mesh in 2D with DMPlex and one of the external generators,
> > like triangle?
> >
> > I'm running snes/tutorials/ex20 which uses triangle and I can only seem
> > to generate structured triangular meshes. It is a simple 2D box so it
> > makes sense a Delaunay might output a structured mesh in that case. I
> > know I could get the DM to read in an unstructured mesh from a file that
> > I have previously generated, but for ease I'm wondering if this can be
> > done directly.
> >
> > I've tried a few different things to try and force an unstructured mesh
> > being generated, like changing the number of faces to 1 (-
> > dm_plex_box_faces 1,1) so it only sees the corners of the box domain.
> >
> > I've also tried to set some of the options to triangle with
> > DMPlexTriangleSetOptions but that doesn't seem to have any effect, so
> > I'm guessing I'm potentially not using it correctly (and I can't seem to
> > find any examples that use this function to help).
> >
> > Anyone have any suggestions? Thanks for your help
>
> I don't know how the mesh is generated, but a workaround would be to
> generate a coarse mesh then use the adaptive remeshing functions (e.g.
> with MMG) - with a uniform metric if you want a uniform mesh.
> plex/tests/ex19 should show how it works.
>

Is the idea just to get something that "looks unstructured"? You can
usually do that by making the boundary
more complicated. For example, here is NY.

If instead you have some sort of criterion, then you might use AMR as
Nicolas suggests.

  Thanks,

     Matt


> Thanks
>
> --
> Nicolas
> > Steven
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fUgJTt40Ns7Go6ZSrWZ5h3-IUfGrvM4n144mw_tHWwYpNSbsfcGerK4VdEYw7MbkA2qL_6Z35zIY3gKGRtkt$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fUgJTt40Ns7Go6ZSrWZ5h3-IUfGrvM4n144mw_tHWwYpNSbsfcGerK4VdEYw7MbkA2qL_6Z35zIY3rMmYvHA$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250616/fb3f5f0d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NYSMesh.png
Type: image/png
Size: 130472 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250616/fb3f5f0d/attachment-0001.png>


More information about the petsc-users mailing list