Actual source code: petscpcmg.h
1: /*
2: Structure used for Multigrid preconditioners
3: */
6: #include petscksp.h
7: PETSC_EXTERN_CXX_BEGIN
9: /*E
10: PCMGType - Determines the type of multigrid method that is run.
12: Level: beginner
14: Values:
15: + PC_MG_MULTIPLICATIVE (default) - traditional V or W cycle as determined by PCMGSetCycles()
16: . PC_MG_ADDITIVE - the additive multigrid preconditioner where all levels are
17: smoothed before updating the residual. This only uses the
18: down smoother, in the preconditioner the upper smoother is ignored
19: . PC_MG_FULL - same as multiplicative except one also performs grid sequencing,
20: that is starts on the coarsest grid, performs a cycle, interpolates
21: to the next, performs a cycle etc. This is much like the F-cycle presented in "Multigrid" by Trottenberg, Oosterlee, Schuller page 49, but that
22: algorithm supports smoothing on before the restriction on each level in the initial restriction to the coarsest stage. In addition that algorithm
23: calls the V-cycle only on the coarser level and has a post-smoother instead.
24: - PC_MG_KASKADE - like full multigrid except one never goes back to a coarser level
25: from a finer
27: .seealso: PCMGSetType()
29: E*/
30: typedef enum { PC_MG_MULTIPLICATIVE,PC_MG_ADDITIVE,PC_MG_FULL,PC_MG_KASKADE } PCMGType;
31: extern const char *PCMGTypes[];
32: #define PC_MG_CASCADE PC_MG_KASKADE;
34: /*E
35: PCMGCycleType - Use V-cycle or W-cycle
37: Level: beginner
39: Values:
40: + PC_MG_V_CYCLE
41: - PC_MG_W_CYCLE
43: .seealso: PCMGSetCycleType()
45: E*/
46: typedef enum { PC_MG_CYCLE_V = 1,PC_MG_CYCLE_W = 2 } PCMGCycleType;
47: extern const char *PCMGCycleTypes[];
49: extern PetscErrorCode PCMGSetType(PC,PCMGType);
50: extern PetscErrorCode PCMGSetLevels(PC,PetscInt,MPI_Comm*);
51: extern PetscErrorCode PCMGGetLevels(PC,PetscInt*);
53: extern PetscErrorCode PCMGSetNumberSmoothUp(PC,PetscInt);
54: extern PetscErrorCode PCMGSetNumberSmoothDown(PC,PetscInt);
55: extern PetscErrorCode PCMGSetCycleType(PC,PCMGCycleType);
56: extern PetscErrorCode PCMGSetCycleTypeOnLevel(PC,PetscInt,PCMGCycleType);
57: extern PetscErrorCode PCMGSetCyclesOnLevel(PC,PetscInt,PetscInt);
58: extern PetscErrorCode PCMGMultiplicativeSetCycles(PC,PetscInt);
59: extern PetscErrorCode PCMGSetGalerkin(PC,PetscBool);
60: extern PetscErrorCode PCMGGetGalerkin(PC,PetscBool*);
62: extern PetscErrorCode PCMGGetSmoother(PC,PetscInt,KSP*);
63: extern PetscErrorCode PCMGGetSmootherDown(PC,PetscInt,KSP*);
64: extern PetscErrorCode PCMGGetSmootherUp(PC,PetscInt,KSP*);
65: extern PetscErrorCode PCMGGetCoarseSolve(PC,KSP*);
68: extern PetscErrorCode PCMGSetRhs(PC,PetscInt,Vec);
69: extern PetscErrorCode PCMGSetX(PC,PetscInt,Vec);
70: extern PetscErrorCode PCMGSetR(PC,PetscInt,Vec);
72: extern PetscErrorCode PCMGSetRestriction(PC,PetscInt,Mat);
73: extern PetscErrorCode PCMGSetInterpolation(PC,PetscInt,Mat);
74: extern PetscErrorCode PCMGSetRScale(PC,PetscInt,Vec);
75: extern PetscErrorCode PCMGSetResidual(PC,PetscInt,PetscErrorCode (*)(Mat,Vec,Vec,Vec),Mat);
76: extern PetscErrorCode PCMGDefaultResidual(Mat,Vec,Vec,Vec);
78: /*E
79: PCExoticType - Face based or wirebasket based coarse grid space
81: Level: beginner
83: .seealso: PCExoticSetType(), PCEXOTIC
84: E*/
85: typedef enum { PC_EXOTIC_FACE,PC_EXOTIC_WIREBASKET } PCExoticType;
86: extern const char *PCExoticTypes[];
87: extern PetscErrorCode PCExoticSetType(PC,PCExoticType);
90: PETSC_EXTERN_CXX_END
91: #endif