Actual source code: pipefgmresimpl.h

  1: #ifndef PETSC_PIPEFGMRESIMPL_H
  2: #define PETSC_PIPEFGMRESIMPL_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) \
 47:   pipefgmres->vecs[VEC_OFFSET + i] /* use to access othog basis vectors
 48:                                                             Note the offset, since we use
 49:                                                             the first few as workspace */

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