petsc-3.11.4 2019-09-28
Report Typos and Errors


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.


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

Input Parameter

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

Output Parameter

dual -the dual graph


Currently requires ParMetis to be installed and uses ParMETIS_V3_Mesh2Dual()

    Each row of the mesh object represents a single cell in the mesh. For triangles it has 3 entries, quadralaterials 4 entries,
        tetrahedrals 4 entries and hexahedrals 8 entries. You can mix triangles and quadrilaterals in the same mesh, but cannot
        mix  tetrahedrals and hexahedrals
    The columns of each row of the Mat mesh are the global vertex numbers of the vertices of that row's cell.
    The number of rows in mesh is number of cells, the number of columns is the number of vertices.

See Also

MatMeshToVertexGraph(), MatCreateMPIAdj(), MatPartitioningCreate()







Index of all MatOrderings routines
Table of Contents for all manual pages
Index of all manual pages