1a4963045SJacob Faibussowitsch #pragma once 2b0753f9dSMatthew G. Knepley 3ac09b921SBarry Smith /* SUBMANSEC = PC */ 4ac09b921SBarry Smith 5b0753f9dSMatthew G. Knepley /*S 687497f52SBarry Smith PC - Abstract PETSc object that manages all preconditioners including direct solvers such as `PCLU` 7b0753f9dSMatthew G. Knepley 8b0753f9dSMatthew G. Knepley Level: beginner 9b0753f9dSMatthew G. Knepley 1016a05f60SBarry Smith .seealso: [](doc_linsolve), [](sec_pc), `PCCreate()`, `PCSetType()`, `PCType` 11b0753f9dSMatthew G. Knepley S*/ 12b0753f9dSMatthew G. Knepley typedef struct _p_PC *PC; 13b0753f9dSMatthew G. Knepley 14b0753f9dSMatthew G. Knepley /*J 1516a05f60SBarry Smith PCType - String with the name of a PETSc preconditioner 16b0753f9dSMatthew G. Knepley 17b0753f9dSMatthew G. Knepley Level: beginner 18b0753f9dSMatthew G. Knepley 1987497f52SBarry Smith Note: 2087497f52SBarry Smith `PCRegister()` is used to register preconditioners that are then accessible via `PCSetType()` 21b0753f9dSMatthew G. Knepley 2216a05f60SBarry Smith .seealso: [](doc_linsolve), [](sec_pc), `PCSetType()`, `PC`, `PCCreate()`, `PCRegister()`, `PCSetFromOptions()`, `PCLU`, `PCJACOBI`, `PCBJACOBI` 23b0753f9dSMatthew G. Knepley J*/ 24b0753f9dSMatthew G. Knepley typedef const char *PCType; 25b0753f9dSMatthew G. Knepley #define PCNONE "none" 26b0753f9dSMatthew G. Knepley #define PCJACOBI "jacobi" 27b0753f9dSMatthew G. Knepley #define PCSOR "sor" 28b0753f9dSMatthew G. Knepley #define PCLU "lu" 29a2fc1e05SToby Isaac #define PCQR "qr" 30b0753f9dSMatthew G. Knepley #define PCSHELL "shell" 31e6f8f311SMark Adams #define PCAMGX "amgx" 32b0753f9dSMatthew G. Knepley #define PCBJACOBI "bjacobi" 33b0753f9dSMatthew G. Knepley #define PCMG "mg" 34b0753f9dSMatthew G. Knepley #define PCEISENSTAT "eisenstat" 35b0753f9dSMatthew G. Knepley #define PCILU "ilu" 36b0753f9dSMatthew G. Knepley #define PCICC "icc" 37b0753f9dSMatthew G. Knepley #define PCASM "asm" 38b0753f9dSMatthew G. Knepley #define PCGASM "gasm" 39b0753f9dSMatthew G. Knepley #define PCKSP "ksp" 40e607c864SMark Adams #define PCBJKOKKOS "bjkokkos" 41b0753f9dSMatthew G. Knepley #define PCCOMPOSITE "composite" 42b0753f9dSMatthew G. Knepley #define PCREDUNDANT "redundant" 43b0753f9dSMatthew G. Knepley #define PCSPAI "spai" 44b0753f9dSMatthew G. Knepley #define PCNN "nn" 45b0753f9dSMatthew G. Knepley #define PCCHOLESKY "cholesky" 46b0753f9dSMatthew G. Knepley #define PCPBJACOBI "pbjacobi" 470da83c2eSBarry Smith #define PCVPBJACOBI "vpbjacobi" 48b0753f9dSMatthew G. Knepley #define PCMAT "mat" 49b0753f9dSMatthew G. Knepley #define PCHYPRE "hypre" 50b0753f9dSMatthew G. Knepley #define PCPARMS "parms" 51b0753f9dSMatthew G. Knepley #define PCFIELDSPLIT "fieldsplit" 52b0753f9dSMatthew G. Knepley #define PCTFS "tfs" 53b0753f9dSMatthew G. Knepley #define PCML "ml" 54b0753f9dSMatthew G. Knepley #define PCGALERKIN "galerkin" 55b0753f9dSMatthew G. Knepley #define PCEXOTIC "exotic" 56b0753f9dSMatthew G. Knepley #define PCCP "cp" 57b0753f9dSMatthew G. Knepley #define PCBFBT "bfbt" 58b0753f9dSMatthew G. Knepley #define PCLSC "lsc" 59b0753f9dSMatthew G. Knepley #define PCPYTHON "python" 60b0753f9dSMatthew G. Knepley #define PCPFMG "pfmg" 611c188c59Sftrigaux #define PCSMG "smg" 62b0753f9dSMatthew G. Knepley #define PCSYSPFMG "syspfmg" 63b0753f9dSMatthew G. Knepley #define PCREDISTRIBUTE "redistribute" 64b0753f9dSMatthew G. Knepley #define PCSVD "svd" 65b0753f9dSMatthew G. Knepley #define PCGAMG "gamg" 664b3f184cSKarl Rupp #define PCCHOWILUVIENNACL "chowiluviennacl" 6770baa948SKarl Rupp #define PCROWSCALINGVIENNACL "rowscalingviennacl" 6807598726SKarl Rupp #define PCSAVIENNACL "saviennacl" 69b0753f9dSMatthew G. Knepley #define PCBDDC "bddc" 70b0753f9dSMatthew G. Knepley #define PCKACZMARZ "kaczmarz" 7168ddcbeaSBarry Smith #define PCTELESCOPE "telescope" 724bbf5ea8SMatthew G. Knepley #define PCPATCH "patch" 73b9ac7092SAlp Dener #define PCLMVM "lmvm" 74360ee056SFande Kong #define PCHMG "hmg" 7537eeb815SJakub Kruzik #define PCDEFLATION "deflation" 7638cfc46eSPierre Jolivet #define PCHPDDM "hpddm" 7753022affSStefano Zampini #define PCH2OPUS "h2opus" 78f1f2ae84SBarry Smith #define PCMPI "mpi" 79b0753f9dSMatthew G. Knepley 80b0753f9dSMatthew G. Knepley /*E 81b0753f9dSMatthew G. Knepley PCSide - If the preconditioner is to be applied to the left, right 82b0753f9dSMatthew G. Knepley or symmetrically around the operator. 83b0753f9dSMatthew G. Knepley 8416a05f60SBarry Smith Values: 8516a05f60SBarry Smith + `PC_LEFT` - applied after the operator is applied 8616a05f60SBarry Smith . `PC_RIGHT` - applied before the operator is applied 8716a05f60SBarry Smith - `PC_SYMMETRIC` - a portion of the preconditioner is applied before the operator and the transpose of this portion is applied after the operator is applied. 8816a05f60SBarry Smith 89b0753f9dSMatthew G. Knepley Level: beginner 90b0753f9dSMatthew G. Knepley 9116a05f60SBarry Smith Note: 9216a05f60SBarry Smith Certain `KSPType` support only a subset of `PCSide` values 9316a05f60SBarry Smith 94af27ebaaSBarry Smith .seealso: [](sec_pc), `PC`, `KSPSetPCSide()`, `KSP`, `KSPType` 95b0753f9dSMatthew G. Knepley E*/ 969371c9d4SSatish Balay typedef enum { 979371c9d4SSatish Balay PC_SIDE_DEFAULT = -1, 989371c9d4SSatish Balay PC_LEFT, 999371c9d4SSatish Balay PC_RIGHT, 1009371c9d4SSatish Balay PC_SYMMETRIC 1019371c9d4SSatish Balay } PCSide; 102b0753f9dSMatthew G. Knepley #define PC_SIDE_MAX (PC_SYMMETRIC + 1) 103b0753f9dSMatthew G. Knepley 104b0753f9dSMatthew G. Knepley /*E 10509e53591SBarry Smith PCRichardsonConvergedReason - reason a `PCRICHARDSON` `PCApplyRichardson()` method terminated 106b0753f9dSMatthew G. Knepley 107b0753f9dSMatthew G. Knepley Level: advanced 108b0753f9dSMatthew G. Knepley 10909e53591SBarry Smith .seealso: [](sec_pc), `PCRICHARDSON`, `PC`, `PCApplyRichardson()` 110b0753f9dSMatthew G. Knepley E*/ 111b0753f9dSMatthew G. Knepley typedef enum { 112b0753f9dSMatthew G. Knepley PCRICHARDSON_CONVERGED_RTOL = 2, 113b0753f9dSMatthew G. Knepley PCRICHARDSON_CONVERGED_ATOL = 3, 114b0753f9dSMatthew G. Knepley PCRICHARDSON_CONVERGED_ITS = 4, 1159371c9d4SSatish Balay PCRICHARDSON_DIVERGED_DTOL = -4 1169371c9d4SSatish Balay } PCRichardsonConvergedReason; 117b0753f9dSMatthew G. Knepley 118b0753f9dSMatthew G. Knepley /*E 11916a05f60SBarry Smith PCJacobiType - What elements of the matrix are used to form the Jacobi preconditioner 120b0753f9dSMatthew G. Knepley 12109e53591SBarry Smith Values: 12209e53591SBarry Smith + `PC_JACOBI_DIAGONAL` - use the diagonal entry, if it is zero use one 123*eede4a3fSMark Adams . `PC_JACOBI_ROWL1` - add sum of absolute values in row i, j != i, to diag_ii 12409e53591SBarry Smith . `PC_JACOBI_ROWMAX` - use the maximum absolute value in the row 12509e53591SBarry Smith - `PC_JACOBI_ROWSUM` - use the sum of the values in the row (not the absolute values) 12609e53591SBarry Smith 127b0753f9dSMatthew G. Knepley Level: intermediate 128b0753f9dSMatthew G. Knepley 12909e53591SBarry Smith .seealso: [](sec_pc), `PCJACOBI`, `PC` 130b0753f9dSMatthew G. Knepley E*/ 1319371c9d4SSatish Balay typedef enum { 1329371c9d4SSatish Balay PC_JACOBI_DIAGONAL, 133*eede4a3fSMark Adams PC_JACOBI_ROWL1, 1349371c9d4SSatish Balay PC_JACOBI_ROWMAX, 1359371c9d4SSatish Balay PC_JACOBI_ROWSUM 1369371c9d4SSatish Balay } PCJacobiType; 137b0753f9dSMatthew G. Knepley 138b0753f9dSMatthew G. Knepley /*E 139b0753f9dSMatthew G. Knepley PCASMType - Type of additive Schwarz method to use 140b0753f9dSMatthew G. Knepley 14109e53591SBarry Smith Values: 14209e53591SBarry Smith + `PC_ASM_BASIC` - Symmetric version where residuals from the ghost points are used 14309e53591SBarry Smith and computed values in ghost regions are added together. 144af27ebaaSBarry Smith Classical standard additive Schwarz as introduced in {cite}`dryja1987additive`. 14509e53591SBarry Smith . `PC_ASM_RESTRICT` - Residuals from ghost points are used but computed values in ghost 146af27ebaaSBarry Smith region are discarded {cite}`cs99`. Default. 14709e53591SBarry Smith . `PC_ASM_INTERPOLATE` - Residuals from ghost points are not used, computed values in ghost 14809e53591SBarry Smith region are added back in. 14909e53591SBarry Smith - `PC_ASM_NONE` - Residuals from ghost points are not used, computed ghost values are 150af27ebaaSBarry Smith discarded. Not very good. 151b0753f9dSMatthew G. Knepley 152b0753f9dSMatthew G. Knepley Level: beginner 153b0753f9dSMatthew G. Knepley 15416a05f60SBarry Smith .seealso: [](sec_pc), `PC`, `PCASM`, `PCASMSetType()`, `PCGASMType` 155b0753f9dSMatthew G. Knepley E*/ 1569371c9d4SSatish Balay typedef enum { 1579371c9d4SSatish Balay PC_ASM_BASIC = 3, 1589371c9d4SSatish Balay PC_ASM_RESTRICT = 1, 1599371c9d4SSatish Balay PC_ASM_INTERPOLATE = 2, 1609371c9d4SSatish Balay PC_ASM_NONE = 0 1619371c9d4SSatish Balay } PCASMType; 162b0753f9dSMatthew G. Knepley 163b0753f9dSMatthew G. Knepley /*E 16487497f52SBarry Smith PCGASMType - Type of generalized additive Schwarz method to use (differs from `PCASM` in allowing multiple processors per subdomain). 165b0753f9dSMatthew G. Knepley 16609e53591SBarry Smith Values: 16709e53591SBarry Smith + `PC_GASM_BASIC` - Symmetric version where the full from the outer subdomain is used, and the resulting correction is applied 16809e53591SBarry Smith over the outer subdomains. As a result, points in the overlap will receive the sum of the corrections 169af27ebaaSBarry Smith from neighboring subdomains. Classical standard additive Schwarz {cite}`dryja1987additive`. 17009e53591SBarry Smith . `PC_GASM_RESTRICT` - Residual from the outer subdomain is used but the correction is restricted to the inner subdomain only 17109e53591SBarry Smith (i.e., zeroed out over the overlap portion of the outer subdomain before being applied). As a result, 17209e53591SBarry Smith each point will receive a correction only from the unique inner subdomain containing it (nonoverlapping covering 173af27ebaaSBarry Smith assumption) {cite}`cs99`. Default. 17409e53591SBarry Smith . `PC_GASM_INTERPOLATE` - Residual is zeroed out over the overlap portion of the outer subdomain, but the resulting correction is 17509e53591SBarry Smith applied over the outer subdomain. As a result, points in the overlap will receive the sum of the corrections 17609e53591SBarry Smith from neighboring subdomains. 177af27ebaaSBarry Smith - `PC_GASM_NONE` - Residuals and corrections are zeroed out outside the local subdomains. Not very good. 178b0753f9dSMatthew G. Knepley 179b0753f9dSMatthew G. Knepley Level: beginner 180b0753f9dSMatthew G. Knepley 18116a05f60SBarry Smith Note: 18216a05f60SBarry Smith Each subdomain has nested inner and outer parts. The inner subdomains are assumed to form a non-overlapping covering of the computational 18316a05f60SBarry Smith domain, while the outer subdomains contain the inner subdomains and overlap with each other. This preconditioner will compute 18416a05f60SBarry Smith a subdomain correction over each *outer* subdomain from a residual computed there, but its different variants will differ in 18516a05f60SBarry Smith (a) how the outer subdomain residual is computed, and (b) how the outer subdomain correction is computed. 18616a05f60SBarry Smith 187af27ebaaSBarry Smith Developer Note: 188af27ebaaSBarry Smith Perhaps better to remove this since it matches `PCASMType` 189af27ebaaSBarry Smith 19016a05f60SBarry Smith .seealso: [](sec_pc), `PCGASM`, `PCASM`, `PC`, `PCGASMSetType()`, `PCASMType` 191b0753f9dSMatthew G. Knepley E*/ 1929371c9d4SSatish Balay typedef enum { 1939371c9d4SSatish Balay PC_GASM_BASIC = 3, 1949371c9d4SSatish Balay PC_GASM_RESTRICT = 1, 1959371c9d4SSatish Balay PC_GASM_INTERPOLATE = 2, 1969371c9d4SSatish Balay PC_GASM_NONE = 0 1979371c9d4SSatish Balay } PCGASMType; 198b0753f9dSMatthew G. Knepley 199b0753f9dSMatthew G. Knepley /*E 20016a05f60SBarry Smith PCCompositeType - Determines how two or more preconditioner are composed with the `PCType` of `PCCOMPOSITE` 201b0753f9dSMatthew G. Knepley 20209e53591SBarry Smith Values: 20309e53591SBarry Smith + `PC_COMPOSITE_ADDITIVE` - results from application of all preconditioners are added together 20409e53591SBarry Smith . `PC_COMPOSITE_MULTIPLICATIVE` - preconditioners are applied sequentially to the residual freshly 20509e53591SBarry Smith computed after the previous preconditioner application 20609e53591SBarry Smith . `PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE` - preconditioners are applied sequentially to the residual freshly 20709e53591SBarry Smith computed from first preconditioner to last and then back (Use only for symmetric matrices and preconditioners) 208af27ebaaSBarry Smith . `PC_COMPOSITE_SPECIAL` - This is very special for a matrix of the form $ \alpha I + R + S$ 209af27ebaaSBarry Smith where the first preconditioner is built from $\alpha I + S$ and second from $\alpha I + R$ 21009e53591SBarry Smith . `PC_COMPOSITE_SCHUR` - composes the Schur complement of the matrix from two blocks, see `PCFIELDSPLIT` 21109e53591SBarry Smith - `PC_COMPOSITE_GKB` - the generalized Golub-Kahan bidiagonalization preconditioner, see `PCFIELDSPLIT` 212b0753f9dSMatthew G. Knepley 213b0753f9dSMatthew G. Knepley Level: beginner 214b0753f9dSMatthew G. Knepley 215af27ebaaSBarry Smith .seealso: [](sec_pc), `PCCOMPOSITE`, `PCFIELDSPLIT`, `PC`, `PCCompositeSetType()`, `SNESCompositeType`, `PCCompositeSpecialSetAlpha()` 216b0753f9dSMatthew G. Knepley E*/ 2179371c9d4SSatish Balay typedef enum { 2189371c9d4SSatish Balay PC_COMPOSITE_ADDITIVE, 2199371c9d4SSatish Balay PC_COMPOSITE_MULTIPLICATIVE, 2209371c9d4SSatish Balay PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE, 2219371c9d4SSatish Balay PC_COMPOSITE_SPECIAL, 2229371c9d4SSatish Balay PC_COMPOSITE_SCHUR, 2239371c9d4SSatish Balay PC_COMPOSITE_GKB 2249371c9d4SSatish Balay } PCCompositeType; 225b0753f9dSMatthew G. Knepley 226b0753f9dSMatthew G. Knepley /*E 22787497f52SBarry Smith PCFieldSplitSchurPreType - Determines how to precondition a Schur complement 228b0753f9dSMatthew G. Knepley 22916a05f60SBarry Smith Values: 23013044ca3SPierre Jolivet + `PC_FIELDSPLIT_SCHUR_PRE_SELF` - the preconditioner for the Schur complement is generated from the symbolic representation of the Schur complement matrix. 23113044ca3SPierre Jolivet The only preconditioners that currently work with this symbolic representation matrix object are `PCLSC` and `PCHPDDM` 23213044ca3SPierre Jolivet . `PC_FIELDSPLIT_SCHUR_PRE_SELFP` - the preconditioning for the Schur complement is generated from an explicitly-assembled approximation Sp = A11 - A10 inv(diag(A00)) A01. 23316a05f60SBarry Smith This is only a good preconditioner when diag(A00) is a good preconditioner for A00. Optionally, A00 can be 23416a05f60SBarry Smith lumped before extracting the diagonal using the additional option `-fieldsplit_1_mat_schur_complement_ainv_type lump` 23516a05f60SBarry Smith . `PC_FIELDSPLIT_SCHUR_PRE_A11` - the preconditioner for the Schur complement is generated from the block diagonal part of the matrix used to define the preconditioner, 23616a05f60SBarry Smith associated with the Schur complement (i.e. A11), not the Schur complement matrix 23716a05f60SBarry Smith . `PC_FIELDSPLIT_SCHUR_PRE_USER` - the preconditioner for the Schur complement is generated from the user provided matrix (pre argument 23816a05f60SBarry Smith to this function). 23916a05f60SBarry Smith - `PC_FIELDSPLIT_SCHUR_PRE_FULL` - the preconditioner for the Schur complement is generated from the exact Schur complement matrix representation 24016a05f60SBarry Smith computed internally by `PCFIELDSPLIT` (this is expensive) useful mostly as a test that the Schur complement approach can work for your problem 24116a05f60SBarry Smith 242b0753f9dSMatthew G. Knepley Level: intermediate 243b0753f9dSMatthew G. Knepley 24409e53591SBarry Smith .seealso: [](sec_pc), `PCFIELDSPLIT`, `PCFieldSplitSetSchurPre()`, `PC` 245b0753f9dSMatthew G. Knepley E*/ 2469371c9d4SSatish Balay typedef enum { 2479371c9d4SSatish Balay PC_FIELDSPLIT_SCHUR_PRE_SELF, 2489371c9d4SSatish Balay PC_FIELDSPLIT_SCHUR_PRE_SELFP, 2499371c9d4SSatish Balay PC_FIELDSPLIT_SCHUR_PRE_A11, 2509371c9d4SSatish Balay PC_FIELDSPLIT_SCHUR_PRE_USER, 2519371c9d4SSatish Balay PC_FIELDSPLIT_SCHUR_PRE_FULL 2529371c9d4SSatish Balay } PCFieldSplitSchurPreType; 253b0753f9dSMatthew G. Knepley 254b0753f9dSMatthew G. Knepley /*E 255b0753f9dSMatthew G. Knepley PCFieldSplitSchurFactType - determines which off-diagonal parts of the approximate block factorization to use 256b0753f9dSMatthew G. Knepley 25716a05f60SBarry Smith Values: 25816a05f60SBarry Smith + `PC_FIELDSPLIT_SCHUR_FACT_DIAG` - the preconditioner is solving `D` 25916a05f60SBarry Smith . `PC_FIELDSPLIT_SCHUR_FACT_LOWER` - the preconditioner is solving `L D` 26016a05f60SBarry Smith . `PC_FIELDSPLIT_SCHUR_FACT_UPPER` - the preconditioner is solving `D U` 26116a05f60SBarry Smith - `PC_FIELDSPLIT_SCHUR_FACT_FULL` - the preconditioner is solving `L(D U)` 26216a05f60SBarry Smith 26316a05f60SBarry Smith where the matrix is factorized as 26416a05f60SBarry Smith .vb 26516a05f60SBarry Smith (A B) = (1 0) (A 0) (1 Ainv*B) = L D U 26616a05f60SBarry Smith (C E) (C*Ainv 1) (0 S) (0 1) 26716a05f60SBarry Smith .ve 26816a05f60SBarry Smith 269b0753f9dSMatthew G. Knepley Level: intermediate 270b0753f9dSMatthew G. Knepley 27109e53591SBarry Smith .seealso: [](sec_pc), `PCFIELDSPLIT`, `PCFieldSplitSetSchurFactType()`, `PC` 272b0753f9dSMatthew G. Knepley E*/ 273b0753f9dSMatthew G. Knepley typedef enum { 274b0753f9dSMatthew G. Knepley PC_FIELDSPLIT_SCHUR_FACT_DIAG, 275b0753f9dSMatthew G. Knepley PC_FIELDSPLIT_SCHUR_FACT_LOWER, 276b0753f9dSMatthew G. Knepley PC_FIELDSPLIT_SCHUR_FACT_UPPER, 277b0753f9dSMatthew G. Knepley PC_FIELDSPLIT_SCHUR_FACT_FULL 278b0753f9dSMatthew G. Knepley } PCFieldSplitSchurFactType; 279b0753f9dSMatthew G. Knepley 280b0753f9dSMatthew G. Knepley /*E 28187497f52SBarry Smith PCPARMSGlobalType - Determines the global preconditioner method in `PCPARMS` 282b0753f9dSMatthew G. Knepley 283b0753f9dSMatthew G. Knepley Level: intermediate 284b0753f9dSMatthew G. Knepley 28509e53591SBarry Smith .seealso: [](sec_pc), `PCPARMS`, `PCPARMSSetGlobal()`, `PC` 286b0753f9dSMatthew G. Knepley E*/ 2879371c9d4SSatish Balay typedef enum { 2889371c9d4SSatish Balay PC_PARMS_GLOBAL_RAS, 2899371c9d4SSatish Balay PC_PARMS_GLOBAL_SCHUR, 2909371c9d4SSatish Balay PC_PARMS_GLOBAL_BJ 2919371c9d4SSatish Balay } PCPARMSGlobalType; 2929d8081ecSMatthew G. Knepley 293b0753f9dSMatthew G. Knepley /*E 29487497f52SBarry Smith PCPARMSLocalType - Determines the local preconditioner method in `PCPARMS` 295b0753f9dSMatthew G. Knepley 296b0753f9dSMatthew G. Knepley Level: intermediate 297b0753f9dSMatthew G. Knepley 29809e53591SBarry Smith .seealso: [](sec_pc), `PCPARMS`, `PCPARMSSetLocal()`, `PC` 299b0753f9dSMatthew G. Knepley E*/ 3009371c9d4SSatish Balay typedef enum { 3019371c9d4SSatish Balay PC_PARMS_LOCAL_ILU0, 3029371c9d4SSatish Balay PC_PARMS_LOCAL_ILUK, 3039371c9d4SSatish Balay PC_PARMS_LOCAL_ILUT, 3049371c9d4SSatish Balay PC_PARMS_LOCAL_ARMS 3059371c9d4SSatish Balay } PCPARMSLocalType; 306b0753f9dSMatthew G. Knepley 307f0fc11ceSJed Brown /*J 30887497f52SBarry Smith PCGAMGType - type of generalized algebraic multigrid `PCGAMG` method 309b0753f9dSMatthew G. Knepley 31009e53591SBarry Smith Values: 31109e53591SBarry Smith + `PCGAMGAGG` - (the default) smoothed aggregation algorithm, robust, very well tested 312baca6076SPierre Jolivet . `PCGAMGGEO` - geometric coarsening, uses mesh generator to produce coarser meshes, limited to triangles, not supported, reference implementation (2D) 313baca6076SPierre Jolivet - `PCGAMGCLASSICAL` - classical algebraic multigrid preconditioner, incomplete, not supported, reference implementation 31409e53591SBarry Smith 315b0753f9dSMatthew G. Knepley Level: intermediate 316b0753f9dSMatthew G. Knepley 31709e53591SBarry Smith .seealso: [](sec_pc), `PCGAMG`, `PCMG`, `PC`, `PCSetType()`, `PCGAMGSetThreshold()`, `PCGAMGSetThreshold()`, `PCGAMGSetReuseInterpolation()` 318f0fc11ceSJed Brown J*/ 319b0753f9dSMatthew G. Knepley typedef const char *PCGAMGType; 320b0753f9dSMatthew G. Knepley #define PCGAMGAGG "agg" 321b0753f9dSMatthew G. Knepley #define PCGAMGGEO "geo" 322b0753f9dSMatthew G. Knepley #define PCGAMGCLASSICAL "classical" 323b0753f9dSMatthew G. Knepley 324b0753f9dSMatthew G. Knepley typedef const char *PCGAMGClassicalType; 325b0753f9dSMatthew G. Knepley #define PCGAMGCLASSICALDIRECT "direct" 326b0753f9dSMatthew G. Knepley #define PCGAMGCLASSICALSTANDARD "standard" 327b0753f9dSMatthew G. Knepley 328b0753f9dSMatthew G. Knepley /*E 329b0753f9dSMatthew G. Knepley PCMGType - Determines the type of multigrid method that is run. 330b0753f9dSMatthew G. Knepley 331b0753f9dSMatthew G. Knepley Values: 33287497f52SBarry Smith + `PC_MG_MULTIPLICATIVE` (default) - traditional V or W cycle as determined by `PCMGSetCycleType()` 33387497f52SBarry Smith . `PC_MG_ADDITIVE` - the additive multigrid preconditioner where all levels are 334b0753f9dSMatthew G. Knepley smoothed before updating the residual. This only uses the 335b0753f9dSMatthew G. Knepley down smoother, in the preconditioner the upper smoother is ignored 33687497f52SBarry Smith . `PC_MG_FULL` - same as multiplicative except one also performs grid sequencing, 337b0753f9dSMatthew G. Knepley that is starts on the coarsest grid, performs a cycle, interpolates 338b0753f9dSMatthew G. Knepley 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 339b0753f9dSMatthew G. Knepley algorithm supports smoothing on before the restriction on each level in the initial restriction to the coarsest stage. In addition that algorithm 340b0753f9dSMatthew G. Knepley calls the V-cycle only on the coarser level and has a post-smoother instead. 34116a05f60SBarry Smith - `PC_MG_KASKADE` - like full multigrid except one never goes back to a coarser level from a finer 34216a05f60SBarry Smith 34316a05f60SBarry Smith Level: beginner 344b0753f9dSMatthew G. Knepley 34509e53591SBarry Smith .seealso: [](sec_pc), `PCMG`, `PC`, `PCMGSetType()`, `PCMGSetCycleType()`, `PCMGSetCycleTypeOnLevel()` 346b0753f9dSMatthew G. Knepley E*/ 3479371c9d4SSatish Balay typedef enum { 3489371c9d4SSatish Balay PC_MG_MULTIPLICATIVE, 3499371c9d4SSatish Balay PC_MG_ADDITIVE, 3509371c9d4SSatish Balay PC_MG_FULL, 3519371c9d4SSatish Balay PC_MG_KASKADE 3529371c9d4SSatish Balay } PCMGType; 353b0753f9dSMatthew G. Knepley #define PC_MG_CASCADE PC_MG_KASKADE; 354b0753f9dSMatthew G. Knepley 355b0753f9dSMatthew G. Knepley /*E 356b0753f9dSMatthew G. Knepley PCMGCycleType - Use V-cycle or W-cycle 357b0753f9dSMatthew G. Knepley 358b0753f9dSMatthew G. Knepley Values: 359af27ebaaSBarry Smith + `PC_MG_V_CYCLE` - use the V cycle 360af27ebaaSBarry Smith - `PC_MG_W_CYCLE` - use the W cycle 361b0753f9dSMatthew G. Knepley 36216a05f60SBarry Smith Level: beginner 36316a05f60SBarry Smith 36409e53591SBarry Smith .seealso: [](sec_pc), `PCMG`, `PC`, `PCMGSetCycleType()` 365b0753f9dSMatthew G. Knepley E*/ 3669371c9d4SSatish Balay typedef enum { 3679371c9d4SSatish Balay PC_MG_CYCLE_V = 1, 3689371c9d4SSatish Balay PC_MG_CYCLE_W = 2 3699371c9d4SSatish Balay } PCMGCycleType; 370b0753f9dSMatthew G. Knepley 371b0753f9dSMatthew G. Knepley /*E 3722134b1e4SBarry Smith PCMGalerkinType - Determines if the coarse grid operators are computed via the Galerkin process 3732134b1e4SBarry Smith 3742134b1e4SBarry Smith Values: 37587497f52SBarry Smith + `PC_MG_GALERKIN_PMAT` - computes the pmat (matrix from which the preconditioner is built) via the Galerkin process from the finest grid 37687497f52SBarry Smith . `PC_MG_GALERKIN_MAT` - computes the mat (matrix used to apply the operator) via the Galerkin process from the finest grid 37787497f52SBarry Smith . `PC_MG_GALERKIN_BOTH` - computes both the mat and pmat via the Galerkin process (if pmat == mat the construction is only done once 37887497f52SBarry Smith - `PC_MG_GALERKIN_NONE` - neither operator is computed via the Galerkin process, the user must provide the operator 3792134b1e4SBarry Smith 38009e53591SBarry Smith Level: beginner 38109e53591SBarry Smith 38209e53591SBarry Smith Note: 38387497f52SBarry Smith Users should never set `PC_MG_GALERKIN_EXTERNAL`, it is used by `PCHYPRE` and `PCML` 3842134b1e4SBarry Smith 38509e53591SBarry Smith .seealso: [](sec_pc), `PCMG`, `PC`, `PCMGSetCycleType()` 3862134b1e4SBarry Smith E*/ 3879371c9d4SSatish Balay typedef enum { 3889371c9d4SSatish Balay PC_MG_GALERKIN_BOTH, 3899371c9d4SSatish Balay PC_MG_GALERKIN_PMAT, 3909371c9d4SSatish Balay PC_MG_GALERKIN_MAT, 3919371c9d4SSatish Balay PC_MG_GALERKIN_NONE, 3929371c9d4SSatish Balay PC_MG_GALERKIN_EXTERNAL 3939371c9d4SSatish Balay } PCMGGalerkinType; 3942134b1e4SBarry Smith 3952134b1e4SBarry Smith /*E 396b0753f9dSMatthew G. Knepley PCExoticType - Face based or wirebasket based coarse grid space 397b0753f9dSMatthew G. Knepley 398b0753f9dSMatthew G. Knepley Level: beginner 399b0753f9dSMatthew G. Knepley 40009e53591SBarry Smith .seealso: [](sec_pc), `PCExoticSetType()`, `PCEXOTIC` 401b0753f9dSMatthew G. Knepley E*/ 4029371c9d4SSatish Balay typedef enum { 4039371c9d4SSatish Balay PC_EXOTIC_FACE, 4049371c9d4SSatish Balay PC_EXOTIC_WIREBASKET 4059371c9d4SSatish Balay } PCExoticType; 406b0753f9dSMatthew G. Knepley 4078c1cd74cSHong Zhang /*E 408bc960bbfSJed Brown PCBDDCInterfaceExtType - Defines how interface balancing is extended into the interior of subdomains. 409bc960bbfSJed Brown 410bc960bbfSJed Brown Values: 41187497f52SBarry Smith + `PC_BDDC_INTERFACE_EXT_DIRICHLET` - solves Dirichlet interior problem; this is the standard BDDC algorithm 41287497f52SBarry Smith - `PC_BDDC_INTERFACE_EXT_LUMP` - skips interior solve; sometimes called M_1 and associated with "lumped FETI-DP" 413bc960bbfSJed Brown 41416a05f60SBarry Smith Level: intermediate 41516a05f60SBarry Smith 41609e53591SBarry Smith .seealso: [](sec_pc), `PCBDDC`, `PC` 417bc960bbfSJed Brown E*/ 418bc960bbfSJed Brown typedef enum { 419bc960bbfSJed Brown PC_BDDC_INTERFACE_EXT_DIRICHLET, 420bc960bbfSJed Brown PC_BDDC_INTERFACE_EXT_LUMP 421bc960bbfSJed Brown } PCBDDCInterfaceExtType; 422bc960bbfSJed Brown 423bc960bbfSJed Brown /*E 424f3b08a26SMatthew G. Knepley PCMGCoarseSpaceType - Function space for coarse space for adaptive interpolation 425f3b08a26SMatthew G. Knepley 426f3b08a26SMatthew G. Knepley Level: beginner 427f3b08a26SMatthew G. Knepley 42809e53591SBarry Smith .seealso: [](sec_pc), `PCMGSetAdaptCoarseSpaceType()`, `PCMG`, `PC` 429f3b08a26SMatthew G. Knepley E*/ 4309371c9d4SSatish Balay typedef enum { 4319371c9d4SSatish Balay PCMG_ADAPT_NONE, 4329371c9d4SSatish Balay PCMG_ADAPT_POLYNOMIAL, 4339371c9d4SSatish Balay PCMG_ADAPT_HARMONIC, 4349371c9d4SSatish Balay PCMG_ADAPT_EIGENVECTOR, 4359371c9d4SSatish Balay PCMG_ADAPT_GENERALIZED_EIGENVECTOR, 4369371c9d4SSatish Balay PCMG_ADAPT_GDSW 4379371c9d4SSatish Balay } PCMGCoarseSpaceType; 438f3b08a26SMatthew G. Knepley 439f3b08a26SMatthew G. Knepley /*E 44016a05f60SBarry Smith PCPatchConstructType - The algorithm used to construct patches for the `PCPATCH` preconditioner 4414bbf5ea8SMatthew G. Knepley 4424bbf5ea8SMatthew G. Knepley Level: beginner 4434bbf5ea8SMatthew G. Knepley 44409e53591SBarry Smith .seealso: [](sec_pc), `PCPatchSetConstructType()`, `PCPATCH`, `PC` 4454bbf5ea8SMatthew G. Knepley E*/ 4469371c9d4SSatish Balay typedef enum { 4479371c9d4SSatish Balay PC_PATCH_STAR, 4489371c9d4SSatish Balay PC_PATCH_VANKA, 4499371c9d4SSatish Balay PC_PATCH_PARDECOMP, 4509371c9d4SSatish Balay PC_PATCH_USER, 4519371c9d4SSatish Balay PC_PATCH_PYTHON 4529371c9d4SSatish Balay } PCPatchConstructType; 4534bbf5ea8SMatthew G. Knepley 4544bbf5ea8SMatthew G. Knepley /*E 455e26ad46dSJakub Kruzik PCDeflationSpaceType - Type of deflation 456e662bc50SJakub Kruzik 457e662bc50SJakub Kruzik Values: 45887497f52SBarry Smith + `PC_DEFLATION_SPACE_HAAR` - directly assembled based on Haar (db2) wavelet with overflowed filter cuted-off 45909e53591SBarry Smith . `PC_DEFLATION_SPACE_DB2` - `MATCOMPOSITE` of 1-lvl matices based on db2 (2 coefficient Daubechies / Haar wavelet) 46087497f52SBarry Smith . `PC_DEFLATION_SPACE_DB4` - same as above, but with db4 (4 coefficient Daubechies) 46187497f52SBarry Smith . `PC_DEFLATION_SPACE_DB8` - same as above, but with db8 (8 coefficient Daubechies) 46287497f52SBarry Smith . `PC_DEFLATION_SPACE_DB16` - same as above, but with db16 (16 coefficient Daubechies) 46387497f52SBarry Smith . `PC_DEFLATION_SPACE_BIORTH22` - same as above, but with biorthogonal 2.2 (6 coefficients) 46487497f52SBarry Smith . `PC_DEFLATION_SPACE_MEYER` - same as above, but with Meyer/FIR (62 coefficients) 465d5b43468SJose E. Roman . `PC_DEFLATION_SPACE_AGGREGATION` - aggregates local indices (given by operator matrix distribution) into a subdomain 46687497f52SBarry Smith - `PC_DEFLATION_SPACE_USER` - indicates space set by user 467e662bc50SJakub Kruzik 4681fdb00f9SJakub Kruzik Level: intermediate 4691fdb00f9SJakub Kruzik 47009e53591SBarry Smith Note: 47109e53591SBarry Smith Wavelet-based space (except Haar) can be used in multilevel deflation. 47209e53591SBarry Smith 47309e53591SBarry Smith .seealso: [](sec_pc), `PCDeflationSetSpaceToCompute()`, `PCDEFLATION`, `PC` 474e662bc50SJakub Kruzik E*/ 475e662bc50SJakub Kruzik typedef enum { 476e662bc50SJakub Kruzik PC_DEFLATION_SPACE_HAAR, 477e662bc50SJakub Kruzik PC_DEFLATION_SPACE_DB2, 478e662bc50SJakub Kruzik PC_DEFLATION_SPACE_DB4, 479e662bc50SJakub Kruzik PC_DEFLATION_SPACE_DB8, 480e662bc50SJakub Kruzik PC_DEFLATION_SPACE_DB16, 481e662bc50SJakub Kruzik PC_DEFLATION_SPACE_BIORTH22, 482e662bc50SJakub Kruzik PC_DEFLATION_SPACE_MEYER, 483e662bc50SJakub Kruzik PC_DEFLATION_SPACE_AGGREGATION, 484e662bc50SJakub Kruzik PC_DEFLATION_SPACE_USER 485e662bc50SJakub Kruzik } PCDeflationSpaceType; 486e662bc50SJakub Kruzik 487e662bc50SJakub Kruzik /*E 48887497f52SBarry Smith PCHPDDMCoarseCorrectionType - Type of coarse correction used by `PCHPDDM` 48938cfc46eSPierre Jolivet 49038cfc46eSPierre Jolivet Values: 49109e53591SBarry Smith + `PC_HPDDM_COARSE_CORRECTION_DEFLATED` (default) - eq. (1) in `PCHPDDMShellApply()` 49287497f52SBarry Smith . `PC_HPDDM_COARSE_CORRECTION_ADDITIVE` - eq. (2) 493aa1539e9SPierre Jolivet . `PC_HPDDM_COARSE_CORRECTION_BALANCED` - eq. (3) 494aa1539e9SPierre Jolivet - `PC_HPDDM_COARSE_CORRECTION_NONE` - no coarse correction (mostly useful for debugging) 49538cfc46eSPierre Jolivet 49616a05f60SBarry Smith Level: intermediate 49716a05f60SBarry Smith 49809e53591SBarry Smith .seealso: [](sec_pc), `PCHPDDM`, `PC`, `PCSetType()`, `PCHPDDMShellApply()` 49938cfc46eSPierre Jolivet E*/ 5009371c9d4SSatish Balay typedef enum { 5019371c9d4SSatish Balay PC_HPDDM_COARSE_CORRECTION_DEFLATED, 5029371c9d4SSatish Balay PC_HPDDM_COARSE_CORRECTION_ADDITIVE, 503aa1539e9SPierre Jolivet PC_HPDDM_COARSE_CORRECTION_BALANCED, 504aa1539e9SPierre Jolivet PC_HPDDM_COARSE_CORRECTION_NONE 5059371c9d4SSatish Balay } PCHPDDMCoarseCorrectionType; 50638cfc46eSPierre Jolivet 50738cfc46eSPierre Jolivet /*E 50813044ca3SPierre Jolivet PCHPDDMSchurPreType - Type of `PCHPDDM` preconditioner for a `MATSCHURCOMPLEMENT` generated by `PCFIELDSPLIT` with `PCFieldSplitSchurPreType` set to `PC_FIELDSPLIT_SCHUR_PRE_SELF` 50913044ca3SPierre Jolivet 51013044ca3SPierre Jolivet Values: 51113044ca3SPierre Jolivet + `PC_HPDDM_SCHUR_PRE_LEAST_SQUARES` (default) - only with a near-zero A11 block and A10 = A01^T; a preconditioner for solving A01^T A00^-1 A01 x = b is built by approximating the Schur complement with (inv(sqrt(diag(A00))) A01)^T (inv(sqrt(diag(A00))) A01) and by considering the associated linear least squares problem 51213044ca3SPierre Jolivet - `PC_HPDDM_SCHUR_PRE_GENEO` - only with A10 = A01^T, `PCHPDDMSetAuxiliaryMat()` called on the `PC` of the A00 block, and if A11 is nonzero, then `PCHPDDMSetAuxiliaryMat()` must be called on the associated `PC` as well (it is built automatically for the user otherwise); the Schur complement `PC` is set internally to `PCKSP`, with the prefix `-fieldsplit_1_pc_hpddm_`; the operator associated to the `PC` is spectrally equivalent to the original Schur complement 51313044ca3SPierre Jolivet 51413044ca3SPierre Jolivet Level: advanced 51513044ca3SPierre Jolivet 51613044ca3SPierre Jolivet .seealso: [](sec_pc), `PCHPDDM`, `PC`, `PCFIELDSPLIT`, `PC_FIELDSPLIT_SCHUR_PRE_SELF`, `PCFieldSplitSetSchurPre()`, `PCHPDDMSetAuxiliaryMat()` 51713044ca3SPierre Jolivet E*/ 51813044ca3SPierre Jolivet typedef enum { 51913044ca3SPierre Jolivet PC_HPDDM_SCHUR_PRE_LEAST_SQUARES, 52013044ca3SPierre Jolivet PC_HPDDM_SCHUR_PRE_GENEO, 52113044ca3SPierre Jolivet } PCHPDDMSchurPreType; 52213044ca3SPierre Jolivet 52313044ca3SPierre Jolivet /*E 52487497f52SBarry Smith PCFailedReason - indicates type of `PC` failure 5258c1cd74cSHong Zhang 5268c1cd74cSHong Zhang Level: beginner 5278c1cd74cSHong Zhang 52809e53591SBarry Smith .seealso: [](sec_pc), `PC` 5298c1cd74cSHong Zhang E*/ 5309371c9d4SSatish Balay typedef enum { 5319371c9d4SSatish Balay PC_SETUP_ERROR = -1, 5329371c9d4SSatish Balay PC_NOERROR, 5339371c9d4SSatish Balay PC_FACTOR_STRUCT_ZEROPIVOT, 5349371c9d4SSatish Balay PC_FACTOR_NUMERIC_ZEROPIVOT, 5359371c9d4SSatish Balay PC_FACTOR_OUTMEMORY, 5369371c9d4SSatish Balay PC_FACTOR_OTHER, 53787b47708SBarry Smith PC_INCONSISTENT_RHS, 5389371c9d4SSatish Balay PC_SUBPC_ERROR 5399371c9d4SSatish Balay } PCFailedReason; 540ce7c7f2fSMark Adams 541ce7c7f2fSMark Adams /*E 542ce7c7f2fSMark Adams PCGAMGLayoutType - Layout for reduced grids 543ce7c7f2fSMark Adams 544ce7c7f2fSMark Adams Level: intermediate 545ce7c7f2fSMark Adams 54609e53591SBarry Smith .seealso: [](sec_pc), `PCGAMG`, `PC`, `PCGAMGSetCoarseGridLayoutType()` 547ce7c7f2fSMark Adams E*/ 5489371c9d4SSatish Balay typedef enum { 5499371c9d4SSatish Balay PCGAMG_LAYOUT_COMPACT, 5509371c9d4SSatish Balay PCGAMG_LAYOUT_SPREAD 5519371c9d4SSatish Balay } PCGAMGLayoutType; 552