petsc-3.7.1 2016-05-15
Report Typos and Errors

# MatMeshToCellGraph

Uses the ParMETIS package to convert a Mat that represents a mesh to a Mat the represents the graph of the coupling between cells (the "dual" graph) and is suitable for partitioning with the MatPartitioning object. Use this to partition cells of a mesh.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode MatMeshToCellGraph(Mat mesh,PetscInt ncommonnodes,Mat *dual)

Collective on Mat Many br

### Input Parameter

| mesh | - the graph that represents the mesh Many br
| ncommonnodes | - mesh elements that share this number of common nodes are considered neighbors, use 2 for triangules and Many brquadralaterials, 3 for tetrahedrals and 4 for hexahedrals Many br

### Output Parameter

dual -the dual graph Many br

### Notes

Currently requires ParMetis to be installed and uses ParMETIS_V3_Mesh2Dual() Many br

The columns of each row of the Mat mesh are the global vertex numbers of the vertices of that rows cell. The number of rows in mesh is Many brnumber of cells, the number of columns is the number of vertices. Many br

Many br

### See Also

MatMeshToVertexGraph(), MatCreateMPIAdj(), MatPartitioningCreate()

Level:advanced
Location:src/mat/partition/impls/pmetis/pmetis.c
Index of all MatOrderings routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/mat/examples/tutorials/ex11.c.html