[petsc-users] Reading a mesh into Plex

Matthew Knepley knepley at gmail.com
Thu Feb 27 06:58:43 CST 2014

On Wed, Feb 26, 2014 at 11:43 PM, Dharmendar Reddy
<dharmareddy84 at gmail.com>wrote:

> Hello,
>         I need to load a mesh file into DMPlex object. The mesh is
> generated by a software which outputs the mesh in this format:
> List of Vertex Coordinates (i=1 to N_V) :  P_i = X_i Y_i Z_i
> List of Edges (i= 1 to N_E):  E_i = P_m P_n where m,n <= N_V
> List of Faces (i=1 to N_F):  F_i = E_m E_n E_o where m,n,o < N_E
> (edge ids can be negative or positive depending on the orientation)
> List of Cells (i = 1 to N_C): C_i = F_m F_n F_o F_p .... for say
> Tetrahedron
>                                                   or
>                                                   = E_m E_n E_o for
> triangles on the boundary regions.

We were cool until here. This sounds like Gmsh. This aliasing of things in
the domain is really unacceptable. The boundary faces have already been
above in the faces section. They should just be tagged.

If this is Gmsh, there is trial support in next, DMPlexCreateGmsh(). If
not, I see a few

  a) Use DMPlexCreateFromCellList(). This means tracing through the info to
get just
       the vertices on cells. However, it would mean that you get
consistent ordering,
       which is not true for the faces in Gmsh files. You could renumber
faces afterwards to
       conform to the original file, once all orientations have been

  b) Use DMPlexCreateFromDAG(). This gets the numbering from above, but it
       have orientation inconsistencies in 3D.

With either one, you would ignore the boundary faces, and use DMPlexJoin()
to locate
each one and tag it in a label after the mesh was built.



> Any suggestions on how i can read this mesh file into DMPlex.
> Thanks
> Reddy

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/20140227/b0b7eb93/attachment.html>

More information about the petsc-users mailing list