Actual source code: mgimpl.h
1: /*
2: Data structure used for Multigrid preconditioner.
3: */
6: #include src/ksp/pc/pcimpl.h
7: #include petscmg.h
8: #include petscksp.h
10: typedef struct _MG* MG;
12: /*
13: Structure for abstract multigrid solver.
15: Level (0) is always the coarsest level and Level (levels-1) is the finest.
16: */
17: struct _MG
18: {
19: MGType am; /* Multiplicative, additive or full */
20: int cycles; /* Number cycles to run */
21: int level; /* level = 0 coarsest level */
22: int levels; /* number of active levels used */
23: int maxlevels; /* total number of levels allocated */
24: Vec b; /* Right hand side */
25: Vec x; /* Solution */
26: Vec r; /* Residual */
27: PetscErrorCode (*residual)(Mat,Vec,Vec,Vec);
28: Mat A; /* matrix used in forming residual*/
29: KSP smoothd; /* pre smoother */
30: KSP smoothu; /* post smoother */
31: Mat interpolate;
32: Mat restrct; /* restrict is a reserved word on the Cray!!!*/
33: int default_smoothu; /* number of smooths per level if not over-ridden */
34: int default_smoothd; /* with calls to KSPSetTolerances() */
35: PetscReal rtol,abstol,dtol,ttol; /* tolerances for when running with PCApplyRichardson_MG */
36: PetscEvent eventsetup; /* if logging times for each level */
37: PetscEvent eventsolve;
38: };
41: #endif