1: #pragma once
3: #include <../src/mat/impls/aij/mpi/mpiaij.h>
5: #define KAIJHEADER \
6: PetscInt p, q; \
7: Mat AIJ; \
8: Mat B; /* operand of the (B \otimes S) term, NULL means the identity */ \
9: PetscScalar *S; \
10: PetscScalar *T; \
11: PetscScalar *ibdiag; \
12: PetscInt ibdiagcount; /* allocated length of ibdiag */ \
13: PetscObjectState ibdiagstate; /* state of A when ibdiag was last computed */ \
14: PetscObjectState ibdiagbstate; /* state of B when ibdiag was last computed */ \
15: PetscObjectState ibdiagkstate; /* state of the KAIJ matrix when ibdiag was last computed */ \
16: PetscObjectState aijnnzstate; /* nonzero state of A at the last assembly of the KAIJ matrix */ \
17: PetscObjectState bnnzstate; /* nonzero state of B at the last assembly of the KAIJ matrix */ \
18: PetscBool ibdiagvalid, getrowactive, isTI; \
19: struct { \
20: PetscBool setup; \
21: PetscScalar *w, *work, *t, *arr, *y; \
22: } sor;
24: typedef struct {
25: KAIJHEADER
26: } Mat_SeqKAIJ;
28: typedef struct {
29: KAIJHEADER
30: Mat OAIJ; /* sequential KAIJ matrix that corresponds to off-diagonal matrix entries (diagonal entries are stored in 'AIJ') */
31: Mat A; /* AIJ matrix describing the blockwise action of the KAIJ matrix; compare with struct member 'AIJ' in sequential case */
32: Mat OB; /* sequential KAIJ matrix for the off-diagonal entries of B, which uses the ghost scatter of A */
33: VecScatter ctx; /* update ghost points for parallel case */
34: Vec w; /* work space for ghost values for parallel case */
35: PetscInt *ghosts; /* copy of the off-diagonal ghost columns of A that 'ctx' and 'w' were built from */
36: PetscInt nghosts; /* length of 'ghosts' */
37: PetscObjectState state; /* state of the matrix A when AIJ and OAIJ were last updated */
38: PetscObjectState bstate; /* state of the matrix B when the B-related submatrices were last updated */
39: PetscObjectState kstate; /* state of the KAIJ matrix when the submatrices were last updated */
40: PetscBool scatterstale; /* 'ctx' must be rebuilt before the next MatMult() */
41: } Mat_MPIKAIJ;