15e8efad8SHong Zhang 2c6db04a5SJed Brown #include <../src/ksp/pc/impls/factor/factor.h> /*I "petscpc.h" I*/ 35e8efad8SHong Zhang 43d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetReuseOrdering_Factor(PC pc,PetscBool flag) 53d1c1ea0SBarry Smith { 63d1c1ea0SBarry Smith PC_Factor *lu = (PC_Factor*)pc->data; 73d1c1ea0SBarry Smith 83d1c1ea0SBarry Smith PetscFunctionBegin; 93d1c1ea0SBarry Smith lu->reuseordering = flag; 103d1c1ea0SBarry Smith PetscFunctionReturn(0); 113d1c1ea0SBarry Smith } 123d1c1ea0SBarry Smith 133d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetReuseFill_Factor(PC pc,PetscBool flag) 143d1c1ea0SBarry Smith { 153d1c1ea0SBarry Smith PC_Factor *lu = (PC_Factor*)pc->data; 163d1c1ea0SBarry Smith 173d1c1ea0SBarry Smith PetscFunctionBegin; 183d1c1ea0SBarry Smith lu->reusefill = flag; 193d1c1ea0SBarry Smith PetscFunctionReturn(0); 203d1c1ea0SBarry Smith } 213d1c1ea0SBarry Smith 223d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetUseInPlace_Factor(PC pc,PetscBool flg) 233d1c1ea0SBarry Smith { 243d1c1ea0SBarry Smith PC_Factor *dir = (PC_Factor*)pc->data; 253d1c1ea0SBarry Smith 263d1c1ea0SBarry Smith PetscFunctionBegin; 273d1c1ea0SBarry Smith dir->inplace = flg; 283d1c1ea0SBarry Smith PetscFunctionReturn(0); 293d1c1ea0SBarry Smith } 303d1c1ea0SBarry Smith 313d1c1ea0SBarry Smith static PetscErrorCode PCFactorGetUseInPlace_Factor(PC pc,PetscBool *flg) 323d1c1ea0SBarry Smith { 333d1c1ea0SBarry Smith PC_Factor *dir = (PC_Factor*)pc->data; 343d1c1ea0SBarry Smith 353d1c1ea0SBarry Smith PetscFunctionBegin; 363d1c1ea0SBarry Smith *flg = dir->inplace; 373d1c1ea0SBarry Smith PetscFunctionReturn(0); 383d1c1ea0SBarry Smith } 393d1c1ea0SBarry Smith 40f8260c8fSBarry Smith /*@ 413ca39a21SBarry Smith PCFactorSetUpMatSolverType - Can be called after KSPSetOperators() or PCSetOperators(), causes MatGetFactor() to be called so then one may 42f8260c8fSBarry Smith set the options for that particular factorization object. 43f8260c8fSBarry Smith 44f8260c8fSBarry Smith Input Parameter: 45f8260c8fSBarry Smith . pc - the preconditioner context 46f8260c8fSBarry Smith 4795452b02SPatrick Sanan Notes: 4895452b02SPatrick 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. 49f8260c8fSBarry Smith 502bd2b0e6SSatish Balay Level: intermediate 512bd2b0e6SSatish Balay 526d33885cSprj- .seealso: PCFactorSetMatSolverType(), PCFactorGetMatrix() 53f8260c8fSBarry Smith @*/ 543ca39a21SBarry Smith PetscErrorCode PCFactorSetUpMatSolverType(PC pc) 55f8260c8fSBarry Smith { 56f8260c8fSBarry Smith PetscErrorCode ierr; 57f8260c8fSBarry Smith 58f8260c8fSBarry Smith PetscFunctionBegin; 59f8260c8fSBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 603ca39a21SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetUpMatSolverType_C",(PC),(pc));CHKERRQ(ierr); 61b3a44c85SBarry Smith PetscFunctionReturn(0); 62f8260c8fSBarry Smith } 63f8260c8fSBarry Smith 64ee45ca4aSHong Zhang /*@ 65ee45ca4aSHong Zhang PCFactorSetZeroPivot - Sets the size at which smaller pivots are declared to be zero 66ee45ca4aSHong Zhang 67ad4df100SBarry Smith Logically Collective on PC 68ee45ca4aSHong Zhang 69ee45ca4aSHong Zhang Input Parameters: 70afaefe49SHong Zhang + pc - the preconditioner context 71afaefe49SHong Zhang - zero - all pivots smaller than this will be considered zero 72ee45ca4aSHong Zhang 73ee45ca4aSHong Zhang Options Database Key: 74ee45ca4aSHong Zhang . -pc_factor_zeropivot <zero> - Sets tolerance for what is considered a zero pivot 75ee45ca4aSHong Zhang 76ee45ca4aSHong Zhang Level: intermediate 77ee45ca4aSHong Zhang 78daa17b54SHong Zhang .seealso: PCFactorSetShiftType(), PCFactorSetShiftAmount() 79ee45ca4aSHong Zhang @*/ 807087cfbeSBarry Smith PetscErrorCode PCFactorSetZeroPivot(PC pc,PetscReal zero) 81ee45ca4aSHong Zhang { 824ac538c5SBarry Smith PetscErrorCode ierr; 83afaefe49SHong Zhang 84ee45ca4aSHong Zhang PetscFunctionBegin; 850700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 86c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,zero,2); 874ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetZeroPivot_C",(PC,PetscReal),(pc,zero));CHKERRQ(ierr); 88ee45ca4aSHong Zhang PetscFunctionReturn(0); 89ee45ca4aSHong Zhang } 90ee45ca4aSHong Zhang 91915743fcSHong Zhang /*@ 92915743fcSHong Zhang PCFactorSetShiftType - adds a particular type of quantity to the diagonal of the matrix during 93915743fcSHong Zhang numerical factorization, thus the matrix has nonzero pivots 94915743fcSHong Zhang 95ad4df100SBarry Smith Logically Collective on PC 96915743fcSHong Zhang 97915743fcSHong Zhang Input Parameters: 98915743fcSHong Zhang + pc - the preconditioner context 99915743fcSHong Zhang - shifttype - type of shift; one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO, MAT_SHIFT_POSITIVE_DEFINITE, MAT_SHIFT_INBLOCKS 100915743fcSHong Zhang 101915743fcSHong Zhang Options Database Key: 10228d58a37SPierre Jolivet . -pc_factor_shift_type <shifttype> - Sets shift type; use '-help' for a list of available types 103915743fcSHong Zhang 104915743fcSHong Zhang Level: intermediate 105915743fcSHong Zhang 106915743fcSHong Zhang .seealso: PCFactorSetZeroPivot(), PCFactorSetShiftAmount() 107915743fcSHong Zhang @*/ 1087087cfbeSBarry Smith PetscErrorCode PCFactorSetShiftType(PC pc,MatFactorShiftType shifttype) 109d90ac83dSHong Zhang { 1104ac538c5SBarry Smith PetscErrorCode ierr; 111d90ac83dSHong Zhang 112d90ac83dSHong Zhang PetscFunctionBegin; 1130700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 114c5eb9154SBarry Smith PetscValidLogicalCollectiveEnum(pc,shifttype,2); 1154ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetShiftType_C",(PC,MatFactorShiftType),(pc,shifttype));CHKERRQ(ierr); 116d90ac83dSHong Zhang PetscFunctionReturn(0); 117d90ac83dSHong Zhang } 118d90ac83dSHong Zhang 119915743fcSHong Zhang /*@ 120915743fcSHong Zhang PCFactorSetShiftAmount - adds a quantity to the diagonal of the matrix during 121915743fcSHong Zhang numerical factorization, thus the matrix has nonzero pivots 122915743fcSHong Zhang 123ad4df100SBarry Smith Logically Collective on PC 124915743fcSHong Zhang 125915743fcSHong Zhang Input Parameters: 126915743fcSHong Zhang + pc - the preconditioner context 127915743fcSHong Zhang - shiftamount - amount of shift 128915743fcSHong Zhang 129915743fcSHong Zhang Options Database Key: 130915743fcSHong Zhang . -pc_factor_shift_amount <shiftamount> - Sets shift amount or PETSC_DECIDE for the default 131915743fcSHong Zhang 132915743fcSHong Zhang Level: intermediate 133915743fcSHong Zhang 134915743fcSHong Zhang .seealso: PCFactorSetZeroPivot(), PCFactorSetShiftType() 135915743fcSHong Zhang @*/ 1367087cfbeSBarry Smith PetscErrorCode PCFactorSetShiftAmount(PC pc,PetscReal shiftamount) 137d90ac83dSHong Zhang { 1384ac538c5SBarry Smith PetscErrorCode ierr; 139d90ac83dSHong Zhang 140d90ac83dSHong Zhang PetscFunctionBegin; 1410700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 142c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,shiftamount,2); 1434ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetShiftAmount_C",(PC,PetscReal),(pc,shiftamount));CHKERRQ(ierr); 144d90ac83dSHong Zhang PetscFunctionReturn(0); 145d90ac83dSHong Zhang } 146d90ac83dSHong Zhang 1476d33885cSprj- /*@ 148b7c853c4SBarry Smith PCFactorSetDropTolerance - The preconditioner will use an ILU 14978fc6b22SHong Zhang based on a drop tolerance. (Under development) 15085317021SBarry Smith 151ad4df100SBarry Smith Logically Collective on PC 15285317021SBarry Smith 15385317021SBarry Smith Input Parameters: 15485317021SBarry Smith + pc - the preconditioner context 15585317021SBarry Smith . dt - the drop tolerance, try from 1.e-10 to .1 15685317021SBarry Smith . dtcol - tolerance for column pivot, good values [0.1 to 0.01] 15785317021SBarry Smith - maxrowcount - the max number of nonzeros allowed in a row, best value 15885317021SBarry Smith depends on the number of nonzeros in row of original matrix 15985317021SBarry Smith 16085317021SBarry Smith Options Database Key: 161b7c853c4SBarry Smith . -pc_factor_drop_tolerance <dt,dtcol,maxrowcount> - Sets drop tolerance 16285317021SBarry Smith 16385317021SBarry Smith Level: intermediate 16485317021SBarry Smith 16585317021SBarry Smith There are NO default values for the 3 parameters, you must set them with reasonable values for your 16685317021SBarry Smith matrix. We don't know how to compute reasonable values. 16785317021SBarry Smith 1686d33885cSprj- @*/ 1697087cfbeSBarry Smith PetscErrorCode PCFactorSetDropTolerance(PC pc,PetscReal dt,PetscReal dtcol,PetscInt maxrowcount) 17085317021SBarry Smith { 1714ac538c5SBarry Smith PetscErrorCode ierr; 17285317021SBarry Smith 17385317021SBarry Smith PetscFunctionBegin; 1740700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 175c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,dtcol,2); 176c5eb9154SBarry Smith PetscValidLogicalCollectiveInt(pc,maxrowcount,3); 1774ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetDropTolerance_C",(PC,PetscReal,PetscReal,PetscInt),(pc,dt,dtcol,maxrowcount));CHKERRQ(ierr); 17885317021SBarry Smith PetscFunctionReturn(0); 17985317021SBarry Smith } 18085317021SBarry Smith 181c7f610a1SBarry Smith /*@ 182c7f610a1SBarry Smith PCFactorGetZeroPivot - Gets the tolerance used to define a zero privot 183c7f610a1SBarry Smith 184c7f610a1SBarry Smith Not Collective 185c7f610a1SBarry Smith 186c7f610a1SBarry Smith Input Parameters: 187c7f610a1SBarry Smith . pc - the preconditioner context 188c7f610a1SBarry Smith 189c7f610a1SBarry Smith Output Parameter: 190c7f610a1SBarry Smith . pivot - the tolerance 191c7f610a1SBarry Smith 192c7f610a1SBarry Smith Level: intermediate 193c7f610a1SBarry Smith 194c7f610a1SBarry Smith .seealso: PCFactorSetZeroPivot() 195c7f610a1SBarry Smith @*/ 196c7f610a1SBarry Smith PetscErrorCode PCFactorGetZeroPivot(PC pc,PetscReal *pivot) 197c7f610a1SBarry Smith { 198c7f610a1SBarry Smith PetscErrorCode ierr; 199c7f610a1SBarry Smith 200c7f610a1SBarry Smith PetscFunctionBegin; 201c7f610a1SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 202c7f610a1SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetZeroPivot_C",(PC,PetscReal*),(pc,pivot));CHKERRQ(ierr); 203c7f610a1SBarry Smith PetscFunctionReturn(0); 204c7f610a1SBarry Smith } 205c7f610a1SBarry Smith 206c7f610a1SBarry Smith /*@ 207c7f610a1SBarry Smith PCFactorGetShiftAmount - Gets the tolerance used to define a zero privot 208c7f610a1SBarry Smith 209c7f610a1SBarry Smith Not Collective 210c7f610a1SBarry Smith 211c7f610a1SBarry Smith Input Parameters: 212c7f610a1SBarry Smith . pc - the preconditioner context 213c7f610a1SBarry Smith 214c7f610a1SBarry Smith Output Parameter: 215c7f610a1SBarry Smith . shift - how much to shift the diagonal entry 216c7f610a1SBarry Smith 217c7f610a1SBarry Smith Level: intermediate 218c7f610a1SBarry Smith 219c7f610a1SBarry Smith .seealso: PCFactorSetShiftAmount(), PCFactorSetShiftType(), PCFactorGetShiftType() 220c7f610a1SBarry Smith @*/ 221c7f610a1SBarry Smith PetscErrorCode PCFactorGetShiftAmount(PC pc,PetscReal *shift) 222c7f610a1SBarry Smith { 223c7f610a1SBarry Smith PetscErrorCode ierr; 224c7f610a1SBarry Smith 225c7f610a1SBarry Smith PetscFunctionBegin; 226c7f610a1SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 227c7f610a1SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetShiftAmount_C",(PC,PetscReal*),(pc,shift));CHKERRQ(ierr); 228c7f610a1SBarry Smith PetscFunctionReturn(0); 229c7f610a1SBarry Smith } 230c7f610a1SBarry Smith 231c7f610a1SBarry Smith /*@ 232c7f610a1SBarry Smith PCFactorGetShiftType - Gets the type of shift, if any, done when a zero pivot is detected 233c7f610a1SBarry Smith 234c7f610a1SBarry Smith Not Collective 235c7f610a1SBarry Smith 236c7f610a1SBarry Smith Input Parameters: 237c7f610a1SBarry Smith . pc - the preconditioner context 238c7f610a1SBarry Smith 239c7f610a1SBarry Smith Output Parameter: 240c7f610a1SBarry Smith . type - one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO, MAT_SHIFT_POSITIVE_DEFINITE, or MAT_SHIFT_INBLOCKS 241c7f610a1SBarry Smith 242c7f610a1SBarry Smith Level: intermediate 243c7f610a1SBarry Smith 244c7f610a1SBarry Smith .seealso: PCFactorSetShiftType(), MatFactorShiftType, PCFactorSetShiftAmount(), PCFactorGetShiftAmount() 245c7f610a1SBarry Smith @*/ 246c7f610a1SBarry Smith PetscErrorCode PCFactorGetShiftType(PC pc,MatFactorShiftType *type) 247c7f610a1SBarry Smith { 248c7f610a1SBarry Smith PetscErrorCode ierr; 249c7f610a1SBarry Smith 250c7f610a1SBarry Smith PetscFunctionBegin; 251c7f610a1SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 252c7f610a1SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetShiftType_C",(PC,MatFactorShiftType*),(pc,type));CHKERRQ(ierr); 253c7f610a1SBarry Smith PetscFunctionReturn(0); 254c7f610a1SBarry Smith } 255c7f610a1SBarry Smith 2562591b318SToby Isaac /*@ 2572591b318SToby Isaac PCFactorGetLevels - Gets the number of levels of fill to use. 2582591b318SToby Isaac 2592591b318SToby Isaac Logically Collective on PC 2602591b318SToby Isaac 2612591b318SToby Isaac Input Parameters: 2622591b318SToby Isaac . pc - the preconditioner context 2632591b318SToby Isaac 2642591b318SToby Isaac Output Parameter: 2652591b318SToby Isaac . levels - number of levels of fill 2662591b318SToby Isaac 2672591b318SToby Isaac Level: intermediate 2682591b318SToby Isaac 2692591b318SToby Isaac @*/ 2702591b318SToby Isaac PetscErrorCode PCFactorGetLevels(PC pc,PetscInt *levels) 2712591b318SToby Isaac { 2722591b318SToby Isaac PetscErrorCode ierr; 2732591b318SToby Isaac 2742591b318SToby Isaac PetscFunctionBegin; 2752591b318SToby Isaac PetscValidHeaderSpecific(pc,PC_CLASSID,1); 276c60c7ad4SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetLevels_C",(PC,PetscInt*),(pc,levels));CHKERRQ(ierr); 2772591b318SToby Isaac PetscFunctionReturn(0); 2782591b318SToby Isaac } 2792591b318SToby Isaac 28085317021SBarry Smith /*@ 28185317021SBarry Smith PCFactorSetLevels - Sets the number of levels of fill to use. 28285317021SBarry Smith 283ad4df100SBarry Smith Logically Collective on PC 28485317021SBarry Smith 28585317021SBarry Smith Input Parameters: 28685317021SBarry Smith + pc - the preconditioner context 28785317021SBarry Smith - levels - number of levels of fill 28885317021SBarry Smith 28985317021SBarry Smith Options Database Key: 29085317021SBarry Smith . -pc_factor_levels <levels> - Sets fill level 29185317021SBarry Smith 29285317021SBarry Smith Level: intermediate 29385317021SBarry Smith 29485317021SBarry Smith @*/ 2957087cfbeSBarry Smith PetscErrorCode PCFactorSetLevels(PC pc,PetscInt levels) 29685317021SBarry Smith { 2974ac538c5SBarry Smith PetscErrorCode ierr; 29885317021SBarry Smith 29985317021SBarry Smith PetscFunctionBegin; 3000700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 301ce94432eSBarry Smith if (levels < 0) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_OUTOFRANGE,"negative levels"); 302c5eb9154SBarry Smith PetscValidLogicalCollectiveInt(pc,levels,2); 3034ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetLevels_C",(PC,PetscInt),(pc,levels));CHKERRQ(ierr); 30485317021SBarry Smith PetscFunctionReturn(0); 30585317021SBarry Smith } 30685317021SBarry Smith 30785317021SBarry Smith /*@ 30885317021SBarry Smith PCFactorSetAllowDiagonalFill - Causes all diagonal matrix entries to be 30985317021SBarry Smith treated as level 0 fill even if there is no non-zero location. 31085317021SBarry Smith 311ad4df100SBarry Smith Logically Collective on PC 31285317021SBarry Smith 31385317021SBarry Smith Input Parameters: 31485317021SBarry Smith + pc - the preconditioner context 31592e9c092SBarry Smith - flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off 31685317021SBarry Smith 31785317021SBarry Smith Options Database Key: 31885317021SBarry Smith . -pc_factor_diagonal_fill 31985317021SBarry Smith 32085317021SBarry Smith Notes: 32185317021SBarry Smith Does not apply with 0 fill. 32285317021SBarry Smith 32385317021SBarry Smith Level: intermediate 32485317021SBarry Smith 32592e9c092SBarry Smith .seealso: PCFactorGetAllowDiagonalFill() 32685317021SBarry Smith @*/ 32792e9c092SBarry Smith PetscErrorCode PCFactorSetAllowDiagonalFill(PC pc,PetscBool flg) 32885317021SBarry Smith { 3294ac538c5SBarry Smith PetscErrorCode ierr; 33085317021SBarry Smith 33185317021SBarry Smith PetscFunctionBegin; 3320700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 33392e9c092SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetAllowDiagonalFill_C",(PC,PetscBool),(pc,flg));CHKERRQ(ierr); 33492e9c092SBarry Smith PetscFunctionReturn(0); 33592e9c092SBarry Smith } 33692e9c092SBarry Smith 33792e9c092SBarry Smith /*@ 33892e9c092SBarry Smith PCFactorGetAllowDiagonalFill - Determines if all diagonal matrix entries are 33992e9c092SBarry Smith treated as level 0 fill even if there is no non-zero location. 34092e9c092SBarry Smith 34192e9c092SBarry Smith Logically Collective on PC 34292e9c092SBarry Smith 34392e9c092SBarry Smith Input Parameter: 34492e9c092SBarry Smith . pc - the preconditioner context 34592e9c092SBarry Smith 34692e9c092SBarry Smith Output Parameter: 34792e9c092SBarry Smith . flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off 34892e9c092SBarry Smith 34992e9c092SBarry Smith Options Database Key: 35092e9c092SBarry Smith . -pc_factor_diagonal_fill 35192e9c092SBarry Smith 35292e9c092SBarry Smith Notes: 35392e9c092SBarry Smith Does not apply with 0 fill. 35492e9c092SBarry Smith 35592e9c092SBarry Smith Level: intermediate 35692e9c092SBarry Smith 35792e9c092SBarry Smith .seealso: PCFactorSetAllowDiagonalFill() 35892e9c092SBarry Smith @*/ 35992e9c092SBarry Smith PetscErrorCode PCFactorGetAllowDiagonalFill(PC pc,PetscBool *flg) 36092e9c092SBarry Smith { 36192e9c092SBarry Smith PetscErrorCode ierr; 36292e9c092SBarry Smith 36392e9c092SBarry Smith PetscFunctionBegin; 36492e9c092SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 365c60c7ad4SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetAllowDiagonalFill_C",(PC,PetscBool*),(pc,flg));CHKERRQ(ierr); 36685317021SBarry Smith PetscFunctionReturn(0); 36785317021SBarry Smith } 36885317021SBarry Smith 36985317021SBarry Smith /*@ 37085317021SBarry Smith PCFactorReorderForNonzeroDiagonal - reorders rows/columns of matrix to remove zeros from diagonal 37185317021SBarry Smith 372ad4df100SBarry Smith Logically Collective on PC 37385317021SBarry Smith 37485317021SBarry Smith Input Parameters: 37585317021SBarry Smith + pc - the preconditioner context 37685317021SBarry Smith - tol - diagonal entries smaller than this in absolute value are considered zero 37785317021SBarry Smith 37885317021SBarry Smith Options Database Key: 37992e9c092SBarry Smith . -pc_factor_nonzeros_along_diagonal <tol> 38085317021SBarry Smith 38185317021SBarry Smith Level: intermediate 38285317021SBarry Smith 38385317021SBarry Smith .seealso: PCFactorSetFill(), PCFactorSetShiftNonzero(), PCFactorSetZeroPivot(), MatReorderForNonzeroDiagonal() 38485317021SBarry Smith @*/ 3857087cfbeSBarry Smith PetscErrorCode PCFactorReorderForNonzeroDiagonal(PC pc,PetscReal rtol) 38685317021SBarry Smith { 3874ac538c5SBarry Smith PetscErrorCode ierr; 38885317021SBarry Smith 38985317021SBarry Smith PetscFunctionBegin; 3900700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 391c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,rtol,2); 3924ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorReorderForNonzeroDiagonal_C",(PC,PetscReal),(pc,rtol));CHKERRQ(ierr); 39385317021SBarry Smith PetscFunctionReturn(0); 39485317021SBarry Smith } 39585317021SBarry Smith 396bf6011e8SBarry Smith /*@C 3973ca39a21SBarry Smith PCFactorSetMatSolverType - sets the software that is used to perform the factorization 39885317021SBarry Smith 399ad4df100SBarry Smith Logically Collective on PC 40085317021SBarry Smith 40185317021SBarry Smith Input Parameters: 40285317021SBarry Smith + pc - the preconditioner context 403f60c3dc2SHong Zhang - stype - for example, superlu, superlu_dist 40485317021SBarry Smith 40585317021SBarry Smith Options Database Key: 4063ca39a21SBarry Smith . -pc_factor_mat_solver_type <stype> - petsc, superlu, superlu_dist, mumps, cusparse 40785317021SBarry Smith 40885317021SBarry Smith Level: intermediate 40985317021SBarry Smith 41085317021SBarry Smith Note: 41185317021SBarry Smith By default this will use the PETSc factorization if it exists 41285317021SBarry Smith 4133ca39a21SBarry Smith .seealso: MatGetFactor(), MatSolverType, PCFactorGetMatSolverType() 41485317021SBarry Smith @*/ 415ea799195SBarry Smith PetscErrorCode PCFactorSetMatSolverType(PC pc,MatSolverType stype) 41685317021SBarry Smith { 4174ac538c5SBarry Smith PetscErrorCode ierr; 41885317021SBarry Smith 41985317021SBarry Smith PetscFunctionBegin; 4200700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 421ea799195SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetMatSolverType_C",(PC,MatSolverType),(pc,stype));CHKERRQ(ierr); 42285317021SBarry Smith PetscFunctionReturn(0); 42385317021SBarry Smith } 42485317021SBarry Smith 425bf6011e8SBarry Smith /*@C 4263ca39a21SBarry Smith PCFactorGetMatSolverType - gets the software that is used to perform the factorization 4277112b564SBarry Smith 428c5eb9154SBarry Smith Not Collective 4297112b564SBarry Smith 4307112b564SBarry Smith Input Parameter: 4317112b564SBarry Smith . pc - the preconditioner context 4327112b564SBarry Smith 4337112b564SBarry Smith Output Parameter: 4340298fd71SBarry Smith . stype - for example, superlu, superlu_dist (NULL if the PC does not have a solver package) 4357112b564SBarry Smith 4367112b564SBarry Smith Level: intermediate 4377112b564SBarry Smith 4383ca39a21SBarry Smith .seealso: MatGetFactor(), MatSolverType, PCFactorGetMatSolverType() 4397112b564SBarry Smith @*/ 440ea799195SBarry Smith PetscErrorCode PCFactorGetMatSolverType(PC pc,MatSolverType *stype) 4417112b564SBarry Smith { 442ea799195SBarry Smith PetscErrorCode ierr,(*f)(PC,MatSolverType*); 4437112b564SBarry Smith 4447112b564SBarry Smith PetscFunctionBegin; 4450700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 4463ca39a21SBarry Smith ierr = PetscObjectQueryFunction((PetscObject)pc,"PCFactorGetMatSolverType_C",&f);CHKERRQ(ierr); 4478b5c83b4SJed Brown if (f) { 4488b5c83b4SJed Brown ierr = (*f)(pc,stype);CHKERRQ(ierr); 4498b5c83b4SJed Brown } else { 4500298fd71SBarry Smith *stype = NULL; 4518b5c83b4SJed Brown } 4527112b564SBarry Smith PetscFunctionReturn(0); 4537112b564SBarry Smith } 4547112b564SBarry Smith 45585317021SBarry Smith /*@ 45685317021SBarry Smith PCFactorSetFill - Indicate the amount of fill you expect in the factored matrix, 45785317021SBarry Smith fill = number nonzeros in factor/number nonzeros in original matrix. 45885317021SBarry Smith 459c5eb9154SBarry Smith Not Collective, each process can expect a different amount of fill 46085317021SBarry Smith 46185317021SBarry Smith Input Parameters: 46285317021SBarry Smith + pc - the preconditioner context 46385317021SBarry Smith - fill - amount of expected fill 46485317021SBarry Smith 46585317021SBarry Smith Options Database Key: 46685317021SBarry Smith . -pc_factor_fill <fill> - Sets fill amount 46785317021SBarry Smith 46885317021SBarry Smith Level: intermediate 46985317021SBarry Smith 47085317021SBarry Smith Note: 47185317021SBarry Smith For sparse matrix factorizations it is difficult to predict how much 47285317021SBarry Smith fill to expect. By running with the option -info PETSc will print the 47385317021SBarry Smith actual amount of fill used; allowing you to set the value accurately for 47485317021SBarry Smith future runs. Default PETSc uses a value of 5.0 47585317021SBarry Smith 47601a79839SBarry Smith This parameter has NOTHING to do with the levels-of-fill of ILU(). That is set with PCFactorSetLevels() or -pc_factor_levels. 47701a79839SBarry Smith 47885317021SBarry Smith @*/ 4797087cfbeSBarry Smith PetscErrorCode PCFactorSetFill(PC pc,PetscReal fill) 48085317021SBarry Smith { 4814ac538c5SBarry Smith PetscErrorCode ierr; 48285317021SBarry Smith 48385317021SBarry Smith PetscFunctionBegin; 4840700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 485ce94432eSBarry Smith if (fill < 1.0) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_OUTOFRANGE,"Fill factor cannot be less then 1.0"); 4864ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetFill_C",(PC,PetscReal),(pc,fill));CHKERRQ(ierr); 48785317021SBarry Smith PetscFunctionReturn(0); 48885317021SBarry Smith } 48985317021SBarry Smith 49085317021SBarry Smith /*@ 49185317021SBarry Smith PCFactorSetUseInPlace - Tells the system to do an in-place factorization. 49285317021SBarry Smith For dense matrices, this enables the solution of much larger problems. 49385317021SBarry Smith For sparse matrices the factorization cannot be done truly in-place 49485317021SBarry Smith so this does not save memory during the factorization, but after the matrix 49585317021SBarry Smith is factored, the original unfactored matrix is freed, thus recovering that 496ec5066bdSBarry Smith space. For ICC(0) and ILU(0) with the default natural ordering the factorization is done efficiently in-place. 49785317021SBarry Smith 498ad4df100SBarry Smith Logically Collective on PC 49985317021SBarry Smith 50085317021SBarry Smith Input Parameters: 5018e37d05fSBarry Smith + pc - the preconditioner context 5028e37d05fSBarry Smith - flg - PETSC_TRUE to enable, PETSC_FALSE to disable 50385317021SBarry Smith 50485317021SBarry Smith Options Database Key: 5058e37d05fSBarry Smith . -pc_factor_in_place <true,false>- Activate/deactivate in-place factorization 50685317021SBarry Smith 50785317021SBarry Smith Notes: 50885317021SBarry Smith PCFactorSetUseInplace() can only be used with the KSP method KSPPREONLY or when 50985317021SBarry Smith a different matrix is provided for the multiply and the preconditioner in 51085317021SBarry Smith a call to KSPSetOperators(). 51185317021SBarry Smith This is because the Krylov space methods require an application of the 51285317021SBarry Smith matrix multiplication, which is not possible here because the matrix has 51385317021SBarry Smith been factored in-place, replacing the original matrix. 51485317021SBarry Smith 51585317021SBarry Smith Level: intermediate 51685317021SBarry Smith 5178e37d05fSBarry Smith .seealso: PCFactorGetUseInPlace() 51885317021SBarry Smith @*/ 5198e37d05fSBarry Smith PetscErrorCode PCFactorSetUseInPlace(PC pc,PetscBool flg) 52085317021SBarry Smith { 5214ac538c5SBarry Smith PetscErrorCode ierr; 52285317021SBarry Smith 52385317021SBarry Smith PetscFunctionBegin; 5240700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 5258e37d05fSBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetUseInPlace_C",(PC,PetscBool),(pc,flg));CHKERRQ(ierr); 5268e37d05fSBarry Smith PetscFunctionReturn(0); 5278e37d05fSBarry Smith } 5288e37d05fSBarry Smith 5298e37d05fSBarry Smith /*@ 5308e37d05fSBarry Smith PCFactorGetUseInPlace - Determines if an in-place factorization is being used. 5318e37d05fSBarry Smith 5328e37d05fSBarry Smith Logically Collective on PC 5338e37d05fSBarry Smith 5348e37d05fSBarry Smith Input Parameter: 5358e37d05fSBarry Smith . pc - the preconditioner context 5368e37d05fSBarry Smith 5378e37d05fSBarry Smith Output Parameter: 5388e37d05fSBarry Smith . flg - PETSC_TRUE to enable, PETSC_FALSE to disable 5398e37d05fSBarry Smith 5408e37d05fSBarry Smith Level: intermediate 5418e37d05fSBarry Smith 5428e37d05fSBarry Smith .seealso: PCFactorSetUseInPlace() 5438e37d05fSBarry Smith @*/ 5448e37d05fSBarry Smith PetscErrorCode PCFactorGetUseInPlace(PC pc,PetscBool *flg) 5458e37d05fSBarry Smith { 5468e37d05fSBarry Smith PetscErrorCode ierr; 5478e37d05fSBarry Smith 5488e37d05fSBarry Smith PetscFunctionBegin; 5498e37d05fSBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 550c60c7ad4SBarry Smith ierr = PetscUseMethod(pc,"PCFactorGetUseInPlace_C",(PC,PetscBool*),(pc,flg));CHKERRQ(ierr); 55185317021SBarry Smith PetscFunctionReturn(0); 55285317021SBarry Smith } 55385317021SBarry Smith 55485317021SBarry Smith /*@C 55585317021SBarry Smith PCFactorSetMatOrderingType - Sets the ordering routine (to reduce fill) to 556*2c7c0729SBarry Smith be used in the LU, ILU, Cholesky, and ICC factorizations. 55785317021SBarry Smith 558ad4df100SBarry Smith Logically Collective on PC 55985317021SBarry Smith 56085317021SBarry Smith Input Parameters: 56185317021SBarry Smith + pc - the preconditioner context 5622692d6eeSBarry Smith - ordering - the matrix ordering name, for example, MATORDERINGND or MATORDERINGRCM 56385317021SBarry Smith 56485317021SBarry Smith Options Database Key: 565*2c7c0729SBarry Smith . -pc_factor_mat_ordering_type <nd,rcm,...,external> - Sets ordering routine 56685317021SBarry Smith 56785317021SBarry Smith Level: intermediate 56885317021SBarry Smith 56995452b02SPatrick Sanan Notes: 57095452b02SPatrick Sanan nested dissection is used by default 57185317021SBarry Smith 5729bd791bbSBarry 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 5739bd791bbSBarry Smith and reordering this matrix is very expensive. 5749bd791bbSBarry Smith 5759bd791bbSBarry Smith You can use SeqAIJ matrix with Cholesky and ICC and use any ordering 5769bd791bbSBarry Smith 577*2c7c0729SBarry Smith external means PETSc will not compute an ordering and the package will use its own ordering, for MATSOLVERCHOLMOD and MATSOLVERUMFPACK 578*2c7c0729SBarry Smith 5799bd791bbSBarry Smith .seealso: MatOrderingType 58085317021SBarry Smith 58185317021SBarry Smith @*/ 58219fd82e9SBarry Smith PetscErrorCode PCFactorSetMatOrderingType(PC pc,MatOrderingType ordering) 58385317021SBarry Smith { 5844ac538c5SBarry Smith PetscErrorCode ierr; 58585317021SBarry Smith 58685317021SBarry Smith PetscFunctionBegin; 587c5eb9154SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 58819fd82e9SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetMatOrderingType_C",(PC,MatOrderingType),(pc,ordering));CHKERRQ(ierr); 58985317021SBarry Smith PetscFunctionReturn(0); 59085317021SBarry Smith } 59185317021SBarry Smith 59285317021SBarry Smith /*@ 5938ff23777SHong Zhang PCFactorSetColumnPivot - Determines when column pivoting is done during matrix factorization. 59485317021SBarry Smith For PETSc dense matrices column pivoting is always done, for PETSc sparse matrices 595e3c5b3baSBarry Smith it is never done. For the MATLAB and SuperLU factorization this is used. 59685317021SBarry Smith 597ad4df100SBarry Smith Logically Collective on PC 59885317021SBarry Smith 59985317021SBarry Smith Input Parameters: 60085317021SBarry Smith + pc - the preconditioner context 60185317021SBarry Smith - dtcol - 0.0 implies no pivoting, 1.0 complete pivoting (slower, requires more memory but more stable) 60285317021SBarry Smith 60385317021SBarry Smith Options Database Key: 60485317021SBarry Smith . -pc_factor_pivoting <dtcol> 60585317021SBarry Smith 60685317021SBarry Smith Level: intermediate 60785317021SBarry Smith 60885317021SBarry Smith .seealso: PCILUSetMatOrdering(), PCFactorSetPivotInBlocks() 60985317021SBarry Smith @*/ 6107087cfbeSBarry Smith PetscErrorCode PCFactorSetColumnPivot(PC pc,PetscReal dtcol) 61185317021SBarry Smith { 6124ac538c5SBarry Smith PetscErrorCode ierr; 61385317021SBarry Smith 61485317021SBarry Smith PetscFunctionBegin; 615c5eb9154SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 616c5eb9154SBarry Smith PetscValidLogicalCollectiveReal(pc,dtcol,2); 6174ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetColumnPivot_C",(PC,PetscReal),(pc,dtcol));CHKERRQ(ierr); 61885317021SBarry Smith PetscFunctionReturn(0); 61985317021SBarry Smith } 62085317021SBarry Smith 62185317021SBarry Smith /*@ 62285317021SBarry Smith PCFactorSetPivotInBlocks - Determines if pivoting is done while factoring each block 62385317021SBarry Smith with BAIJ or SBAIJ matrices 62485317021SBarry Smith 625ad4df100SBarry Smith Logically Collective on PC 62685317021SBarry Smith 62785317021SBarry Smith Input Parameters: 62885317021SBarry Smith + pc - the preconditioner context 62985317021SBarry Smith - pivot - PETSC_TRUE or PETSC_FALSE 63085317021SBarry Smith 63185317021SBarry Smith Options Database Key: 63285317021SBarry Smith . -pc_factor_pivot_in_blocks <true,false> 63385317021SBarry Smith 63485317021SBarry Smith Level: intermediate 63585317021SBarry Smith 6368ff23777SHong Zhang .seealso: PCILUSetMatOrdering(), PCFactorSetColumnPivot() 63785317021SBarry Smith @*/ 6387087cfbeSBarry Smith PetscErrorCode PCFactorSetPivotInBlocks(PC pc,PetscBool pivot) 63985317021SBarry Smith { 6404ac538c5SBarry Smith PetscErrorCode ierr; 64185317021SBarry Smith 64285317021SBarry Smith PetscFunctionBegin; 643c5eb9154SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,1); 644acfcf0e5SJed Brown PetscValidLogicalCollectiveBool(pc,pivot,2); 6454ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetPivotInBlocks_C",(PC,PetscBool),(pc,pivot));CHKERRQ(ierr); 64685317021SBarry Smith PetscFunctionReturn(0); 64785317021SBarry Smith } 64885317021SBarry Smith 64985317021SBarry Smith /*@ 650288e7d53SBarry Smith PCFactorSetReuseFill - When matrices with different nonzero structure are factored, 65185317021SBarry Smith this causes later ones to use the fill ratio computed in the initial factorization. 65285317021SBarry Smith 653ad4df100SBarry Smith Logically Collective on PC 65485317021SBarry Smith 65585317021SBarry Smith Input Parameters: 65685317021SBarry Smith + pc - the preconditioner context 65785317021SBarry Smith - flag - PETSC_TRUE to reuse else PETSC_FALSE 65885317021SBarry Smith 65985317021SBarry Smith Options Database Key: 66085317021SBarry Smith . -pc_factor_reuse_fill - Activates PCFactorSetReuseFill() 66185317021SBarry Smith 66285317021SBarry Smith Level: intermediate 66385317021SBarry Smith 66485317021SBarry Smith .seealso: PCFactorSetReuseOrdering() 66585317021SBarry Smith @*/ 6667087cfbeSBarry Smith PetscErrorCode PCFactorSetReuseFill(PC pc,PetscBool flag) 66785317021SBarry Smith { 6684ac538c5SBarry Smith PetscErrorCode ierr; 66985317021SBarry Smith 67085317021SBarry Smith PetscFunctionBegin; 6710700a824SBarry Smith PetscValidHeaderSpecific(pc,PC_CLASSID,2); 672acfcf0e5SJed Brown PetscValidLogicalCollectiveBool(pc,flag,2); 6734ac538c5SBarry Smith ierr = PetscTryMethod(pc,"PCFactorSetReuseFill_C",(PC,PetscBool),(pc,flag));CHKERRQ(ierr); 67485317021SBarry Smith PetscFunctionReturn(0); 67585317021SBarry Smith } 6763d1c1ea0SBarry Smith 6773d1c1ea0SBarry Smith PetscErrorCode PCFactorInitialize(PC pc) 6783d1c1ea0SBarry Smith { 6793d1c1ea0SBarry Smith PetscErrorCode ierr; 6803d1c1ea0SBarry Smith PC_Factor *fact = (PC_Factor*)pc->data; 6813d1c1ea0SBarry Smith 6823d1c1ea0SBarry Smith PetscFunctionBegin; 6833d1c1ea0SBarry Smith ierr = MatFactorInfoInitialize(&fact->info);CHKERRQ(ierr); 6843d1c1ea0SBarry Smith fact->info.shifttype = (PetscReal)MAT_SHIFT_NONE; 6853d1c1ea0SBarry Smith fact->info.shiftamount = 100.0*PETSC_MACHINE_EPSILON; 6863d1c1ea0SBarry Smith fact->info.zeropivot = 100.0*PETSC_MACHINE_EPSILON; 6873d1c1ea0SBarry Smith fact->info.pivotinblocks = 1.0; 6883d1c1ea0SBarry Smith pc->ops->getfactoredmatrix = PCFactorGetMatrix_Factor; 6893d1c1ea0SBarry Smith 6903d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetZeroPivot_C",PCFactorSetZeroPivot_Factor);CHKERRQ(ierr); 6913d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetZeroPivot_C",PCFactorGetZeroPivot_Factor);CHKERRQ(ierr); 6923d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetShiftType_C",PCFactorSetShiftType_Factor);CHKERRQ(ierr); 6933d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetShiftType_C",PCFactorGetShiftType_Factor);CHKERRQ(ierr); 6943d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetShiftAmount_C",PCFactorSetShiftAmount_Factor);CHKERRQ(ierr); 6953d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetShiftAmount_C",PCFactorGetShiftAmount_Factor);CHKERRQ(ierr); 6963ca39a21SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetMatSolverType_C",PCFactorGetMatSolverType_Factor);CHKERRQ(ierr); 6973ca39a21SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetMatSolverType_C",PCFactorSetMatSolverType_Factor);CHKERRQ(ierr); 6983ca39a21SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetUpMatSolverType_C",PCFactorSetUpMatSolverType_Factor);CHKERRQ(ierr); 6993d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetFill_C",PCFactorSetFill_Factor);CHKERRQ(ierr); 7003d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetMatOrderingType_C",PCFactorSetMatOrderingType_Factor);CHKERRQ(ierr); 7013d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetLevels_C",PCFactorSetLevels_Factor);CHKERRQ(ierr); 7023d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetLevels_C",PCFactorGetLevels_Factor);CHKERRQ(ierr); 7033d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetAllowDiagonalFill_C",PCFactorSetAllowDiagonalFill_Factor);CHKERRQ(ierr); 7043d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetAllowDiagonalFill_C",PCFactorGetAllowDiagonalFill_Factor);CHKERRQ(ierr); 7053d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetPivotInBlocks_C",PCFactorSetPivotInBlocks_Factor);CHKERRQ(ierr); 7063d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetUseInPlace_C",PCFactorSetUseInPlace_Factor);CHKERRQ(ierr); 7073d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetUseInPlace_C",PCFactorGetUseInPlace_Factor);CHKERRQ(ierr); 7083d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetReuseOrdering_C",PCFactorSetReuseOrdering_Factor);CHKERRQ(ierr); 7093d1c1ea0SBarry Smith ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetReuseFill_C",PCFactorSetReuseFill_Factor);CHKERRQ(ierr); 7103d1c1ea0SBarry Smith PetscFunctionReturn(0); 7113d1c1ea0SBarry Smith } 712