15e8efad8SHong Zhang 2c6db04a5SJed Brown #include <../src/ksp/pc/impls/factor/factor.h> /*I "petscpc.h" I*/ 3978beb7fSPierre Jolivet #include <petsc/private/matimpl.h> 45e8efad8SHong Zhang 54ac6704cSBarry Smith /* 64ac6704cSBarry Smith If an ordering is not yet set and the matrix is available determine a default ordering 74ac6704cSBarry Smith */ 84ac6704cSBarry Smith PetscErrorCode PCFactorSetDefaultOrdering_Factor(PC pc) 94ac6704cSBarry Smith { 10978beb7fSPierre Jolivet Mat B; 11978beb7fSPierre Jolivet PetscBool foundmtype,flg; 124ac6704cSBarry Smith PetscErrorCode ierr; 134ac6704cSBarry Smith 144ac6704cSBarry Smith PetscFunctionBegin; 154ac6704cSBarry Smith if (pc->pmat) { 164ac6704cSBarry Smith PC_Factor *fact = (PC_Factor*)pc->data; 17978beb7fSPierre Jolivet ierr = MatSolverTypeGet(fact->solvertype,((PetscObject)pc->pmat)->type_name,fact->factortype,NULL,&foundmtype,NULL);CHKERRQ(ierr); 18978beb7fSPierre Jolivet if (foundmtype) { 194ac6704cSBarry Smith if (!fact->fact) { 204ac6704cSBarry Smith ierr = MatGetFactor(pc->pmat,fact->solvertype,fact->factortype,&fact->fact);CHKERRQ(ierr); 21978beb7fSPierre Jolivet } else if (!fact->fact->assembled) { 22978beb7fSPierre Jolivet ierr = PetscStrcmp(fact->solvertype,fact->fact->solvertype,&flg);CHKERRQ(ierr); 23978beb7fSPierre Jolivet if (!flg) { 24978beb7fSPierre Jolivet ierr = MatGetFactor(pc->pmat,fact->solvertype,fact->factortype,&B);CHKERRQ(ierr); 25978beb7fSPierre Jolivet ierr = MatHeaderReplace(fact->fact,&B);CHKERRQ(ierr); 26978beb7fSPierre Jolivet } 274ac6704cSBarry Smith } 284ac6704cSBarry Smith if (!fact->ordering) { 294ac6704cSBarry Smith PetscBool canuseordering; 304ac6704cSBarry Smith MatOrderingType otype; 314ac6704cSBarry Smith 324ac6704cSBarry Smith ierr = MatFactorGetCanUseOrdering(fact->fact,&canuseordering);CHKERRQ(ierr); 334ac6704cSBarry Smith if (canuseordering) { 344ac6704cSBarry Smith ierr = MatFactorGetPreferredOrdering(fact->fact,fact->factortype,&otype);CHKERRQ(ierr); 354ac6704cSBarry Smith } else otype = MATORDERINGEXTERNAL; 364ac6704cSBarry Smith ierr = PetscStrallocpy(otype,(char **)&fact->ordering);CHKERRQ(ierr); 374ac6704cSBarry Smith } 384ac6704cSBarry Smith } 39978beb7fSPierre Jolivet } 404ac6704cSBarry Smith PetscFunctionReturn(0); 414ac6704cSBarry Smith } 424ac6704cSBarry Smith 433d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetReuseOrdering_Factor(PC pc,PetscBool flag) 443d1c1ea0SBarry Smith { 453d1c1ea0SBarry Smith PC_Factor *lu = (PC_Factor*)pc->data; 463d1c1ea0SBarry Smith 473d1c1ea0SBarry Smith PetscFunctionBegin; 483d1c1ea0SBarry Smith lu->reuseordering = flag; 493d1c1ea0SBarry Smith PetscFunctionReturn(0); 503d1c1ea0SBarry Smith } 513d1c1ea0SBarry Smith 523d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetReuseFill_Factor(PC pc,PetscBool flag) 533d1c1ea0SBarry Smith { 543d1c1ea0SBarry Smith PC_Factor *lu = (PC_Factor*)pc->data; 553d1c1ea0SBarry Smith 563d1c1ea0SBarry Smith PetscFunctionBegin; 573d1c1ea0SBarry Smith lu->reusefill = flag; 583d1c1ea0SBarry Smith PetscFunctionReturn(0); 593d1c1ea0SBarry Smith } 603d1c1ea0SBarry Smith 613d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetUseInPlace_Factor(PC pc,PetscBool flg) 623d1c1ea0SBarry Smith { 633d1c1ea0SBarry Smith PC_Factor *dir = (PC_Factor*)pc->data; 643d1c1ea0SBarry Smith 653d1c1ea0SBarry Smith PetscFunctionBegin; 663d1c1ea0SBarry Smith dir->inplace = flg; 673d1c1ea0SBarry Smith PetscFunctionReturn(0); 683d1c1ea0SBarry Smith } 693d1c1ea0SBarry Smith 703d1c1ea0SBarry Smith static PetscErrorCode PCFactorGetUseInPlace_Factor(PC pc,PetscBool *flg) 713d1c1ea0SBarry Smith { 723d1c1ea0SBarry Smith PC_Factor *dir = (PC_Factor*)pc->data; 733d1c1ea0SBarry Smith 743d1c1ea0SBarry Smith PetscFunctionBegin; 753d1c1ea0SBarry Smith *flg = dir->inplace; 763d1c1ea0SBarry Smith PetscFunctionReturn(0); 773d1c1ea0SBarry Smith } 783d1c1ea0SBarry Smith 79f8260c8fSBarry Smith /*@ 803ca39a21SBarry Smith PCFactorSetUpMatSolverType - Can be called after KSPSetOperators() or PCSetOperators(), causes MatGetFactor() to be called so then one may 81f8260c8fSBarry Smith set the options for that particular factorization object. 82f8260c8fSBarry Smith 83f8260c8fSBarry Smith Input Parameter: 84f8260c8fSBarry Smith . pc - the preconditioner context 85f8260c8fSBarry Smith 8695452b02SPatrick Sanan Notes: 8795452b02SPatrick Sanan After you have called this function (which has to be after the KSPSetOperators() or PCSetOperators()) you can call PCFactorGetMatrix() and then set factor options on that matrix. 88f8260c8fSBarry Smith 892bd2b0e6SSatish Balay Level: intermediate 902bd2b0e6SSatish Balay 916d33885cSprj- .seealso: PCFactorSetMatSolverType(), PCFactorGetMatrix() 92f8260c8fSBarry Smith @*/ 933ca39a21SBarry Smith PetscErrorCode PCFactorSetUpMatSolverType(PC pc) 94f8260c8fSBarry Smith { 95f8260c8fSBarry Smith PetscErrorCode ierr; 96f8260c8fSBarry Smith 97f8260c8fSBarry Smith PetscFunctionBegin; 98f8260c8fSBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 993ca39a21SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetUpMatSolverType_C",(PC),(pc));CHKERRQ(ierr); 100b3a44c85SBarry Smith PetscFunctionReturn(0); 101f8260c8fSBarry Smith } 102f8260c8fSBarry Smith 103ee45ca4aSHong Zhang /*@ 104ee45ca4aSHong Zhang PCFactorSetZeroPivot - Sets the size at which smaller pivots are declared to be zero 105ee45ca4aSHong Zhang 106ad4df100SBarry Smith Logically Collective on PC 107ee45ca4aSHong Zhang 108ee45ca4aSHong Zhang Input Parameters: 109afaefe49SHong Zhang + pc - the preconditioner context 110afaefe49SHong Zhang - zero - all pivots smaller than this will be considered zero 111ee45ca4aSHong Zhang 112ee45ca4aSHong Zhang Options Database Key: 113ee45ca4aSHong Zhang . -pc_factor_zeropivot <zero> - Sets tolerance for what is considered a zero pivot 114ee45ca4aSHong Zhang 115ee45ca4aSHong Zhang Level: intermediate 116ee45ca4aSHong Zhang 117daa17b54SHong Zhang .seealso: PCFactorSetShiftType(), PCFactorSetShiftAmount() 118ee45ca4aSHong Zhang @*/ 1197087cfbeSBarry Smith PetscErrorCode PCFactorSetZeroPivot(PC pc,PetscReal zero) 120ee45ca4aSHong Zhang { 1214ac538c5SBarry Smith PetscErrorCode ierr; 122afaefe49SHong Zhang 123ee45ca4aSHong Zhang PetscFunctionBegin; 1240700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 125c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,zero,2); 1264ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetZeroPivot_C",(PC,PetscReal),(pc,zero));CHKERRQ(ierr); 127ee45ca4aSHong Zhang PetscFunctionReturn(0); 128ee45ca4aSHong Zhang } 129ee45ca4aSHong Zhang 130915743fcSHong Zhang /*@ 131915743fcSHong Zhang PCFactorSetShiftType - adds a particular type of quantity to the diagonal of the matrix during 132915743fcSHong Zhang numerical factorization, thus the matrix has nonzero pivots 133915743fcSHong Zhang 134ad4df100SBarry Smith Logically Collective on PC 135915743fcSHong Zhang 136915743fcSHong Zhang Input Parameters: 137915743fcSHong Zhang + pc - the preconditioner context 138915743fcSHong Zhang - shifttype - type of shift; one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO, MAT_SHIFT_POSITIVE_DEFINITE, MAT_SHIFT_INBLOCKS 139915743fcSHong Zhang 140915743fcSHong Zhang Options Database Key: 14128d58a37SPierre Jolivet . -pc_factor_shift_type <shifttype> - Sets shift type; use '-help' for a list of available types 142915743fcSHong Zhang 143915743fcSHong Zhang Level: intermediate 144915743fcSHong Zhang 145915743fcSHong Zhang .seealso: PCFactorSetZeroPivot(), PCFactorSetShiftAmount() 146915743fcSHong Zhang @*/ 1477087cfbeSBarry Smith PetscErrorCode PCFactorSetShiftType(PC pc,MatFactorShiftType shifttype) 148d90ac83dSHong Zhang { 1494ac538c5SBarry Smith PetscErrorCode ierr; 150d90ac83dSHong Zhang 151d90ac83dSHong Zhang PetscFunctionBegin; 1520700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 153c5eb9154SBarry Smith PetscValidLogicalCollectiveEnum(pc,shifttype,2); 1544ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetShiftType_C",(PC,MatFactorShiftType),(pc,shifttype));CHKERRQ(ierr); 155d90ac83dSHong Zhang PetscFunctionReturn(0); 156d90ac83dSHong Zhang } 157d90ac83dSHong Zhang 158915743fcSHong Zhang /*@ 159915743fcSHong Zhang PCFactorSetShiftAmount - adds a quantity to the diagonal of the matrix during 160915743fcSHong Zhang numerical factorization, thus the matrix has nonzero pivots 161915743fcSHong Zhang 162ad4df100SBarry Smith Logically Collective on PC 163915743fcSHong Zhang 164915743fcSHong Zhang Input Parameters: 165915743fcSHong Zhang + pc - the preconditioner context 166915743fcSHong Zhang - shiftamount - amount of shift 167915743fcSHong Zhang 168915743fcSHong Zhang Options Database Key: 169915743fcSHong Zhang . -pc_factor_shift_amount <shiftamount> - Sets shift amount or PETSC_DECIDE for the default 170915743fcSHong Zhang 171915743fcSHong Zhang Level: intermediate 172915743fcSHong Zhang 173915743fcSHong Zhang .seealso: PCFactorSetZeroPivot(), PCFactorSetShiftType() 174915743fcSHong Zhang @*/ 1757087cfbeSBarry Smith PetscErrorCode PCFactorSetShiftAmount(PC pc,PetscReal shiftamount) 176d90ac83dSHong Zhang { 1774ac538c5SBarry Smith PetscErrorCode ierr; 178d90ac83dSHong Zhang 179d90ac83dSHong Zhang PetscFunctionBegin; 1800700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 181c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,shiftamount,2); 1824ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetShiftAmount_C",(PC,PetscReal),(pc,shiftamount));CHKERRQ(ierr); 183d90ac83dSHong Zhang PetscFunctionReturn(0); 184d90ac83dSHong Zhang } 185d90ac83dSHong Zhang 1866d33885cSprj- /*@ 187b7c853c4SBarry Smith PCFactorSetDropTolerance - The preconditioner will use an ILU 18878fc6b22SHong Zhang based on a drop tolerance. (Under development) 18985317021SBarry Smith 190ad4df100SBarry Smith Logically Collective on PC 19185317021SBarry Smith 19285317021SBarry Smith Input Parameters: 19385317021SBarry Smith + pc - the preconditioner context 19485317021SBarry Smith . dt - the drop tolerance, try from 1.e-10 to .1 19585317021SBarry Smith . dtcol - tolerance for column pivot, good values [0.1 to 0.01] 19685317021SBarry Smith - maxrowcount - the max number of nonzeros allowed in a row, best value 19785317021SBarry Smith depends on the number of nonzeros in row of original matrix 19885317021SBarry Smith 19985317021SBarry Smith Options Database Key: 200b7c853c4SBarry Smith . -pc_factor_drop_tolerance <dt,dtcol,maxrowcount> - Sets drop tolerance 20185317021SBarry Smith 20285317021SBarry Smith Level: intermediate 20385317021SBarry Smith 20485317021SBarry Smith There are NO default values for the 3 parameters, you must set them with reasonable values for your 20585317021SBarry Smith matrix. We don't know how to compute reasonable values. 20685317021SBarry Smith 2076d33885cSprj- @*/ 2087087cfbeSBarry Smith PetscErrorCode PCFactorSetDropTolerance(PC pc,PetscReal dt,PetscReal dtcol,PetscInt maxrowcount) 20985317021SBarry Smith { 2104ac538c5SBarry Smith PetscErrorCode ierr; 21185317021SBarry Smith 21285317021SBarry Smith PetscFunctionBegin; 2130700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 214064a246eSJacob Faibussowitsch PetscValidLogicalCollectiveReal(pc,dtcol,3); 215064a246eSJacob Faibussowitsch PetscValidLogicalCollectiveInt(pc,maxrowcount,4); 2164ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetDropTolerance_C",(PC,PetscReal,PetscReal,PetscInt),(pc,dt,dtcol,maxrowcount));CHKERRQ(ierr); 21785317021SBarry Smith PetscFunctionReturn(0); 21885317021SBarry Smith } 21985317021SBarry Smith 220c7f610a1SBarry Smith /*@ 221c7f610a1SBarry Smith PCFactorGetZeroPivot - Gets the tolerance used to define a zero privot 222c7f610a1SBarry Smith 223c7f610a1SBarry Smith Not Collective 224c7f610a1SBarry Smith 225c7f610a1SBarry Smith Input Parameters: 226c7f610a1SBarry Smith . pc - the preconditioner context 227c7f610a1SBarry Smith 228c7f610a1SBarry Smith Output Parameter: 229c7f610a1SBarry Smith . pivot - the tolerance 230c7f610a1SBarry Smith 231c7f610a1SBarry Smith Level: intermediate 232c7f610a1SBarry Smith 233c7f610a1SBarry Smith .seealso: PCFactorSetZeroPivot() 234c7f610a1SBarry Smith @*/ 235c7f610a1SBarry Smith PetscErrorCode PCFactorGetZeroPivot(PC pc,PetscReal *pivot) 236c7f610a1SBarry Smith { 237c7f610a1SBarry Smith PetscErrorCode ierr; 238c7f610a1SBarry Smith 239c7f610a1SBarry Smith PetscFunctionBegin; 240c7f610a1SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 241c7f610a1SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetZeroPivot_C",(PC,PetscReal*),(pc,pivot));CHKERRQ(ierr); 242c7f610a1SBarry Smith PetscFunctionReturn(0); 243c7f610a1SBarry Smith } 244c7f610a1SBarry Smith 245c7f610a1SBarry Smith /*@ 246c7f610a1SBarry Smith PCFactorGetShiftAmount - Gets the tolerance used to define a zero privot 247c7f610a1SBarry Smith 248c7f610a1SBarry Smith Not Collective 249c7f610a1SBarry Smith 250c7f610a1SBarry Smith Input Parameters: 251c7f610a1SBarry Smith . pc - the preconditioner context 252c7f610a1SBarry Smith 253c7f610a1SBarry Smith Output Parameter: 254c7f610a1SBarry Smith . shift - how much to shift the diagonal entry 255c7f610a1SBarry Smith 256c7f610a1SBarry Smith Level: intermediate 257c7f610a1SBarry Smith 258c7f610a1SBarry Smith .seealso: PCFactorSetShiftAmount(), PCFactorSetShiftType(), PCFactorGetShiftType() 259c7f610a1SBarry Smith @*/ 260c7f610a1SBarry Smith PetscErrorCode PCFactorGetShiftAmount(PC pc,PetscReal *shift) 261c7f610a1SBarry Smith { 262c7f610a1SBarry Smith PetscErrorCode ierr; 263c7f610a1SBarry Smith 264c7f610a1SBarry Smith PetscFunctionBegin; 265c7f610a1SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 266c7f610a1SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetShiftAmount_C",(PC,PetscReal*),(pc,shift));CHKERRQ(ierr); 267c7f610a1SBarry Smith PetscFunctionReturn(0); 268c7f610a1SBarry Smith } 269c7f610a1SBarry Smith 270c7f610a1SBarry Smith /*@ 271c7f610a1SBarry Smith PCFactorGetShiftType - Gets the type of shift, if any, done when a zero pivot is detected 272c7f610a1SBarry Smith 273c7f610a1SBarry Smith Not Collective 274c7f610a1SBarry Smith 275c7f610a1SBarry Smith Input Parameters: 276c7f610a1SBarry Smith . pc - the preconditioner context 277c7f610a1SBarry Smith 278c7f610a1SBarry Smith Output Parameter: 279c7f610a1SBarry Smith . type - one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO, MAT_SHIFT_POSITIVE_DEFINITE, or MAT_SHIFT_INBLOCKS 280c7f610a1SBarry Smith 281c7f610a1SBarry Smith Level: intermediate 282c7f610a1SBarry Smith 283c7f610a1SBarry Smith .seealso: PCFactorSetShiftType(), MatFactorShiftType, PCFactorSetShiftAmount(), PCFactorGetShiftAmount() 284c7f610a1SBarry Smith @*/ 285c7f610a1SBarry Smith PetscErrorCode PCFactorGetShiftType(PC pc,MatFactorShiftType *type) 286c7f610a1SBarry Smith { 287c7f610a1SBarry Smith PetscErrorCode ierr; 288c7f610a1SBarry Smith 289c7f610a1SBarry Smith PetscFunctionBegin; 290c7f610a1SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 291c7f610a1SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetShiftType_C",(PC,MatFactorShiftType*),(pc,type));CHKERRQ(ierr); 292c7f610a1SBarry Smith PetscFunctionReturn(0); 293c7f610a1SBarry Smith } 294c7f610a1SBarry Smith 2952591b318SToby Isaac /*@ 2962591b318SToby Isaac PCFactorGetLevels - Gets the number of levels of fill to use. 2972591b318SToby Isaac 2982591b318SToby Isaac Logically Collective on PC 2992591b318SToby Isaac 3002591b318SToby Isaac Input Parameters: 3012591b318SToby Isaac . pc - the preconditioner context 3022591b318SToby Isaac 3032591b318SToby Isaac Output Parameter: 3042591b318SToby Isaac . levels - number of levels of fill 3052591b318SToby Isaac 3062591b318SToby Isaac Level: intermediate 3072591b318SToby Isaac 3082591b318SToby Isaac @*/ 3092591b318SToby Isaac PetscErrorCode PCFactorGetLevels(PC pc,PetscInt *levels) 3102591b318SToby Isaac { 3112591b318SToby Isaac PetscErrorCode ierr; 3122591b318SToby Isaac 3132591b318SToby Isaac PetscFunctionBegin; 3142591b318SToby Isaac PetscValidHeaderSpecific(pc,PC_CLASSID,1); 315c60c7ad4SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetLevels_C",(PC,PetscInt*),(pc,levels));CHKERRQ(ierr); 3162591b318SToby Isaac PetscFunctionReturn(0); 3172591b318SToby Isaac } 3182591b318SToby Isaac 31985317021SBarry Smith /*@ 32085317021SBarry Smith PCFactorSetLevels - Sets the number of levels of fill to use. 32185317021SBarry Smith 322ad4df100SBarry Smith Logically Collective on PC 32385317021SBarry Smith 32485317021SBarry Smith Input Parameters: 32585317021SBarry Smith + pc - the preconditioner context 32685317021SBarry Smith - levels - number of levels of fill 32785317021SBarry Smith 32885317021SBarry Smith Options Database Key: 32985317021SBarry Smith . -pc_factor_levels <levels> - Sets fill level 33085317021SBarry Smith 33185317021SBarry Smith Level: intermediate 33285317021SBarry Smith 33385317021SBarry Smith @*/ 3347087cfbeSBarry Smith PetscErrorCode PCFactorSetLevels(PC pc,PetscInt levels) 33585317021SBarry Smith { 3364ac538c5SBarry Smith PetscErrorCode ierr; 33785317021SBarry Smith 33885317021SBarry Smith PetscFunctionBegin; 3390700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 340*2c71b3e2SJacob Faibussowitsch PetscCheckFalse(levels < 0,PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_OUTOFRANGE,"negative levels"); 341c5eb9154SBarry Smith PetscValidLogicalCollectiveInt(pc,levels,2); 3424ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetLevels_C",(PC,PetscInt),(pc,levels));CHKERRQ(ierr); 34385317021SBarry Smith PetscFunctionReturn(0); 34485317021SBarry Smith } 34585317021SBarry Smith 34685317021SBarry Smith /*@ 34785317021SBarry Smith PCFactorSetAllowDiagonalFill - Causes all diagonal matrix entries to be 34885317021SBarry Smith treated as level 0 fill even if there is no non-zero location. 34985317021SBarry Smith 350ad4df100SBarry Smith Logically Collective on PC 35185317021SBarry Smith 35285317021SBarry Smith Input Parameters: 35385317021SBarry Smith + pc - the preconditioner context 35492e9c092SBarry Smith - flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off 35585317021SBarry Smith 35685317021SBarry Smith Options Database Key: 35785317021SBarry Smith . -pc_factor_diagonal_fill 35885317021SBarry Smith 35985317021SBarry Smith Notes: 36085317021SBarry Smith Does not apply with 0 fill. 36185317021SBarry Smith 36285317021SBarry Smith Level: intermediate 36385317021SBarry Smith 36492e9c092SBarry Smith .seealso: PCFactorGetAllowDiagonalFill() 36585317021SBarry Smith @*/ 36692e9c092SBarry Smith PetscErrorCode PCFactorSetAllowDiagonalFill(PC pc,PetscBool flg) 36785317021SBarry Smith { 3684ac538c5SBarry Smith PetscErrorCode ierr; 36985317021SBarry Smith 37085317021SBarry Smith PetscFunctionBegin; 3710700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 37292e9c092SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetAllowDiagonalFill_C",(PC,PetscBool),(pc,flg));CHKERRQ(ierr); 37392e9c092SBarry Smith PetscFunctionReturn(0); 37492e9c092SBarry Smith } 37592e9c092SBarry Smith 37692e9c092SBarry Smith /*@ 37792e9c092SBarry Smith PCFactorGetAllowDiagonalFill - Determines if all diagonal matrix entries are 37892e9c092SBarry Smith treated as level 0 fill even if there is no non-zero location. 37992e9c092SBarry Smith 38092e9c092SBarry Smith Logically Collective on PC 38192e9c092SBarry Smith 38292e9c092SBarry Smith Input Parameter: 38392e9c092SBarry Smith . pc - the preconditioner context 38492e9c092SBarry Smith 38592e9c092SBarry Smith Output Parameter: 38692e9c092SBarry Smith . flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off 38792e9c092SBarry Smith 38892e9c092SBarry Smith Options Database Key: 38992e9c092SBarry Smith . -pc_factor_diagonal_fill 39092e9c092SBarry Smith 39192e9c092SBarry Smith Notes: 39292e9c092SBarry Smith Does not apply with 0 fill. 39392e9c092SBarry Smith 39492e9c092SBarry Smith Level: intermediate 39592e9c092SBarry Smith 39692e9c092SBarry Smith .seealso: PCFactorSetAllowDiagonalFill() 39792e9c092SBarry Smith @*/ 39892e9c092SBarry Smith PetscErrorCode PCFactorGetAllowDiagonalFill(PC pc,PetscBool *flg) 39992e9c092SBarry Smith { 40092e9c092SBarry Smith PetscErrorCode ierr; 40192e9c092SBarry Smith 40292e9c092SBarry Smith PetscFunctionBegin; 40392e9c092SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 404c60c7ad4SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetAllowDiagonalFill_C",(PC,PetscBool*),(pc,flg));CHKERRQ(ierr); 40585317021SBarry Smith PetscFunctionReturn(0); 40685317021SBarry Smith } 40785317021SBarry Smith 40885317021SBarry Smith /*@ 40985317021SBarry Smith PCFactorReorderForNonzeroDiagonal - reorders rows/columns of matrix to remove zeros from diagonal 41085317021SBarry Smith 411ad4df100SBarry Smith Logically Collective on PC 41285317021SBarry Smith 41385317021SBarry Smith Input Parameters: 41485317021SBarry Smith + pc - the preconditioner context 41585317021SBarry Smith - tol - diagonal entries smaller than this in absolute value are considered zero 41685317021SBarry Smith 41785317021SBarry Smith Options Database Key: 41892e9c092SBarry Smith . -pc_factor_nonzeros_along_diagonal <tol> 41985317021SBarry Smith 42085317021SBarry Smith Level: intermediate 42185317021SBarry Smith 42285317021SBarry Smith .seealso: PCFactorSetFill(), PCFactorSetShiftNonzero(), PCFactorSetZeroPivot(), MatReorderForNonzeroDiagonal() 42385317021SBarry Smith @*/ 4247087cfbeSBarry Smith PetscErrorCode PCFactorReorderForNonzeroDiagonal(PC pc,PetscReal rtol) 42585317021SBarry Smith { 4264ac538c5SBarry Smith PetscErrorCode ierr; 42785317021SBarry Smith 42885317021SBarry Smith PetscFunctionBegin; 4290700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 430c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,rtol,2); 4314ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorReorderForNonzeroDiagonal_C",(PC,PetscReal),(pc,rtol));CHKERRQ(ierr); 43285317021SBarry Smith PetscFunctionReturn(0); 43385317021SBarry Smith } 43485317021SBarry Smith 435bf6011e8SBarry Smith /*@C 4363ca39a21SBarry Smith PCFactorSetMatSolverType - sets the software that is used to perform the factorization 43785317021SBarry Smith 438ad4df100SBarry Smith Logically Collective on PC 43985317021SBarry Smith 44085317021SBarry Smith Input Parameters: 44185317021SBarry Smith + pc - the preconditioner context 442f60c3dc2SHong Zhang - stype - for example, superlu, superlu_dist 44385317021SBarry Smith 44485317021SBarry Smith Options Database Key: 4453ca39a21SBarry Smith . -pc_factor_mat_solver_type <stype> - petsc, superlu, superlu_dist, mumps, cusparse 44685317021SBarry Smith 44785317021SBarry Smith Level: intermediate 44885317021SBarry Smith 44985317021SBarry Smith Note: 45085317021SBarry Smith By default this will use the PETSc factorization if it exists 45185317021SBarry Smith 4523ca39a21SBarry Smith .seealso: MatGetFactor(), MatSolverType, PCFactorGetMatSolverType() 45385317021SBarry Smith @*/ 454ea799195SBarry Smith PetscErrorCode PCFactorSetMatSolverType(PC pc,MatSolverType stype) 45585317021SBarry Smith { 4564ac538c5SBarry Smith PetscErrorCode ierr; 45785317021SBarry Smith 45885317021SBarry Smith PetscFunctionBegin; 4590700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 460ea799195SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetMatSolverType_C",(PC,MatSolverType),(pc,stype));CHKERRQ(ierr); 46185317021SBarry Smith PetscFunctionReturn(0); 46285317021SBarry Smith } 46385317021SBarry Smith 464bf6011e8SBarry Smith /*@C 4653ca39a21SBarry Smith PCFactorGetMatSolverType - gets the software that is used to perform the factorization 4667112b564SBarry Smith 467c5eb9154SBarry Smith Not Collective 4687112b564SBarry Smith 4697112b564SBarry Smith Input Parameter: 4707112b564SBarry Smith . pc - the preconditioner context 4717112b564SBarry Smith 4727112b564SBarry Smith Output Parameter: 4730298fd71SBarry Smith . stype - for example, superlu, superlu_dist (NULL if the PC does not have a solver package) 4747112b564SBarry Smith 4757112b564SBarry Smith Level: intermediate 4767112b564SBarry Smith 4773ca39a21SBarry Smith .seealso: MatGetFactor(), MatSolverType, PCFactorGetMatSolverType() 4787112b564SBarry Smith @*/ 479ea799195SBarry Smith PetscErrorCode PCFactorGetMatSolverType(PC pc,MatSolverType *stype) 4807112b564SBarry Smith { 481ea799195SBarry Smith PetscErrorCode ierr,(*f)(PC,MatSolverType*); 4827112b564SBarry Smith 4837112b564SBarry Smith PetscFunctionBegin; 4840700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 4853ca39a21SBarry Smith ierr = PetscObjectQueryFunction((PetscObject)pc,"PCFactorGetMatSolverType_C",&f);CHKERRQ(ierr); 4868b5c83b4SJed Brown if (f) { 4878b5c83b4SJed Brown ierr = (*f)(pc,stype);CHKERRQ(ierr); 4888b5c83b4SJed Brown } else { 4890298fd71SBarry Smith *stype = NULL; 4908b5c83b4SJed Brown } 4917112b564SBarry Smith PetscFunctionReturn(0); 4927112b564SBarry Smith } 4937112b564SBarry Smith 49485317021SBarry Smith /*@ 49585317021SBarry Smith PCFactorSetFill - Indicate the amount of fill you expect in the factored matrix, 49685317021SBarry Smith fill = number nonzeros in factor/number nonzeros in original matrix. 49785317021SBarry Smith 498c5eb9154SBarry Smith Not Collective, each process can expect a different amount of fill 49985317021SBarry Smith 50085317021SBarry Smith Input Parameters: 50185317021SBarry Smith + pc - the preconditioner context 50285317021SBarry Smith - fill - amount of expected fill 50385317021SBarry Smith 50485317021SBarry Smith Options Database Key: 50585317021SBarry Smith . -pc_factor_fill <fill> - Sets fill amount 50685317021SBarry Smith 50785317021SBarry Smith Level: intermediate 50885317021SBarry Smith 50985317021SBarry Smith Note: 51085317021SBarry Smith For sparse matrix factorizations it is difficult to predict how much 51185317021SBarry Smith fill to expect. By running with the option -info PETSc will print the 51285317021SBarry Smith actual amount of fill used; allowing you to set the value accurately for 51385317021SBarry Smith future runs. Default PETSc uses a value of 5.0 51485317021SBarry Smith 51501a79839SBarry Smith This parameter has NOTHING to do with the levels-of-fill of ILU(). That is set with PCFactorSetLevels() or -pc_factor_levels. 51601a79839SBarry Smith 51785317021SBarry Smith @*/ 5187087cfbeSBarry Smith PetscErrorCode PCFactorSetFill(PC pc,PetscReal fill) 51985317021SBarry Smith { 5204ac538c5SBarry Smith PetscErrorCode ierr; 52185317021SBarry Smith 52285317021SBarry Smith PetscFunctionBegin; 5230700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 524*2c71b3e2SJacob Faibussowitsch PetscCheckFalse(fill < 1.0,PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_OUTOFRANGE,"Fill factor cannot be less then 1.0"); 5254ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetFill_C",(PC,PetscReal),(pc,fill));CHKERRQ(ierr); 52685317021SBarry Smith PetscFunctionReturn(0); 52785317021SBarry Smith } 52885317021SBarry Smith 52985317021SBarry Smith /*@ 53085317021SBarry Smith PCFactorSetUseInPlace - Tells the system to do an in-place factorization. 53185317021SBarry Smith For dense matrices, this enables the solution of much larger problems. 53285317021SBarry Smith For sparse matrices the factorization cannot be done truly in-place 53385317021SBarry Smith so this does not save memory during the factorization, but after the matrix 53485317021SBarry Smith is factored, the original unfactored matrix is freed, thus recovering that 535ec5066bdSBarry Smith space. For ICC(0) and ILU(0) with the default natural ordering the factorization is done efficiently in-place. 53685317021SBarry Smith 537ad4df100SBarry Smith Logically Collective on PC 53885317021SBarry Smith 53985317021SBarry Smith Input Parameters: 5408e37d05fSBarry Smith + pc - the preconditioner context 5418e37d05fSBarry Smith - flg - PETSC_TRUE to enable, PETSC_FALSE to disable 54285317021SBarry Smith 54385317021SBarry Smith Options Database Key: 5448e37d05fSBarry Smith . -pc_factor_in_place <true,false>- Activate/deactivate in-place factorization 54585317021SBarry Smith 54685317021SBarry Smith Notes: 54785317021SBarry Smith PCFactorSetUseInplace() can only be used with the KSP method KSPPREONLY or when 54885317021SBarry Smith a different matrix is provided for the multiply and the preconditioner in 54985317021SBarry Smith a call to KSPSetOperators(). 55085317021SBarry Smith This is because the Krylov space methods require an application of the 55185317021SBarry Smith matrix multiplication, which is not possible here because the matrix has 55285317021SBarry Smith been factored in-place, replacing the original matrix. 55385317021SBarry Smith 55485317021SBarry Smith Level: intermediate 55585317021SBarry Smith 5568e37d05fSBarry Smith .seealso: PCFactorGetUseInPlace() 55785317021SBarry Smith @*/ 5588e37d05fSBarry Smith PetscErrorCode PCFactorSetUseInPlace(PC pc,PetscBool flg) 55985317021SBarry Smith { 5604ac538c5SBarry Smith PetscErrorCode ierr; 56185317021SBarry Smith 56285317021SBarry Smith PetscFunctionBegin; 5630700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 5648e37d05fSBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetUseInPlace_C",(PC,PetscBool),(pc,flg));CHKERRQ(ierr); 5658e37d05fSBarry Smith PetscFunctionReturn(0); 5668e37d05fSBarry Smith } 5678e37d05fSBarry Smith 5688e37d05fSBarry Smith /*@ 5698e37d05fSBarry Smith PCFactorGetUseInPlace - Determines if an in-place factorization is being used. 5708e37d05fSBarry Smith 5718e37d05fSBarry Smith Logically Collective on PC 5728e37d05fSBarry Smith 5738e37d05fSBarry Smith Input Parameter: 5748e37d05fSBarry Smith . pc - the preconditioner context 5758e37d05fSBarry Smith 5768e37d05fSBarry Smith Output Parameter: 5778e37d05fSBarry Smith . flg - PETSC_TRUE to enable, PETSC_FALSE to disable 5788e37d05fSBarry Smith 5798e37d05fSBarry Smith Level: intermediate 5808e37d05fSBarry Smith 5818e37d05fSBarry Smith .seealso: PCFactorSetUseInPlace() 5828e37d05fSBarry Smith @*/ 5838e37d05fSBarry Smith PetscErrorCode PCFactorGetUseInPlace(PC pc,PetscBool *flg) 5848e37d05fSBarry Smith { 5858e37d05fSBarry Smith PetscErrorCode ierr; 5868e37d05fSBarry Smith 5878e37d05fSBarry Smith PetscFunctionBegin; 5888e37d05fSBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 589c60c7ad4SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetUseInPlace_C",(PC,PetscBool*),(pc,flg));CHKERRQ(ierr); 59085317021SBarry Smith PetscFunctionReturn(0); 59185317021SBarry Smith } 59285317021SBarry Smith 59385317021SBarry Smith /*@C 59485317021SBarry Smith PCFactorSetMatOrderingType - Sets the ordering routine (to reduce fill) to 5952c7c0729SBarry Smith be used in the LU, ILU, Cholesky, and ICC factorizations. 59685317021SBarry Smith 597ad4df100SBarry Smith Logically Collective on PC 59885317021SBarry Smith 59985317021SBarry Smith Input Parameters: 60085317021SBarry Smith + pc - the preconditioner context 6012692d6eeSBarry Smith - ordering - the matrix ordering name, for example, MATORDERINGND or MATORDERINGRCM 60285317021SBarry Smith 60385317021SBarry Smith Options Database Key: 6042c7c0729SBarry Smith . -pc_factor_mat_ordering_type <nd,rcm,...,external> - Sets ordering routine 60585317021SBarry Smith 60685317021SBarry Smith Level: intermediate 60785317021SBarry Smith 60895452b02SPatrick Sanan Notes: 6094ac6704cSBarry Smith Nested dissection is used by default for some of PETSc's sparse matrix formats 61085317021SBarry Smith 6119bd791bbSBarry Smith For Cholesky and ICC and the SBAIJ format the only reordering available is natural since only the upper half of the matrix is stored 6129bd791bbSBarry Smith and reordering this matrix is very expensive. 6139bd791bbSBarry Smith 6144ac6704cSBarry Smith You can use a SeqAIJ matrix with Cholesky and ICC and use any ordering. 6159bd791bbSBarry Smith 6164ac6704cSBarry Smith MATORDERINGEXTERNAL means PETSc will not compute an ordering and the package will use its own ordering, usable with MATSOLVERCHOLMOD, MATSOLVERUMFPACK, and others. 6172c7c0729SBarry Smith 6189bd791bbSBarry Smith .seealso: MatOrderingType 61985317021SBarry Smith 62085317021SBarry Smith @*/ 62119fd82e9SBarry Smith PetscErrorCode PCFactorSetMatOrderingType(PC pc,MatOrderingType ordering) 62285317021SBarry Smith { 6234ac538c5SBarry Smith PetscErrorCode ierr; 62485317021SBarry Smith 62585317021SBarry Smith PetscFunctionBegin; 626c5eb9154SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 62719fd82e9SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetMatOrderingType_C",(PC,MatOrderingType),(pc,ordering));CHKERRQ(ierr); 62885317021SBarry Smith PetscFunctionReturn(0); 62985317021SBarry Smith } 63085317021SBarry Smith 63185317021SBarry Smith /*@ 6328ff23777SHong Zhang PCFactorSetColumnPivot - Determines when column pivoting is done during matrix factorization. 63385317021SBarry Smith For PETSc dense matrices column pivoting is always done, for PETSc sparse matrices 634e3c5b3baSBarry Smith it is never done. For the MATLAB and SuperLU factorization this is used. 63585317021SBarry Smith 636ad4df100SBarry Smith Logically Collective on PC 63785317021SBarry Smith 63885317021SBarry Smith Input Parameters: 63985317021SBarry Smith + pc - the preconditioner context 64085317021SBarry Smith - dtcol - 0.0 implies no pivoting, 1.0 complete pivoting (slower, requires more memory but more stable) 64185317021SBarry Smith 64285317021SBarry Smith Options Database Key: 64385317021SBarry Smith . -pc_factor_pivoting <dtcol> 64485317021SBarry Smith 64585317021SBarry Smith Level: intermediate 64685317021SBarry Smith 64785317021SBarry Smith .seealso: PCILUSetMatOrdering(), PCFactorSetPivotInBlocks() 64885317021SBarry Smith @*/ 6497087cfbeSBarry Smith PetscErrorCode PCFactorSetColumnPivot(PC pc,PetscReal dtcol) 65085317021SBarry Smith { 6514ac538c5SBarry Smith PetscErrorCode ierr; 65285317021SBarry Smith 65385317021SBarry Smith PetscFunctionBegin; 654c5eb9154SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 655c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,dtcol,2); 6564ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetColumnPivot_C",(PC,PetscReal),(pc,dtcol));CHKERRQ(ierr); 65785317021SBarry Smith PetscFunctionReturn(0); 65885317021SBarry Smith } 65985317021SBarry Smith 66085317021SBarry Smith /*@ 66185317021SBarry Smith PCFactorSetPivotInBlocks - Determines if pivoting is done while factoring each block 66285317021SBarry Smith with BAIJ or SBAIJ matrices 66385317021SBarry Smith 664ad4df100SBarry Smith Logically Collective on PC 66585317021SBarry Smith 66685317021SBarry Smith Input Parameters: 66785317021SBarry Smith + pc - the preconditioner context 66885317021SBarry Smith - pivot - PETSC_TRUE or PETSC_FALSE 66985317021SBarry Smith 67085317021SBarry Smith Options Database Key: 67185317021SBarry Smith . -pc_factor_pivot_in_blocks <true,false> 67285317021SBarry Smith 67385317021SBarry Smith Level: intermediate 67485317021SBarry Smith 6758ff23777SHong Zhang .seealso: PCILUSetMatOrdering(), PCFactorSetColumnPivot() 67685317021SBarry Smith @*/ 6777087cfbeSBarry Smith PetscErrorCode PCFactorSetPivotInBlocks(PC pc,PetscBool pivot) 67885317021SBarry Smith { 6794ac538c5SBarry Smith PetscErrorCode ierr; 68085317021SBarry Smith 68185317021SBarry Smith PetscFunctionBegin; 682c5eb9154SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 683acfcf0e5SJed Brown PetscValidLogicalCollectiveBool(pc,pivot,2); 6844ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetPivotInBlocks_C",(PC,PetscBool),(pc,pivot));CHKERRQ(ierr); 68585317021SBarry Smith PetscFunctionReturn(0); 68685317021SBarry Smith } 68785317021SBarry Smith 68885317021SBarry Smith /*@ 689288e7d53SBarry Smith PCFactorSetReuseFill - When matrices with different nonzero structure are factored, 69085317021SBarry Smith this causes later ones to use the fill ratio computed in the initial factorization. 69185317021SBarry Smith 692ad4df100SBarry Smith Logically Collective on PC 69385317021SBarry Smith 69485317021SBarry Smith Input Parameters: 69585317021SBarry Smith + pc - the preconditioner context 69685317021SBarry Smith - flag - PETSC_TRUE to reuse else PETSC_FALSE 69785317021SBarry Smith 69885317021SBarry Smith Options Database Key: 69985317021SBarry Smith . -pc_factor_reuse_fill - Activates PCFactorSetReuseFill() 70085317021SBarry Smith 70185317021SBarry Smith Level: intermediate 70285317021SBarry Smith 70385317021SBarry Smith .seealso: PCFactorSetReuseOrdering() 70485317021SBarry Smith @*/ 7057087cfbeSBarry Smith PetscErrorCode PCFactorSetReuseFill(PC pc,PetscBool flag) 70685317021SBarry Smith { 7074ac538c5SBarry Smith PetscErrorCode ierr; 70885317021SBarry Smith 70985317021SBarry Smith PetscFunctionBegin; 710064a246eSJacob Faibussowitsch PetscValidHeaderSpecific(pc,PC_CLASSID,1); 711acfcf0e5SJed Brown PetscValidLogicalCollectiveBool(pc,flag,2); 7124ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetReuseFill_C",(PC,PetscBool),(pc,flag));CHKERRQ(ierr); 71385317021SBarry Smith PetscFunctionReturn(0); 71485317021SBarry Smith } 7153d1c1ea0SBarry Smith 7164ac6704cSBarry Smith PetscErrorCode PCFactorInitialize(PC pc,MatFactorType ftype) 7173d1c1ea0SBarry Smith { 7183d1c1ea0SBarry Smith PetscErrorCode ierr; 7193d1c1ea0SBarry Smith PC_Factor *fact = (PC_Factor*)pc->data; 7203d1c1ea0SBarry Smith 7213d1c1ea0SBarry Smith PetscFunctionBegin; 7223d1c1ea0SBarry Smith ierr = MatFactorInfoInitialize(&fact->info);CHKERRQ(ierr); 7234ac6704cSBarry Smith fact->factortype = ftype; 7243d1c1ea0SBarry Smith fact->info.shifttype = (PetscReal)MAT_SHIFT_NONE; 7253d1c1ea0SBarry Smith fact->info.shiftamount = 100.0*PETSC_MACHINE_EPSILON; 7263d1c1ea0SBarry Smith fact->info.zeropivot = 100.0*PETSC_MACHINE_EPSILON; 7273d1c1ea0SBarry Smith fact->info.pivotinblocks = 1.0; 7283d1c1ea0SBarry Smith pc->ops->getfactoredmatrix = PCFactorGetMatrix_Factor; 7293d1c1ea0SBarry Smith 7303d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetZeroPivot_C",PCFactorSetZeroPivot_Factor);CHKERRQ(ierr); 7313d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetZeroPivot_C",PCFactorGetZeroPivot_Factor);CHKERRQ(ierr); 7323d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetShiftType_C",PCFactorSetShiftType_Factor);CHKERRQ(ierr); 7333d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetShiftType_C",PCFactorGetShiftType_Factor);CHKERRQ(ierr); 7343d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetShiftAmount_C",PCFactorSetShiftAmount_Factor);CHKERRQ(ierr); 7353d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetShiftAmount_C",PCFactorGetShiftAmount_Factor);CHKERRQ(ierr); 7363ca39a21SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetMatSolverType_C",PCFactorGetMatSolverType_Factor);CHKERRQ(ierr); 7373ca39a21SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetMatSolverType_C",PCFactorSetMatSolverType_Factor);CHKERRQ(ierr); 7383ca39a21SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetUpMatSolverType_C",PCFactorSetUpMatSolverType_Factor);CHKERRQ(ierr); 7393d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetFill_C",PCFactorSetFill_Factor);CHKERRQ(ierr); 7403d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetMatOrderingType_C",PCFactorSetMatOrderingType_Factor);CHKERRQ(ierr); 7413d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetLevels_C",PCFactorSetLevels_Factor);CHKERRQ(ierr); 7423d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetLevels_C",PCFactorGetLevels_Factor);CHKERRQ(ierr); 7433d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetAllowDiagonalFill_C",PCFactorSetAllowDiagonalFill_Factor);CHKERRQ(ierr); 7443d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetAllowDiagonalFill_C",PCFactorGetAllowDiagonalFill_Factor);CHKERRQ(ierr); 7453d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetPivotInBlocks_C",PCFactorSetPivotInBlocks_Factor);CHKERRQ(ierr); 7463d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetUseInPlace_C",PCFactorSetUseInPlace_Factor);CHKERRQ(ierr); 7473d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetUseInPlace_C",PCFactorGetUseInPlace_Factor);CHKERRQ(ierr); 7483d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetReuseOrdering_C",PCFactorSetReuseOrdering_Factor);CHKERRQ(ierr); 7493d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetReuseFill_C",PCFactorSetReuseFill_Factor);CHKERRQ(ierr); 7503d1c1ea0SBarry Smith PetscFunctionReturn(0); 7513d1c1ea0SBarry Smith } 752