[petsc-users] Reading a mesh into Plex

Dharmendar Reddy dharmareddy84 at gmail.com
Thu Feb 27 13:20:53 CST 2014

On Thu, Feb 27, 2014 at 6:58 AM, Matthew Knepley <knepley at gmail.com> wrote:
> 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 msh is not from gmsh. It is from a commercial software
tool used for semiconductor device simulation. A C++ based reader for
this mesh format is available here


I will try to use the Createfromcelllist.


 the domain is really unacceptable. The boundary faces have already been
> defined
> 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
> choices:
>   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
> calculated.
>   b) Use DMPlexCreateFromDAG(). This gets the numbering from above, but it
> may
>        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.
>   Thanks,
>      Matt
>> 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

More information about the petsc-users mailing list