Actual source code: pipefgmresimpl.h

petsc-3.11.2 2019-05-18
Report Typos and Errors
  1: #if !defined(PIPEFGMRES_H_)
  2: #define PIPEFGMRES_H_

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

  7: typedef struct {
  8:   KSPGMRESHEADER

 10:    /* new storage for explicit storage of preconditioned basis vectors */
 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:   /* new storage for explicit storage of pipelining quantities */
 18:   Vec *zvecs;
 19:   Vec **zvecs_user_work;

 21:   /* A shift parameter */
 22:   PetscScalar shift;

 24:   /* Work space to allow all reductions in a single call */
 25:   Vec         *redux;

 27: } KSP_PIPEFGMRES;

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

 39: /* vector names */
 40: #define VEC_OFFSET     4
 41: #define VEC_TEMP       pipefgmres->vecs[0]               /* work space */
 42: #define VEC_TEMP_MATOP pipefgmres->vecs[1]               /* work space */
 43: #define VEC_Q          pipefgmres->vecs[2]               /* work space - Q pipelining var */
 44: #define VEC_W          pipefgmres->vecs[3]               /* work space - W pipelining var */

 46: #define VEC_VV(i)      pipefgmres->vecs[VEC_OFFSET+i]    /* use to access othog basis vectors 
 47:                                                             Note the offset, since we use
 48:                                                             the first few as workspace */

 50: #define PREVEC(i)      pipefgmres->prevecs[i]            /* use to access preconditioned basis */
 51: #define ZVEC(i)        pipefgmres->zvecs[i]
 52: #endif