Date: 2016-07-24T17:06:42+00:00

Actual source code: fgmresimpl.h
petsc-3.7.3 2016-07-24
Report Typos and Errors
4: #include <petsc/private/kspimpl.h> 5: #define KSPGMRES_NO_MACROS 6: #include <../src/ksp/ksp/impls/gmres/gmresimpl.h> 8: typedef struct { 9: KSPGMRESHEADER 11: /* new storage for fgmres */ 12: Vec *prevecs; /* holds the preconditioned basis vectors for fgmres. 13: We will allocate these at the same time as vecs 14: above (and in the same "chunks". */ 15: Vec **prevecs_user_work; /* same purpose as user_work above, but this one is 16: for our preconditioned vectors */ 18: /* we need a function for interacting with the pcfamily */ 20: PetscErrorCode (*modifypc)(KSP,PetscInt,PetscInt,PetscReal,void*); /* function to modify the preconditioner*/ 21: PetscErrorCode (*modifydestroy)(void*); 22: void *modifyctx; 23: } KSP_FGMRES; 25: #define HH(a,b) (fgmres->hh_origin + (b)*(fgmres->max_k+2)+(a)) 26: /* HH will be size (max_k+2)*(max_k+1) - think of HH as 27: being stored columnwise for access purposes. */ 28: #define HES(a,b) (fgmres->hes_origin + (b)*(fgmres->max_k+1)+(a)) 29: /* HES will be size (max_k + 1) * (max_k + 1) - 30: again, think of HES as being stored columnwise */ 31: #define CC(a) (fgmres->cc_origin + (a)) /* CC will be length (max_k+1) - cosines */ 32: #define SS(a) (fgmres->ss_origin + (a)) /* SS will be length (max_k+1) - sines */ 33: #define RS(a) (fgmres->rs_origin + (a)) /* RS will be length (max_k+2) - rt side */ 35: /* vector names */ 36: #define VEC_OFFSET 2 37: #define VEC_TEMP fgmres->vecs[0] /* work space */ 38: #define VEC_TEMP_MATOP fgmres->vecs[1] /* work space */ 39: #define VEC_VV(i) fgmres->vecs[VEC_OFFSET+i] /* use to access 40: othog basis vectors */ 41: #define PREVEC(i) fgmres->prevecs[i] /* use to access 42: preconditioned basis */ 44: #endif