Actual source code: fgmresimpl.h

petsc-3.8.3 2017-12-09
Report Typos and Errors

  4: #define KSPGMRES_NO_MACROS
  5:  #include <../src/ksp/ksp/impls/gmres/gmresimpl.h>

  7: typedef struct {
  8:   KSPGMRESHEADER

 10:   /* new storage for fgmres */
 11:   Vec *prevecs;                  /* holds the preconditioned basis vectors for fgmres.
 12:                                     We will allocate these at the same time as vecs
 13:                                     above (and in the same "chunks". */
 14:   Vec **prevecs_user_work;       /* same purpose as user_work above, but this one is
 15:                                     for our preconditioned vectors */

 17:   /* we need a function for interacting with the pcfamily */

 19:   PetscErrorCode (*modifypc)(KSP,PetscInt,PetscInt,PetscReal,void*);    /* function to modify the preconditioner*/
 20:   PetscErrorCode (*modifydestroy)(void*);
 21:   void *modifyctx;
 22: } KSP_FGMRES;

 24: #define HH(a,b)  (fgmres->hh_origin + (b)*(fgmres->max_k+2)+(a))
 25: /* HH will be size (max_k+2)*(max_k+1)  -  think of HH as
 26:    being stored columnwise for access purposes. */
 27: #define HES(a,b) (fgmres->hes_origin + (b)*(fgmres->max_k+1)+(a))
 28: /* HES will be size (max_k + 1) * (max_k + 1) -
 29:    again, think of HES as being stored columnwise */
 30: #define CC(a)    (fgmres->cc_origin + (a)) /* CC will be length (max_k+1) - cosines */
 31: #define SS(a)    (fgmres->ss_origin + (a)) /* SS will be length (max_k+1) - sines */
 32: #define RS(a)    (fgmres->rs_origin + (a)) /* RS will be length (max_k+2) - rt side */

 34: /* vector names */
 35: #define VEC_OFFSET     2
 36: #define VEC_TEMP       fgmres->vecs[0]               /* work space */
 37: #define VEC_TEMP_MATOP fgmres->vecs[1]               /* work space */
 38: #define VEC_VV(i)      fgmres->vecs[VEC_OFFSET+i]    /* use to access
 39:                                                         othog basis vectors */
 40: #define PREVEC(i)      fgmres->prevecs[i]            /* use to access
 41:                                                         preconditioned basis */

 43: #endif