xref: /petsc/src/mat/impls/adj/mpi/mpiadj.h (revision 6a09307c880f3cf726d2c2fd1cfca70c4fcbcfe1)
1b97cf49bSBarry Smith 
2*6a09307cSBarry Smith #if !defined(MPIADJ_H)
3*6a09307cSBarry Smith #define MPIADJ_H
4af0996ceSBarry Smith #include <petsc/private/matimpl.h>
5*6a09307cSBarry Smith #include <petsc/private/hashsetij.h>
6da33ede1SBarry Smith 
7b97cf49bSBarry Smith /*
83eda8832SBarry Smith   MATMPIAdj format - Compressed row storage for storing adjacency lists, and possibly weights
9329f5518SBarry Smith                      This is for grid reorderings (to reduce bandwidth)
10*6a09307cSBarry Smith                      grid partitionings, etc.
11b97cf49bSBarry Smith */
12b97cf49bSBarry Smith 
13b97cf49bSBarry Smith typedef struct {
14*6a09307cSBarry Smith   PetscHSetIJ ht;
15*6a09307cSBarry Smith 
16*6a09307cSBarry Smith   /*
17*6a09307cSBarry Smith      once the matrix is assembled (either by calling MatAssemblyBegin/End() or MatMPIAdjSetPreallocation() or MatCreateMPIAdj()
18*6a09307cSBarry Smith      then the data structures below are valid and cannot be changed
19*6a09307cSBarry Smith   */
20b24ad042SBarry Smith   PetscInt    nz;
21b24ad042SBarry Smith   PetscInt    *diag;                   /* pointers to diagonal elements, if they exist */
22b24ad042SBarry Smith   PetscInt    *i;                      /* pointer to beginning of each row */
2379c34000SHong Zhang   PetscInt    *j;                      /* column values: j + i[k] is start of row k */
24b24ad042SBarry Smith   PetscInt    *values;                 /* numerical values */
25e895ccc0SFande Kong   PetscBool   useedgeweights;          /* if edge weights are used  */
26ace3abfcSBarry Smith   PetscBool   symmetric;               /* user indicates the nonzero structure is symmetric */
27ace3abfcSBarry Smith   PetscBool   freeaij;                 /* free a, i,j at destroy */
28ace3abfcSBarry Smith   PetscBool   freeaijwithfree;         /* use free() to free i,j instead of PetscFree() */
292b1d8763SJed Brown   PetscScalar *rowvalues;              /* scalar work space for MatGetRow() */
302b1d8763SJed Brown   PetscInt    rowvalues_alloc;
313eda8832SBarry Smith } Mat_MPIAdj;
32b97cf49bSBarry Smith 
33b97cf49bSBarry Smith #endif
34