Actual source code: pcimpl.h
2: #ifndef _PCIMPL_H
3: #define _PCIMPL_H
5: #include <petscksp.h>
6: #include <petscpc.h>
8: typedef struct _PCOps *PCOps;
9: struct _PCOps {
10: PetscErrorCode (*setup)(PC);
11: PetscErrorCode (*apply)(PC,Vec,Vec);
12: PetscErrorCode (*applyrichardson)(PC,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal,PetscInt,PetscBool ,PetscInt*,PCRichardsonConvergedReason*);
13: PetscErrorCode (*applyBA)(PC,PCSide,Vec,Vec,Vec);
14: PetscErrorCode (*applytranspose)(PC,Vec,Vec);
15: PetscErrorCode (*applyBAtranspose)(PC,PetscInt,Vec,Vec,Vec);
16: PetscErrorCode (*setfromoptions)(PC);
17: PetscErrorCode (*presolve)(PC,KSP,Vec,Vec);
18: PetscErrorCode (*postsolve)(PC,KSP,Vec,Vec);
19: PetscErrorCode (*getfactoredmatrix)(PC,Mat*);
20: PetscErrorCode (*applysymmetricleft)(PC,Vec,Vec);
21: PetscErrorCode (*applysymmetricright)(PC,Vec,Vec);
22: PetscErrorCode (*setuponblocks)(PC);
23: PetscErrorCode (*destroy)(PC);
24: PetscErrorCode (*view)(PC,PetscViewer);
25: PetscErrorCode (*reset)(PC);
26: };
28: /*
29: Preconditioner context
30: */
31: struct _p_PC {
32: PETSCHEADER(struct _PCOps);
33: DM dm;
34: PetscInt setupcalled;
35: PetscInt setfromoptionscalled;
36: MatStructure flag;
37: Mat mat,pmat;
38: Vec diagonalscaleright,diagonalscaleleft; /* used for time integration scaling */
39: PetscBool diagonalscale;
40: PetscBool nonzero_guess; /* used by PCKSP, PCREDUNDANT and PCHMPI */
41: PetscErrorCode (*modifysubmatrices)(PC,PetscInt,const IS[],const IS[],Mat[],void*); /* user provided routine */
42: void *modifysubmatricesP; /* context for user routine */
43: void *data;
44: PetscInt reuse; /* flag for reusing the numerical factorization */
45: void *user; /* optional user-defined context */
46: };
51: #endif