1: /*
2: Data structure used for Multigrid preconditioner.
3: */
6: #include private/pcimpl.h
7: #include petscmg.h
8: #include petscksp.h
11: /*
12: Structure for abstract multigrid solver.
14: Level (0) is always the coarsest level and Level (levels-1) is the finest.
15: */
16: typedef struct
17: {
18: PCMGType am; /* Multiplicative, additive or full */
19: PetscInt cycles; /* Type of cycle to run: 1 V 2 W */
20: PetscInt cyclesperpcapply; /* Number of cycles to use in each PCApply(), multiplicative only*/
21: PetscInt level; /* level = 0 coarsest level */
22: PetscInt levels; /* number of active levels used */
23: PetscInt maxlevels; /* total number of levels allocated */
24: PetscTruth galerkin; /* use Galerkin process to compute coarser matrices */
25: PetscTruth galerkinused; /* destroy the Mat created by the Galerkin process */
26: Vec b; /* Right hand side */
27: Vec x; /* Solution */
28: Vec r; /* Residual */
29: PetscErrorCode (*residual)(Mat,Vec,Vec,Vec);
30: Mat A; /* matrix used in forming residual*/
31: KSP smoothd; /* pre smoother */
32: KSP smoothu; /* post smoother */
33: Mat interpolate;
34: Mat restrct; /* restrict is a reserved word on the Cray!!!*/
35: PetscInt default_smoothu; /* number of smooths per level if not over-ridden */
36: PetscInt default_smoothd; /* with calls to KSPSetTolerances() */
37: PetscReal rtol,abstol,dtol,ttol; /* tolerances for when running with PCApplyRichardson_MG */
38: PetscEvent eventsmoothsetup; /* if logging times for each level */
39: PetscEvent eventsmoothsolve;
40: PetscEvent eventresidual;
41: PetscEvent eventinterprestrict;
42: } PC_MG;
45: #endif