1*4b9ad928SBarry Smith /* $Id: bjacobi.h,v 1.24 2001/03/22 20:31:04 bsmith Exp $ */ 2*4b9ad928SBarry Smith 3*4b9ad928SBarry Smith #if !defined(__BJACOBI_H) 4*4b9ad928SBarry Smith #define __BJACOBI_H 5*4b9ad928SBarry Smith /* 6*4b9ad928SBarry Smith Private data for block Jacobi and block Gauss-Seidel preconditioner. 7*4b9ad928SBarry Smith */ 8*4b9ad928SBarry Smith #include "petscksp.h" 9*4b9ad928SBarry Smith #include "src/ksp/pc/pcimpl.h" 10*4b9ad928SBarry Smith 11*4b9ad928SBarry Smith /* 12*4b9ad928SBarry Smith This data is general for all implementations 13*4b9ad928SBarry Smith */ 14*4b9ad928SBarry Smith typedef struct { 15*4b9ad928SBarry Smith int n,n_local; /* number of blocks (global, local) */ 16*4b9ad928SBarry Smith int first_local; /* number of first block on processor */ 17*4b9ad928SBarry Smith PetscTruth use_true_local; /* use block from true matrix, not preconditioner matrix for local MatMult() */ 18*4b9ad928SBarry Smith KSP *ksp; /* KSP contexts for blocks */ 19*4b9ad928SBarry Smith void *data; /* implementation-specific data */ 20*4b9ad928SBarry Smith PetscTruth same_local_solves; /* flag indicating whether all local solvers are same (used for PCView()) */ 21*4b9ad928SBarry Smith int *l_lens; /* lens of each block */ 22*4b9ad928SBarry Smith int *g_lens; 23*4b9ad928SBarry Smith Mat tp_mat,tp_pmat; /* diagonal block of matrix for this processor */ 24*4b9ad928SBarry Smith } PC_BJacobi; 25*4b9ad928SBarry Smith 26*4b9ad928SBarry Smith /* 27*4b9ad928SBarry Smith This data is specific for certain implementations 28*4b9ad928SBarry Smith */ 29*4b9ad928SBarry Smith 30*4b9ad928SBarry Smith /* This is for multiple blocks per processor */ 31*4b9ad928SBarry Smith 32*4b9ad928SBarry Smith typedef struct { 33*4b9ad928SBarry Smith Vec *x,*y; /* work vectors for solves on each block */ 34*4b9ad928SBarry Smith int *starts; /* starting point of each block */ 35*4b9ad928SBarry Smith Mat *mat,*pmat; /* submatrices for each block */ 36*4b9ad928SBarry Smith IS *is; /* for gathering the submatrices */ 37*4b9ad928SBarry Smith } PC_BJacobi_Multiblock; 38*4b9ad928SBarry Smith 39*4b9ad928SBarry Smith /* This is for a single block per processor */ 40*4b9ad928SBarry Smith typedef struct { 41*4b9ad928SBarry Smith Vec x,y; 42*4b9ad928SBarry Smith } PC_BJacobi_Singleblock; 43*4b9ad928SBarry Smith 44*4b9ad928SBarry Smith #endif 45*4b9ad928SBarry Smith 46*4b9ad928SBarry Smith 47