[petsc-users] Triangle geometry data as input to DM object to generate a mesh

Matthew Knepley knepley at gmail.com
Mon Nov 11 12:21:47 CST 2013


On Mon, Nov 11, 2013 at 11:46 AM, Anthony Vergottis
<a.vergottis at ucl.ac.uk>wrote:

> Dear All,
>
> I would like some assistance on how a mesh is created using Triangle with
> the DM objects. Specifically how does one input the geometry of the
> computational domain into PETSc/DM objects to then generate a 2D triangular
> mesh? Is there a function that can do such a thing? Currently I have hard
> coded all mesh I/O but I would like to make things a bit cleaner if its
> possible.
>

The default 2D mesh generator in PETSc is Triangle. If you have a 1D
boundary, you can generate the 2D mesh using

  DMPlexGenerate(boundaryDM, NULL, PETSC_FALSE, &dm)

or PETSC_TRUE if you want edges included. I suggest using
DMPlexCreateFromDAG() if you have programmatically
constructed your boundary, or DMPlexCreateFromCellList() if you get your
boundary from a meshing tool.

  Thanks,

     Matt


> Thanks in advance for any help.
>
> Best regards,
> Anthony
>



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


More information about the petsc-users mailing list