Actual source code: bjacobi.h
4: /*
5: Private data for block Jacobi and block Gauss-Seidel preconditioner.
6: */
7: #include petscksp.h
8: #include private/pcimpl.h
10: /*
11: This data is general for all implementations
12: */
13: typedef struct {
14: PetscInt n,n_local; /* number of blocks (global, local) */
15: PetscInt first_local; /* number of first block on processor */
16: PetscTruth use_true_local; /* use block from true matrix, not preconditioner matrix for local MatMult() */
17: KSP *ksp; /* KSP contexts for blocks */
18: void *data; /* implementation-specific data */
19: PetscTruth same_local_solves; /* flag indicating whether all local solvers are same (used for PCView()) */
20: PetscInt *l_lens; /* lens of each block */
21: PetscInt *g_lens;
22: Mat tp_mat,tp_pmat; /* diagonal block of matrix for this processor */
23: } PC_BJacobi;
25: /*
26: This data is specific for certain implementations
27: */
29: /* This is for multiple blocks per processor */
31: typedef struct {
32: Vec *x,*y; /* work vectors for solves on each block */
33: PetscInt *starts; /* starting point of each block */
34: Mat *mat,*pmat; /* submatrices for each block */
35: IS *is; /* for gathering the submatrices */
36: } PC_BJacobi_Multiblock;
38: /* This is for a single block per processor */
39: typedef struct {
40: Vec x,y;
41: } PC_BJacobi_Singleblock;
43: #endif