xref: /petsc/src/mat/impls/adj/mpi/mpiadj.h (revision 9dd11ecf0918283bb567d8b33a92f53ac4ea7840) !
1*a4963045SJacob Faibussowitsch #pragma once
2b97cf49bSBarry Smith 
3af0996ceSBarry Smith #include <petsc/private/matimpl.h>
46a09307cSBarry Smith #include <petsc/private/hashsetij.h>
5da33ede1SBarry Smith 
6b97cf49bSBarry Smith /*
73eda8832SBarry Smith   MATMPIAdj format - Compressed row storage for storing adjacency lists, and possibly weights
8329f5518SBarry Smith                      This is for grid reorderings (to reduce bandwidth)
96a09307cSBarry Smith                      grid partitionings, etc.
10b97cf49bSBarry Smith */
11b97cf49bSBarry Smith 
12b97cf49bSBarry Smith typedef struct {
136a09307cSBarry Smith   PetscHSetIJ ht;
146a09307cSBarry Smith 
156a09307cSBarry Smith   /*
166a09307cSBarry Smith      once the matrix is assembled (either by calling MatAssemblyBegin/End() or MatMPIAdjSetPreallocation() or MatCreateMPIAdj()
176a09307cSBarry Smith      then the data structures below are valid and cannot be changed
186a09307cSBarry Smith   */
19b24ad042SBarry Smith   PetscInt     nz;
20b24ad042SBarry Smith   PetscInt    *diag;            /* pointers to diagonal elements, if they exist */
21b24ad042SBarry Smith   PetscInt    *i;               /* pointer to beginning of each row */
2279c34000SHong Zhang   PetscInt    *j;               /* column values: j + i[k] is start of row k */
23b24ad042SBarry Smith   PetscInt    *values;          /* numerical values */
24e895ccc0SFande Kong   PetscBool    useedgeweights;  /* if edge weights are used  */
25ace3abfcSBarry Smith   PetscBool    symmetric;       /* user indicates the nonzero structure is symmetric */
26ace3abfcSBarry Smith   PetscBool    freeaij;         /* free a, i,j at destroy */
27ace3abfcSBarry Smith   PetscBool    freeaijwithfree; /* use free() to free i,j instead of PetscFree() */
282b1d8763SJed Brown   PetscScalar *rowvalues;       /* scalar work space for MatGetRow() */
292b1d8763SJed Brown   PetscInt     rowvalues_alloc;
303eda8832SBarry Smith } Mat_MPIAdj;
31