14b9ad928SBarry Smith 24b9ad928SBarry Smith #if !defined(__BJACOBI_H) 34b9ad928SBarry Smith #define __BJACOBI_H 44b9ad928SBarry Smith /* 54b9ad928SBarry Smith Private data for block Jacobi and block Gauss-Seidel preconditioner. 64b9ad928SBarry Smith */ 74b9ad928SBarry Smith #include "petscksp.h" 84b9ad928SBarry Smith #include "src/ksp/pc/pcimpl.h" 94b9ad928SBarry Smith 104b9ad928SBarry Smith /* 114b9ad928SBarry Smith This data is general for all implementations 124b9ad928SBarry Smith */ 134b9ad928SBarry Smith typedef struct { 14*13f74950SBarry Smith PetscInt n,n_local; /* number of blocks (global, local) */ 15*13f74950SBarry Smith PetscInt first_local; /* number of first block on processor */ 164b9ad928SBarry Smith PetscTruth use_true_local; /* use block from true matrix, not preconditioner matrix for local MatMult() */ 174b9ad928SBarry Smith KSP *ksp; /* KSP contexts for blocks */ 184b9ad928SBarry Smith void *data; /* implementation-specific data */ 194b9ad928SBarry Smith PetscTruth same_local_solves; /* flag indicating whether all local solvers are same (used for PCView()) */ 20*13f74950SBarry Smith PetscInt *l_lens; /* lens of each block */ 21*13f74950SBarry Smith PetscInt *g_lens; 224b9ad928SBarry Smith Mat tp_mat,tp_pmat; /* diagonal block of matrix for this processor */ 234b9ad928SBarry Smith } PC_BJacobi; 244b9ad928SBarry Smith 254b9ad928SBarry Smith /* 264b9ad928SBarry Smith This data is specific for certain implementations 274b9ad928SBarry Smith */ 284b9ad928SBarry Smith 294b9ad928SBarry Smith /* This is for multiple blocks per processor */ 304b9ad928SBarry Smith 314b9ad928SBarry Smith typedef struct { 324b9ad928SBarry Smith Vec *x,*y; /* work vectors for solves on each block */ 33*13f74950SBarry Smith PetscInt *starts; /* starting point of each block */ 344b9ad928SBarry Smith Mat *mat,*pmat; /* submatrices for each block */ 354b9ad928SBarry Smith IS *is; /* for gathering the submatrices */ 364b9ad928SBarry Smith } PC_BJacobi_Multiblock; 374b9ad928SBarry Smith 384b9ad928SBarry Smith /* This is for a single block per processor */ 394b9ad928SBarry Smith typedef struct { 404b9ad928SBarry Smith Vec x,y; 414b9ad928SBarry Smith } PC_BJacobi_Singleblock; 424b9ad928SBarry Smith 434b9ad928SBarry Smith #endif 444b9ad928SBarry Smith 454b9ad928SBarry Smith 46