1: #if !defined(PIPEFGMRES_H_)
2: #define PIPEFGMRES_H_ 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 explicit storage of preconditioned basis vectors */
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: /* new storage for explicit storage of pipelining quantities */
19: Vec *zvecs;
20: Vec **zvecs_user_work;
22: /* A shift parameter */
23: PetscScalar shift;
25: /* Work space to allow all reductions in a single call */
26: Vec *redux;
28: } KSP_PIPEFGMRES;
30: #define HH(a,b) (pipefgmres->hh_origin + (b)*(pipefgmres->max_k+2)+(a)) 31: /* HH will be size (max_k+2)*(max_k+1) - think of HH as
32: being stored columnwise for access purposes. */
33: #define HES(a,b) (pipefgmres->hes_origin + (b)*(pipefgmres->max_k+1)+(a)) 34: /* HES will be size (max_k + 1) * (max_k + 1) -
35: again, think of HES as being stored columnwise */
36: #define CC(a) (pipefgmres->cc_origin + (a)) /* CC will be length (max_k+1) - cosines */ 37: #define SS(a) (pipefgmres->ss_origin + (a)) /* SS will be length (max_k+1) - sines */ 38: #define RS(a) (pipefgmres->rs_origin + (a)) /* RS will be length (max_k+2) - rt side */ 40: /* vector names */
41: #define VEC_OFFSET 4 42: #define VEC_TEMP pipefgmres->vecs[0] /* work space */ 43: #define VEC_TEMP_MATOP pipefgmres->vecs[1] /* work space */ 44: #define VEC_Q pipefgmres->vecs[2] /* work space - Q pipelining var */ 45: #define VEC_W pipefgmres->vecs[3] /* work space - W pipelining var */ 47: #define VEC_VV(i) 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