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

Steven Dargaville dargaville.steven at gmail.com
Sat Jun 14 11:45:52 CDT 2025


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
Steven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250614/73811952/attachment.html>


More information about the petsc-users mailing list