xref: /petsc/src/ksp/pc/impls/factor/factor.c (revision 4ac6704c710c1f28695377ac78b2ce44e2406750)
15e8efad8SHong Zhang 
2c6db04a5SJed Brown #include <../src/ksp/pc/impls/factor/factor.h>  /*I "petscpc.h" I*/
35e8efad8SHong Zhang 
4*4ac6704cSBarry Smith /*
5*4ac6704cSBarry Smith     If an ordering is not yet set and the matrix is available determine a default ordering
6*4ac6704cSBarry Smith */
7*4ac6704cSBarry Smith PetscErrorCode PCFactorSetDefaultOrdering_Factor(PC pc)
8*4ac6704cSBarry Smith {
9*4ac6704cSBarry Smith   PetscErrorCode  ierr;
10*4ac6704cSBarry Smith 
11*4ac6704cSBarry Smith   PetscFunctionBegin;
12*4ac6704cSBarry Smith   if (pc->pmat) {
13*4ac6704cSBarry Smith     PC_Factor *fact = (PC_Factor*)pc->data;
14*4ac6704cSBarry Smith     if (!fact->fact) {
15*4ac6704cSBarry Smith       ierr = MatGetFactor(pc->pmat,fact->solvertype,fact->factortype,&fact->fact);CHKERRQ(ierr);
16*4ac6704cSBarry Smith     }
17*4ac6704cSBarry Smith     if (!fact->ordering) {
18*4ac6704cSBarry Smith       PetscBool       canuseordering;
19*4ac6704cSBarry Smith       MatOrderingType otype;
20*4ac6704cSBarry Smith 
21*4ac6704cSBarry Smith       ierr = MatFactorGetCanUseOrdering(fact->fact,&canuseordering);CHKERRQ(ierr);
22*4ac6704cSBarry Smith       if (canuseordering) {
23*4ac6704cSBarry Smith         ierr = MatFactorGetPreferredOrdering(fact->fact,fact->factortype,&otype);CHKERRQ(ierr);
24*4ac6704cSBarry Smith       } else otype = MATORDERINGEXTERNAL;
25*4ac6704cSBarry Smith       ierr = PetscStrallocpy(otype,(char **)&fact->ordering);CHKERRQ(ierr);
26*4ac6704cSBarry Smith     }
27*4ac6704cSBarry Smith   }
28*4ac6704cSBarry Smith   PetscFunctionReturn(0);
29*4ac6704cSBarry Smith }
30*4ac6704cSBarry Smith 
313d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetReuseOrdering_Factor(PC pc,PetscBool flag)
323d1c1ea0SBarry Smith {
333d1c1ea0SBarry Smith   PC_Factor *lu = (PC_Factor*)pc->data;
343d1c1ea0SBarry Smith 
353d1c1ea0SBarry Smith   PetscFunctionBegin;
363d1c1ea0SBarry Smith   lu->reuseordering = flag;
373d1c1ea0SBarry Smith   PetscFunctionReturn(0);
383d1c1ea0SBarry Smith }
393d1c1ea0SBarry Smith 
403d1c1ea0SBarry Smith static PetscErrorCode PCFactorSetReuseFill_Factor(PC pc,PetscBool flag)
413d1c1ea0SBarry Smith {
423d1c1ea0SBarry Smith   PC_Factor *lu = (PC_Factor*)pc->data;
433d1c1ea0SBarry Smith 
443d1c1ea0SBarry Smith   PetscFunctionBegin;
453d1c1ea0SBarry Smith   lu->reusefill = flag;
463d1c1ea0SBarry Smith   PetscFunctionReturn(0);
473d1c1ea0SBarry Smith }
483d1c1ea0SBarry Smith 
493d1c1ea0SBarry Smith static PetscErrorCode  PCFactorSetUseInPlace_Factor(PC pc,PetscBool flg)
503d1c1ea0SBarry Smith {
513d1c1ea0SBarry Smith   PC_Factor *dir = (PC_Factor*)pc->data;
523d1c1ea0SBarry Smith 
533d1c1ea0SBarry Smith   PetscFunctionBegin;
543d1c1ea0SBarry Smith   dir->inplace = flg;
553d1c1ea0SBarry Smith   PetscFunctionReturn(0);
563d1c1ea0SBarry Smith }
573d1c1ea0SBarry Smith 
583d1c1ea0SBarry Smith static PetscErrorCode  PCFactorGetUseInPlace_Factor(PC pc,PetscBool *flg)
593d1c1ea0SBarry Smith {
603d1c1ea0SBarry Smith   PC_Factor *dir = (PC_Factor*)pc->data;
613d1c1ea0SBarry Smith 
623d1c1ea0SBarry Smith   PetscFunctionBegin;
633d1c1ea0SBarry Smith   *flg = dir->inplace;
643d1c1ea0SBarry Smith   PetscFunctionReturn(0);
653d1c1ea0SBarry Smith }
663d1c1ea0SBarry Smith 
67f8260c8fSBarry Smith /*@
683ca39a21SBarry Smith     PCFactorSetUpMatSolverType - Can be called after KSPSetOperators() or PCSetOperators(), causes MatGetFactor() to be called so then one may
69f8260c8fSBarry Smith        set the options for that particular factorization object.
70f8260c8fSBarry Smith 
71f8260c8fSBarry Smith   Input Parameter:
72f8260c8fSBarry Smith .  pc  - the preconditioner context
73f8260c8fSBarry Smith 
7495452b02SPatrick Sanan   Notes:
7595452b02SPatrick 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.
76f8260c8fSBarry Smith 
772bd2b0e6SSatish Balay   Level: intermediate
782bd2b0e6SSatish Balay 
796d33885cSprj- .seealso: PCFactorSetMatSolverType(), PCFactorGetMatrix()
80f8260c8fSBarry Smith @*/
813ca39a21SBarry Smith PetscErrorCode PCFactorSetUpMatSolverType(PC pc)
82f8260c8fSBarry Smith {
83f8260c8fSBarry Smith   PetscErrorCode ierr;
84f8260c8fSBarry Smith 
85f8260c8fSBarry Smith   PetscFunctionBegin;
86f8260c8fSBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
873ca39a21SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetUpMatSolverType_C",(PC),(pc));CHKERRQ(ierr);
88b3a44c85SBarry Smith   PetscFunctionReturn(0);
89f8260c8fSBarry Smith }
90f8260c8fSBarry Smith 
91ee45ca4aSHong Zhang /*@
92ee45ca4aSHong Zhang    PCFactorSetZeroPivot - Sets the size at which smaller pivots are declared to be zero
93ee45ca4aSHong Zhang 
94ad4df100SBarry Smith    Logically Collective on PC
95ee45ca4aSHong Zhang 
96ee45ca4aSHong Zhang    Input Parameters:
97afaefe49SHong Zhang +  pc - the preconditioner context
98afaefe49SHong Zhang -  zero - all pivots smaller than this will be considered zero
99ee45ca4aSHong Zhang 
100ee45ca4aSHong Zhang    Options Database Key:
101ee45ca4aSHong Zhang .  -pc_factor_zeropivot <zero> - Sets tolerance for what is considered a zero pivot
102ee45ca4aSHong Zhang 
103ee45ca4aSHong Zhang    Level: intermediate
104ee45ca4aSHong Zhang 
105daa17b54SHong Zhang .seealso: PCFactorSetShiftType(), PCFactorSetShiftAmount()
106ee45ca4aSHong Zhang @*/
1077087cfbeSBarry Smith PetscErrorCode  PCFactorSetZeroPivot(PC pc,PetscReal zero)
108ee45ca4aSHong Zhang {
1094ac538c5SBarry Smith   PetscErrorCode ierr;
110afaefe49SHong Zhang 
111ee45ca4aSHong Zhang   PetscFunctionBegin;
1120700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
113c5eb9154SBarry Smith   PetscValidLogicalCollectiveReal(pc,zero,2);
1144ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetZeroPivot_C",(PC,PetscReal),(pc,zero));CHKERRQ(ierr);
115ee45ca4aSHong Zhang   PetscFunctionReturn(0);
116ee45ca4aSHong Zhang }
117ee45ca4aSHong Zhang 
118915743fcSHong Zhang /*@
119915743fcSHong Zhang    PCFactorSetShiftType - adds a particular type of quantity to the diagonal of the matrix during
120915743fcSHong Zhang      numerical factorization, thus the matrix has nonzero pivots
121915743fcSHong Zhang 
122ad4df100SBarry Smith    Logically Collective on PC
123915743fcSHong Zhang 
124915743fcSHong Zhang    Input Parameters:
125915743fcSHong Zhang +  pc - the preconditioner context
126915743fcSHong Zhang -  shifttype - type of shift; one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO,  MAT_SHIFT_POSITIVE_DEFINITE, MAT_SHIFT_INBLOCKS
127915743fcSHong Zhang 
128915743fcSHong Zhang    Options Database Key:
12928d58a37SPierre Jolivet .  -pc_factor_shift_type <shifttype> - Sets shift type; use '-help' for a list of available types
130915743fcSHong Zhang 
131915743fcSHong Zhang    Level: intermediate
132915743fcSHong Zhang 
133915743fcSHong Zhang .seealso: PCFactorSetZeroPivot(), PCFactorSetShiftAmount()
134915743fcSHong Zhang @*/
1357087cfbeSBarry Smith PetscErrorCode  PCFactorSetShiftType(PC pc,MatFactorShiftType shifttype)
136d90ac83dSHong Zhang {
1374ac538c5SBarry Smith   PetscErrorCode ierr;
138d90ac83dSHong Zhang 
139d90ac83dSHong Zhang   PetscFunctionBegin;
1400700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
141c5eb9154SBarry Smith   PetscValidLogicalCollectiveEnum(pc,shifttype,2);
1424ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetShiftType_C",(PC,MatFactorShiftType),(pc,shifttype));CHKERRQ(ierr);
143d90ac83dSHong Zhang   PetscFunctionReturn(0);
144d90ac83dSHong Zhang }
145d90ac83dSHong Zhang 
146915743fcSHong Zhang /*@
147915743fcSHong Zhang    PCFactorSetShiftAmount - adds a quantity to the diagonal of the matrix during
148915743fcSHong Zhang      numerical factorization, thus the matrix has nonzero pivots
149915743fcSHong Zhang 
150ad4df100SBarry Smith    Logically Collective on PC
151915743fcSHong Zhang 
152915743fcSHong Zhang    Input Parameters:
153915743fcSHong Zhang +  pc - the preconditioner context
154915743fcSHong Zhang -  shiftamount - amount of shift
155915743fcSHong Zhang 
156915743fcSHong Zhang    Options Database Key:
157915743fcSHong Zhang .  -pc_factor_shift_amount <shiftamount> - Sets shift amount or PETSC_DECIDE for the default
158915743fcSHong Zhang 
159915743fcSHong Zhang    Level: intermediate
160915743fcSHong Zhang 
161915743fcSHong Zhang .seealso: PCFactorSetZeroPivot(), PCFactorSetShiftType()
162915743fcSHong Zhang @*/
1637087cfbeSBarry Smith PetscErrorCode  PCFactorSetShiftAmount(PC pc,PetscReal shiftamount)
164d90ac83dSHong Zhang {
1654ac538c5SBarry Smith   PetscErrorCode ierr;
166d90ac83dSHong Zhang 
167d90ac83dSHong Zhang   PetscFunctionBegin;
1680700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
169c5eb9154SBarry Smith   PetscValidLogicalCollectiveReal(pc,shiftamount,2);
1704ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetShiftAmount_C",(PC,PetscReal),(pc,shiftamount));CHKERRQ(ierr);
171d90ac83dSHong Zhang   PetscFunctionReturn(0);
172d90ac83dSHong Zhang }
173d90ac83dSHong Zhang 
1746d33885cSprj- /*@
175b7c853c4SBarry Smith    PCFactorSetDropTolerance - The preconditioner will use an ILU
17678fc6b22SHong Zhang    based on a drop tolerance. (Under development)
17785317021SBarry Smith 
178ad4df100SBarry Smith    Logically Collective on PC
17985317021SBarry Smith 
18085317021SBarry Smith    Input Parameters:
18185317021SBarry Smith +  pc - the preconditioner context
18285317021SBarry Smith .  dt - the drop tolerance, try from 1.e-10 to .1
18385317021SBarry Smith .  dtcol - tolerance for column pivot, good values [0.1 to 0.01]
18485317021SBarry Smith -  maxrowcount - the max number of nonzeros allowed in a row, best value
18585317021SBarry Smith                  depends on the number of nonzeros in row of original matrix
18685317021SBarry Smith 
18785317021SBarry Smith    Options Database Key:
188b7c853c4SBarry Smith .  -pc_factor_drop_tolerance <dt,dtcol,maxrowcount> - Sets drop tolerance
18985317021SBarry Smith 
19085317021SBarry Smith    Level: intermediate
19185317021SBarry Smith 
19285317021SBarry Smith       There are NO default values for the 3 parameters, you must set them with reasonable values for your
19385317021SBarry Smith       matrix. We don't know how to compute reasonable values.
19485317021SBarry Smith 
1956d33885cSprj- @*/
1967087cfbeSBarry Smith PetscErrorCode  PCFactorSetDropTolerance(PC pc,PetscReal dt,PetscReal dtcol,PetscInt maxrowcount)
19785317021SBarry Smith {
1984ac538c5SBarry Smith   PetscErrorCode ierr;
19985317021SBarry Smith 
20085317021SBarry Smith   PetscFunctionBegin;
2010700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
202c5eb9154SBarry Smith   PetscValidLogicalCollectiveReal(pc,dtcol,2);
203c5eb9154SBarry Smith   PetscValidLogicalCollectiveInt(pc,maxrowcount,3);
2044ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetDropTolerance_C",(PC,PetscReal,PetscReal,PetscInt),(pc,dt,dtcol,maxrowcount));CHKERRQ(ierr);
20585317021SBarry Smith   PetscFunctionReturn(0);
20685317021SBarry Smith }
20785317021SBarry Smith 
208c7f610a1SBarry Smith /*@
209c7f610a1SBarry Smith    PCFactorGetZeroPivot - Gets the tolerance used to define a zero privot
210c7f610a1SBarry Smith 
211c7f610a1SBarry Smith    Not Collective
212c7f610a1SBarry Smith 
213c7f610a1SBarry Smith    Input Parameters:
214c7f610a1SBarry Smith .  pc - the preconditioner context
215c7f610a1SBarry Smith 
216c7f610a1SBarry Smith    Output Parameter:
217c7f610a1SBarry Smith .  pivot - the tolerance
218c7f610a1SBarry Smith 
219c7f610a1SBarry Smith    Level: intermediate
220c7f610a1SBarry Smith 
221c7f610a1SBarry Smith .seealso: PCFactorSetZeroPivot()
222c7f610a1SBarry Smith @*/
223c7f610a1SBarry Smith PetscErrorCode  PCFactorGetZeroPivot(PC pc,PetscReal *pivot)
224c7f610a1SBarry Smith {
225c7f610a1SBarry Smith   PetscErrorCode ierr;
226c7f610a1SBarry Smith 
227c7f610a1SBarry Smith   PetscFunctionBegin;
228c7f610a1SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
229c7f610a1SBarry Smith   ierr = PetscUseMethod(pc,"PCFactorGetZeroPivot_C",(PC,PetscReal*),(pc,pivot));CHKERRQ(ierr);
230c7f610a1SBarry Smith   PetscFunctionReturn(0);
231c7f610a1SBarry Smith }
232c7f610a1SBarry Smith 
233c7f610a1SBarry Smith /*@
234c7f610a1SBarry Smith    PCFactorGetShiftAmount - Gets the tolerance used to define a zero privot
235c7f610a1SBarry Smith 
236c7f610a1SBarry Smith    Not Collective
237c7f610a1SBarry Smith 
238c7f610a1SBarry Smith    Input Parameters:
239c7f610a1SBarry Smith .  pc - the preconditioner context
240c7f610a1SBarry Smith 
241c7f610a1SBarry Smith    Output Parameter:
242c7f610a1SBarry Smith .  shift - how much to shift the diagonal entry
243c7f610a1SBarry Smith 
244c7f610a1SBarry Smith    Level: intermediate
245c7f610a1SBarry Smith 
246c7f610a1SBarry Smith .seealso: PCFactorSetShiftAmount(), PCFactorSetShiftType(), PCFactorGetShiftType()
247c7f610a1SBarry Smith @*/
248c7f610a1SBarry Smith PetscErrorCode  PCFactorGetShiftAmount(PC pc,PetscReal *shift)
249c7f610a1SBarry Smith {
250c7f610a1SBarry Smith   PetscErrorCode ierr;
251c7f610a1SBarry Smith 
252c7f610a1SBarry Smith   PetscFunctionBegin;
253c7f610a1SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
254c7f610a1SBarry Smith   ierr = PetscUseMethod(pc,"PCFactorGetShiftAmount_C",(PC,PetscReal*),(pc,shift));CHKERRQ(ierr);
255c7f610a1SBarry Smith   PetscFunctionReturn(0);
256c7f610a1SBarry Smith }
257c7f610a1SBarry Smith 
258c7f610a1SBarry Smith /*@
259c7f610a1SBarry Smith    PCFactorGetShiftType - Gets the type of shift, if any, done when a zero pivot is detected
260c7f610a1SBarry Smith 
261c7f610a1SBarry Smith    Not Collective
262c7f610a1SBarry Smith 
263c7f610a1SBarry Smith    Input Parameters:
264c7f610a1SBarry Smith .  pc - the preconditioner context
265c7f610a1SBarry Smith 
266c7f610a1SBarry Smith    Output Parameter:
267c7f610a1SBarry Smith .  type - one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO,  MAT_SHIFT_POSITIVE_DEFINITE, or MAT_SHIFT_INBLOCKS
268c7f610a1SBarry Smith 
269c7f610a1SBarry Smith    Level: intermediate
270c7f610a1SBarry Smith 
271c7f610a1SBarry Smith .seealso: PCFactorSetShiftType(), MatFactorShiftType, PCFactorSetShiftAmount(), PCFactorGetShiftAmount()
272c7f610a1SBarry Smith @*/
273c7f610a1SBarry Smith PetscErrorCode  PCFactorGetShiftType(PC pc,MatFactorShiftType *type)
274c7f610a1SBarry Smith {
275c7f610a1SBarry Smith   PetscErrorCode ierr;
276c7f610a1SBarry Smith 
277c7f610a1SBarry Smith   PetscFunctionBegin;
278c7f610a1SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
279c7f610a1SBarry Smith   ierr = PetscUseMethod(pc,"PCFactorGetShiftType_C",(PC,MatFactorShiftType*),(pc,type));CHKERRQ(ierr);
280c7f610a1SBarry Smith   PetscFunctionReturn(0);
281c7f610a1SBarry Smith }
282c7f610a1SBarry Smith 
2832591b318SToby Isaac /*@
2842591b318SToby Isaac    PCFactorGetLevels - Gets the number of levels of fill to use.
2852591b318SToby Isaac 
2862591b318SToby Isaac    Logically Collective on PC
2872591b318SToby Isaac 
2882591b318SToby Isaac    Input Parameters:
2892591b318SToby Isaac .  pc - the preconditioner context
2902591b318SToby Isaac 
2912591b318SToby Isaac    Output Parameter:
2922591b318SToby Isaac .  levels - number of levels of fill
2932591b318SToby Isaac 
2942591b318SToby Isaac    Level: intermediate
2952591b318SToby Isaac 
2962591b318SToby Isaac @*/
2972591b318SToby Isaac PetscErrorCode  PCFactorGetLevels(PC pc,PetscInt *levels)
2982591b318SToby Isaac {
2992591b318SToby Isaac   PetscErrorCode ierr;
3002591b318SToby Isaac 
3012591b318SToby Isaac   PetscFunctionBegin;
3022591b318SToby Isaac   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
303c60c7ad4SBarry Smith   ierr = PetscUseMethod(pc,"PCFactorGetLevels_C",(PC,PetscInt*),(pc,levels));CHKERRQ(ierr);
3042591b318SToby Isaac   PetscFunctionReturn(0);
3052591b318SToby Isaac }
3062591b318SToby Isaac 
30785317021SBarry Smith /*@
30885317021SBarry Smith    PCFactorSetLevels - Sets the number of levels of fill to use.
30985317021SBarry Smith 
310ad4df100SBarry Smith    Logically Collective on PC
31185317021SBarry Smith 
31285317021SBarry Smith    Input Parameters:
31385317021SBarry Smith +  pc - the preconditioner context
31485317021SBarry Smith -  levels - number of levels of fill
31585317021SBarry Smith 
31685317021SBarry Smith    Options Database Key:
31785317021SBarry Smith .  -pc_factor_levels <levels> - Sets fill level
31885317021SBarry Smith 
31985317021SBarry Smith    Level: intermediate
32085317021SBarry Smith 
32185317021SBarry Smith @*/
3227087cfbeSBarry Smith PetscErrorCode  PCFactorSetLevels(PC pc,PetscInt levels)
32385317021SBarry Smith {
3244ac538c5SBarry Smith   PetscErrorCode ierr;
32585317021SBarry Smith 
32685317021SBarry Smith   PetscFunctionBegin;
3270700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
328ce94432eSBarry Smith   if (levels < 0) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_OUTOFRANGE,"negative levels");
329c5eb9154SBarry Smith   PetscValidLogicalCollectiveInt(pc,levels,2);
3304ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetLevels_C",(PC,PetscInt),(pc,levels));CHKERRQ(ierr);
33185317021SBarry Smith   PetscFunctionReturn(0);
33285317021SBarry Smith }
33385317021SBarry Smith 
33485317021SBarry Smith /*@
33585317021SBarry Smith    PCFactorSetAllowDiagonalFill - Causes all diagonal matrix entries to be
33685317021SBarry Smith    treated as level 0 fill even if there is no non-zero location.
33785317021SBarry Smith 
338ad4df100SBarry Smith    Logically Collective on PC
33985317021SBarry Smith 
34085317021SBarry Smith    Input Parameters:
34185317021SBarry Smith +  pc - the preconditioner context
34292e9c092SBarry Smith -  flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off
34385317021SBarry Smith 
34485317021SBarry Smith    Options Database Key:
34585317021SBarry Smith .  -pc_factor_diagonal_fill
34685317021SBarry Smith 
34785317021SBarry Smith    Notes:
34885317021SBarry Smith    Does not apply with 0 fill.
34985317021SBarry Smith 
35085317021SBarry Smith    Level: intermediate
35185317021SBarry Smith 
35292e9c092SBarry Smith .seealso: PCFactorGetAllowDiagonalFill()
35385317021SBarry Smith @*/
35492e9c092SBarry Smith PetscErrorCode  PCFactorSetAllowDiagonalFill(PC pc,PetscBool flg)
35585317021SBarry Smith {
3564ac538c5SBarry Smith   PetscErrorCode ierr;
35785317021SBarry Smith 
35885317021SBarry Smith   PetscFunctionBegin;
3590700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
36092e9c092SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetAllowDiagonalFill_C",(PC,PetscBool),(pc,flg));CHKERRQ(ierr);
36192e9c092SBarry Smith   PetscFunctionReturn(0);
36292e9c092SBarry Smith }
36392e9c092SBarry Smith 
36492e9c092SBarry Smith /*@
36592e9c092SBarry Smith    PCFactorGetAllowDiagonalFill - Determines if all diagonal matrix entries are
36692e9c092SBarry Smith        treated as level 0 fill even if there is no non-zero location.
36792e9c092SBarry Smith 
36892e9c092SBarry Smith    Logically Collective on PC
36992e9c092SBarry Smith 
37092e9c092SBarry Smith    Input Parameter:
37192e9c092SBarry Smith .  pc - the preconditioner context
37292e9c092SBarry Smith 
37392e9c092SBarry Smith    Output Parameter:
37492e9c092SBarry Smith .   flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off
37592e9c092SBarry Smith 
37692e9c092SBarry Smith    Options Database Key:
37792e9c092SBarry Smith .  -pc_factor_diagonal_fill
37892e9c092SBarry Smith 
37992e9c092SBarry Smith    Notes:
38092e9c092SBarry Smith    Does not apply with 0 fill.
38192e9c092SBarry Smith 
38292e9c092SBarry Smith    Level: intermediate
38392e9c092SBarry Smith 
38492e9c092SBarry Smith .seealso: PCFactorSetAllowDiagonalFill()
38592e9c092SBarry Smith @*/
38692e9c092SBarry Smith PetscErrorCode  PCFactorGetAllowDiagonalFill(PC pc,PetscBool *flg)
38792e9c092SBarry Smith {
38892e9c092SBarry Smith   PetscErrorCode ierr;
38992e9c092SBarry Smith 
39092e9c092SBarry Smith   PetscFunctionBegin;
39192e9c092SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
392c60c7ad4SBarry Smith   ierr = PetscUseMethod(pc,"PCFactorGetAllowDiagonalFill_C",(PC,PetscBool*),(pc,flg));CHKERRQ(ierr);
39385317021SBarry Smith   PetscFunctionReturn(0);
39485317021SBarry Smith }
39585317021SBarry Smith 
39685317021SBarry Smith /*@
39785317021SBarry Smith    PCFactorReorderForNonzeroDiagonal - reorders rows/columns of matrix to remove zeros from diagonal
39885317021SBarry Smith 
399ad4df100SBarry Smith    Logically Collective on PC
40085317021SBarry Smith 
40185317021SBarry Smith    Input Parameters:
40285317021SBarry Smith +  pc - the preconditioner context
40385317021SBarry Smith -  tol - diagonal entries smaller than this in absolute value are considered zero
40485317021SBarry Smith 
40585317021SBarry Smith    Options Database Key:
40692e9c092SBarry Smith .  -pc_factor_nonzeros_along_diagonal <tol>
40785317021SBarry Smith 
40885317021SBarry Smith    Level: intermediate
40985317021SBarry Smith 
41085317021SBarry Smith .seealso: PCFactorSetFill(), PCFactorSetShiftNonzero(), PCFactorSetZeroPivot(), MatReorderForNonzeroDiagonal()
41185317021SBarry Smith @*/
4127087cfbeSBarry Smith PetscErrorCode  PCFactorReorderForNonzeroDiagonal(PC pc,PetscReal rtol)
41385317021SBarry Smith {
4144ac538c5SBarry Smith   PetscErrorCode ierr;
41585317021SBarry Smith 
41685317021SBarry Smith   PetscFunctionBegin;
4170700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
418c5eb9154SBarry Smith   PetscValidLogicalCollectiveReal(pc,rtol,2);
4194ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorReorderForNonzeroDiagonal_C",(PC,PetscReal),(pc,rtol));CHKERRQ(ierr);
42085317021SBarry Smith   PetscFunctionReturn(0);
42185317021SBarry Smith }
42285317021SBarry Smith 
423bf6011e8SBarry Smith /*@C
4243ca39a21SBarry Smith    PCFactorSetMatSolverType - sets the software that is used to perform the factorization
42585317021SBarry Smith 
426ad4df100SBarry Smith    Logically Collective on PC
42785317021SBarry Smith 
42885317021SBarry Smith    Input Parameters:
42985317021SBarry Smith +  pc - the preconditioner context
430f60c3dc2SHong Zhang -  stype - for example, superlu, superlu_dist
43185317021SBarry Smith 
43285317021SBarry Smith    Options Database Key:
4333ca39a21SBarry Smith .  -pc_factor_mat_solver_type <stype> - petsc, superlu, superlu_dist, mumps, cusparse
43485317021SBarry Smith 
43585317021SBarry Smith    Level: intermediate
43685317021SBarry Smith 
43785317021SBarry Smith    Note:
43885317021SBarry Smith      By default this will use the PETSc factorization if it exists
43985317021SBarry Smith 
4403ca39a21SBarry Smith .seealso: MatGetFactor(), MatSolverType, PCFactorGetMatSolverType()
44185317021SBarry Smith @*/
442ea799195SBarry Smith PetscErrorCode  PCFactorSetMatSolverType(PC pc,MatSolverType stype)
44385317021SBarry Smith {
4444ac538c5SBarry Smith   PetscErrorCode ierr;
44585317021SBarry Smith 
44685317021SBarry Smith   PetscFunctionBegin;
4470700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
448ea799195SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetMatSolverType_C",(PC,MatSolverType),(pc,stype));CHKERRQ(ierr);
44985317021SBarry Smith   PetscFunctionReturn(0);
45085317021SBarry Smith }
45185317021SBarry Smith 
452bf6011e8SBarry Smith /*@C
4533ca39a21SBarry Smith    PCFactorGetMatSolverType - gets the software that is used to perform the factorization
4547112b564SBarry Smith 
455c5eb9154SBarry Smith    Not Collective
4567112b564SBarry Smith 
4577112b564SBarry Smith    Input Parameter:
4587112b564SBarry Smith .  pc - the preconditioner context
4597112b564SBarry Smith 
4607112b564SBarry Smith    Output Parameter:
4610298fd71SBarry Smith .   stype - for example, superlu, superlu_dist (NULL if the PC does not have a solver package)
4627112b564SBarry Smith 
4637112b564SBarry Smith    Level: intermediate
4647112b564SBarry Smith 
4653ca39a21SBarry Smith .seealso: MatGetFactor(), MatSolverType, PCFactorGetMatSolverType()
4667112b564SBarry Smith @*/
467ea799195SBarry Smith PetscErrorCode  PCFactorGetMatSolverType(PC pc,MatSolverType *stype)
4687112b564SBarry Smith {
469ea799195SBarry Smith   PetscErrorCode ierr,(*f)(PC,MatSolverType*);
4707112b564SBarry Smith 
4717112b564SBarry Smith   PetscFunctionBegin;
4720700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
4733ca39a21SBarry Smith   ierr = PetscObjectQueryFunction((PetscObject)pc,"PCFactorGetMatSolverType_C",&f);CHKERRQ(ierr);
4748b5c83b4SJed Brown   if (f) {
4758b5c83b4SJed Brown     ierr = (*f)(pc,stype);CHKERRQ(ierr);
4768b5c83b4SJed Brown   } else {
4770298fd71SBarry Smith     *stype = NULL;
4788b5c83b4SJed Brown   }
4797112b564SBarry Smith   PetscFunctionReturn(0);
4807112b564SBarry Smith }
4817112b564SBarry Smith 
48285317021SBarry Smith /*@
48385317021SBarry Smith    PCFactorSetFill - Indicate the amount of fill you expect in the factored matrix,
48485317021SBarry Smith    fill = number nonzeros in factor/number nonzeros in original matrix.
48585317021SBarry Smith 
486c5eb9154SBarry Smith    Not Collective, each process can expect a different amount of fill
48785317021SBarry Smith 
48885317021SBarry Smith    Input Parameters:
48985317021SBarry Smith +  pc - the preconditioner context
49085317021SBarry Smith -  fill - amount of expected fill
49185317021SBarry Smith 
49285317021SBarry Smith    Options Database Key:
49385317021SBarry Smith .  -pc_factor_fill <fill> - Sets fill amount
49485317021SBarry Smith 
49585317021SBarry Smith    Level: intermediate
49685317021SBarry Smith 
49785317021SBarry Smith    Note:
49885317021SBarry Smith    For sparse matrix factorizations it is difficult to predict how much
49985317021SBarry Smith    fill to expect. By running with the option -info PETSc will print the
50085317021SBarry Smith    actual amount of fill used; allowing you to set the value accurately for
50185317021SBarry Smith    future runs. Default PETSc uses a value of 5.0
50285317021SBarry Smith 
50301a79839SBarry Smith    This parameter has NOTHING to do with the levels-of-fill of ILU(). That is set with PCFactorSetLevels() or -pc_factor_levels.
50401a79839SBarry Smith 
50585317021SBarry Smith @*/
5067087cfbeSBarry Smith PetscErrorCode  PCFactorSetFill(PC pc,PetscReal fill)
50785317021SBarry Smith {
5084ac538c5SBarry Smith   PetscErrorCode ierr;
50985317021SBarry Smith 
51085317021SBarry Smith   PetscFunctionBegin;
5110700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
512ce94432eSBarry Smith   if (fill < 1.0) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_OUTOFRANGE,"Fill factor cannot be less then 1.0");
5134ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetFill_C",(PC,PetscReal),(pc,fill));CHKERRQ(ierr);
51485317021SBarry Smith   PetscFunctionReturn(0);
51585317021SBarry Smith }
51685317021SBarry Smith 
51785317021SBarry Smith /*@
51885317021SBarry Smith    PCFactorSetUseInPlace - Tells the system to do an in-place factorization.
51985317021SBarry Smith    For dense matrices, this enables the solution of much larger problems.
52085317021SBarry Smith    For sparse matrices the factorization cannot be done truly in-place
52185317021SBarry Smith    so this does not save memory during the factorization, but after the matrix
52285317021SBarry Smith    is factored, the original unfactored matrix is freed, thus recovering that
523ec5066bdSBarry Smith    space. For ICC(0) and ILU(0) with the default natural ordering the factorization is done efficiently in-place.
52485317021SBarry Smith 
525ad4df100SBarry Smith    Logically Collective on PC
52685317021SBarry Smith 
52785317021SBarry Smith    Input Parameters:
5288e37d05fSBarry Smith +  pc - the preconditioner context
5298e37d05fSBarry Smith -  flg - PETSC_TRUE to enable, PETSC_FALSE to disable
53085317021SBarry Smith 
53185317021SBarry Smith    Options Database Key:
5328e37d05fSBarry Smith .  -pc_factor_in_place <true,false>- Activate/deactivate in-place factorization
53385317021SBarry Smith 
53485317021SBarry Smith    Notes:
53585317021SBarry Smith    PCFactorSetUseInplace() can only be used with the KSP method KSPPREONLY or when
53685317021SBarry Smith    a different matrix is provided for the multiply and the preconditioner in
53785317021SBarry Smith    a call to KSPSetOperators().
53885317021SBarry Smith    This is because the Krylov space methods require an application of the
53985317021SBarry Smith    matrix multiplication, which is not possible here because the matrix has
54085317021SBarry Smith    been factored in-place, replacing the original matrix.
54185317021SBarry Smith 
54285317021SBarry Smith    Level: intermediate
54385317021SBarry Smith 
5448e37d05fSBarry Smith .seealso: PCFactorGetUseInPlace()
54585317021SBarry Smith @*/
5468e37d05fSBarry Smith PetscErrorCode  PCFactorSetUseInPlace(PC pc,PetscBool flg)
54785317021SBarry Smith {
5484ac538c5SBarry Smith   PetscErrorCode ierr;
54985317021SBarry Smith 
55085317021SBarry Smith   PetscFunctionBegin;
5510700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
5528e37d05fSBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetUseInPlace_C",(PC,PetscBool),(pc,flg));CHKERRQ(ierr);
5538e37d05fSBarry Smith   PetscFunctionReturn(0);
5548e37d05fSBarry Smith }
5558e37d05fSBarry Smith 
5568e37d05fSBarry Smith /*@
5578e37d05fSBarry Smith    PCFactorGetUseInPlace - Determines if an in-place factorization is being used.
5588e37d05fSBarry Smith 
5598e37d05fSBarry Smith    Logically Collective on PC
5608e37d05fSBarry Smith 
5618e37d05fSBarry Smith    Input Parameter:
5628e37d05fSBarry Smith .  pc - the preconditioner context
5638e37d05fSBarry Smith 
5648e37d05fSBarry Smith    Output Parameter:
5658e37d05fSBarry Smith .  flg - PETSC_TRUE to enable, PETSC_FALSE to disable
5668e37d05fSBarry Smith 
5678e37d05fSBarry Smith    Level: intermediate
5688e37d05fSBarry Smith 
5698e37d05fSBarry Smith .seealso: PCFactorSetUseInPlace()
5708e37d05fSBarry Smith @*/
5718e37d05fSBarry Smith PetscErrorCode  PCFactorGetUseInPlace(PC pc,PetscBool *flg)
5728e37d05fSBarry Smith {
5738e37d05fSBarry Smith   PetscErrorCode ierr;
5748e37d05fSBarry Smith 
5758e37d05fSBarry Smith   PetscFunctionBegin;
5768e37d05fSBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
577c60c7ad4SBarry Smith   ierr = PetscUseMethod(pc,"PCFactorGetUseInPlace_C",(PC,PetscBool*),(pc,flg));CHKERRQ(ierr);
57885317021SBarry Smith   PetscFunctionReturn(0);
57985317021SBarry Smith }
58085317021SBarry Smith 
58185317021SBarry Smith /*@C
58285317021SBarry Smith     PCFactorSetMatOrderingType - Sets the ordering routine (to reduce fill) to
5832c7c0729SBarry Smith     be used in the LU, ILU, Cholesky, and ICC factorizations.
58485317021SBarry Smith 
585ad4df100SBarry Smith     Logically Collective on PC
58685317021SBarry Smith 
58785317021SBarry Smith     Input Parameters:
58885317021SBarry Smith +   pc - the preconditioner context
5892692d6eeSBarry Smith -   ordering - the matrix ordering name, for example, MATORDERINGND or MATORDERINGRCM
59085317021SBarry Smith 
59185317021SBarry Smith     Options Database Key:
5922c7c0729SBarry Smith .   -pc_factor_mat_ordering_type <nd,rcm,...,external> - Sets ordering routine
59385317021SBarry Smith 
59485317021SBarry Smith     Level: intermediate
59585317021SBarry Smith 
59695452b02SPatrick Sanan     Notes:
597*4ac6704cSBarry Smith       Nested dissection is used by default for some of PETSc's sparse matrix formats
59885317021SBarry Smith 
5999bd791bbSBarry 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
6009bd791bbSBarry Smith      and reordering this matrix is very expensive.
6019bd791bbSBarry Smith 
602*4ac6704cSBarry Smith       You can use a SeqAIJ matrix with Cholesky and ICC and use any ordering.
6039bd791bbSBarry Smith 
604*4ac6704cSBarry Smith       MATORDERINGEXTERNAL means PETSc will not compute an ordering and the package will use its own ordering, usable with MATSOLVERCHOLMOD, MATSOLVERUMFPACK, and others.
6052c7c0729SBarry Smith 
6069bd791bbSBarry Smith .seealso: MatOrderingType
60785317021SBarry Smith 
60885317021SBarry Smith @*/
60919fd82e9SBarry Smith PetscErrorCode  PCFactorSetMatOrderingType(PC pc,MatOrderingType ordering)
61085317021SBarry Smith {
6114ac538c5SBarry Smith   PetscErrorCode ierr;
61285317021SBarry Smith 
61385317021SBarry Smith   PetscFunctionBegin;
614c5eb9154SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
61519fd82e9SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetMatOrderingType_C",(PC,MatOrderingType),(pc,ordering));CHKERRQ(ierr);
61685317021SBarry Smith   PetscFunctionReturn(0);
61785317021SBarry Smith }
61885317021SBarry Smith 
61985317021SBarry Smith /*@
6208ff23777SHong Zhang     PCFactorSetColumnPivot - Determines when column pivoting is done during matrix factorization.
62185317021SBarry Smith       For PETSc dense matrices column pivoting is always done, for PETSc sparse matrices
622e3c5b3baSBarry Smith       it is never done. For the MATLAB and SuperLU factorization this is used.
62385317021SBarry Smith 
624ad4df100SBarry Smith     Logically Collective on PC
62585317021SBarry Smith 
62685317021SBarry Smith     Input Parameters:
62785317021SBarry Smith +   pc - the preconditioner context
62885317021SBarry Smith -   dtcol - 0.0 implies no pivoting, 1.0 complete pivoting (slower, requires more memory but more stable)
62985317021SBarry Smith 
63085317021SBarry Smith     Options Database Key:
63185317021SBarry Smith .   -pc_factor_pivoting <dtcol>
63285317021SBarry Smith 
63385317021SBarry Smith     Level: intermediate
63485317021SBarry Smith 
63585317021SBarry Smith .seealso: PCILUSetMatOrdering(), PCFactorSetPivotInBlocks()
63685317021SBarry Smith @*/
6377087cfbeSBarry Smith PetscErrorCode  PCFactorSetColumnPivot(PC pc,PetscReal dtcol)
63885317021SBarry Smith {
6394ac538c5SBarry Smith   PetscErrorCode ierr;
64085317021SBarry Smith 
64185317021SBarry Smith   PetscFunctionBegin;
642c5eb9154SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
643c5eb9154SBarry Smith   PetscValidLogicalCollectiveReal(pc,dtcol,2);
6444ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetColumnPivot_C",(PC,PetscReal),(pc,dtcol));CHKERRQ(ierr);
64585317021SBarry Smith   PetscFunctionReturn(0);
64685317021SBarry Smith }
64785317021SBarry Smith 
64885317021SBarry Smith /*@
64985317021SBarry Smith     PCFactorSetPivotInBlocks - Determines if pivoting is done while factoring each block
65085317021SBarry Smith       with BAIJ or SBAIJ matrices
65185317021SBarry Smith 
652ad4df100SBarry Smith     Logically Collective on PC
65385317021SBarry Smith 
65485317021SBarry Smith     Input Parameters:
65585317021SBarry Smith +   pc - the preconditioner context
65685317021SBarry Smith -   pivot - PETSC_TRUE or PETSC_FALSE
65785317021SBarry Smith 
65885317021SBarry Smith     Options Database Key:
65985317021SBarry Smith .   -pc_factor_pivot_in_blocks <true,false>
66085317021SBarry Smith 
66185317021SBarry Smith     Level: intermediate
66285317021SBarry Smith 
6638ff23777SHong Zhang .seealso: PCILUSetMatOrdering(), PCFactorSetColumnPivot()
66485317021SBarry Smith @*/
6657087cfbeSBarry Smith PetscErrorCode  PCFactorSetPivotInBlocks(PC pc,PetscBool pivot)
66685317021SBarry Smith {
6674ac538c5SBarry Smith   PetscErrorCode ierr;
66885317021SBarry Smith 
66985317021SBarry Smith   PetscFunctionBegin;
670c5eb9154SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,1);
671acfcf0e5SJed Brown   PetscValidLogicalCollectiveBool(pc,pivot,2);
6724ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetPivotInBlocks_C",(PC,PetscBool),(pc,pivot));CHKERRQ(ierr);
67385317021SBarry Smith   PetscFunctionReturn(0);
67485317021SBarry Smith }
67585317021SBarry Smith 
67685317021SBarry Smith /*@
677288e7d53SBarry Smith    PCFactorSetReuseFill - When matrices with different nonzero structure are factored,
67885317021SBarry Smith    this causes later ones to use the fill ratio computed in the initial factorization.
67985317021SBarry Smith 
680ad4df100SBarry Smith    Logically Collective on PC
68185317021SBarry Smith 
68285317021SBarry Smith    Input Parameters:
68385317021SBarry Smith +  pc - the preconditioner context
68485317021SBarry Smith -  flag - PETSC_TRUE to reuse else PETSC_FALSE
68585317021SBarry Smith 
68685317021SBarry Smith    Options Database Key:
68785317021SBarry Smith .  -pc_factor_reuse_fill - Activates PCFactorSetReuseFill()
68885317021SBarry Smith 
68985317021SBarry Smith    Level: intermediate
69085317021SBarry Smith 
69185317021SBarry Smith .seealso: PCFactorSetReuseOrdering()
69285317021SBarry Smith @*/
6937087cfbeSBarry Smith PetscErrorCode  PCFactorSetReuseFill(PC pc,PetscBool flag)
69485317021SBarry Smith {
6954ac538c5SBarry Smith   PetscErrorCode ierr;
69685317021SBarry Smith 
69785317021SBarry Smith   PetscFunctionBegin;
6980700a824SBarry Smith   PetscValidHeaderSpecific(pc,PC_CLASSID,2);
699acfcf0e5SJed Brown   PetscValidLogicalCollectiveBool(pc,flag,2);
7004ac538c5SBarry Smith   ierr = PetscTryMethod(pc,"PCFactorSetReuseFill_C",(PC,PetscBool),(pc,flag));CHKERRQ(ierr);
70185317021SBarry Smith   PetscFunctionReturn(0);
70285317021SBarry Smith }
7033d1c1ea0SBarry Smith 
704*4ac6704cSBarry Smith PetscErrorCode PCFactorInitialize(PC pc,MatFactorType ftype)
7053d1c1ea0SBarry Smith {
7063d1c1ea0SBarry Smith   PetscErrorCode ierr;
7073d1c1ea0SBarry Smith   PC_Factor      *fact = (PC_Factor*)pc->data;
7083d1c1ea0SBarry Smith 
7093d1c1ea0SBarry Smith   PetscFunctionBegin;
7103d1c1ea0SBarry Smith   ierr                       = MatFactorInfoInitialize(&fact->info);CHKERRQ(ierr);
711*4ac6704cSBarry Smith   fact->factortype           = ftype;
7123d1c1ea0SBarry Smith   fact->info.shifttype       = (PetscReal)MAT_SHIFT_NONE;
7133d1c1ea0SBarry Smith   fact->info.shiftamount     = 100.0*PETSC_MACHINE_EPSILON;
7143d1c1ea0SBarry Smith   fact->info.zeropivot       = 100.0*PETSC_MACHINE_EPSILON;
7153d1c1ea0SBarry Smith   fact->info.pivotinblocks   = 1.0;
7163d1c1ea0SBarry Smith   pc->ops->getfactoredmatrix = PCFactorGetMatrix_Factor;
7173d1c1ea0SBarry Smith 
7183d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetZeroPivot_C",PCFactorSetZeroPivot_Factor);CHKERRQ(ierr);
7193d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetZeroPivot_C",PCFactorGetZeroPivot_Factor);CHKERRQ(ierr);
7203d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetShiftType_C",PCFactorSetShiftType_Factor);CHKERRQ(ierr);
7213d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetShiftType_C",PCFactorGetShiftType_Factor);CHKERRQ(ierr);
7223d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetShiftAmount_C",PCFactorSetShiftAmount_Factor);CHKERRQ(ierr);
7233d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetShiftAmount_C",PCFactorGetShiftAmount_Factor);CHKERRQ(ierr);
7243ca39a21SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetMatSolverType_C",PCFactorGetMatSolverType_Factor);CHKERRQ(ierr);
7253ca39a21SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetMatSolverType_C",PCFactorSetMatSolverType_Factor);CHKERRQ(ierr);
7263ca39a21SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetUpMatSolverType_C",PCFactorSetUpMatSolverType_Factor);CHKERRQ(ierr);
7273d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetFill_C",PCFactorSetFill_Factor);CHKERRQ(ierr);
7283d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetMatOrderingType_C",PCFactorSetMatOrderingType_Factor);CHKERRQ(ierr);
7293d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetLevels_C",PCFactorSetLevels_Factor);CHKERRQ(ierr);
7303d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetLevels_C",PCFactorGetLevels_Factor);CHKERRQ(ierr);
7313d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetAllowDiagonalFill_C",PCFactorSetAllowDiagonalFill_Factor);CHKERRQ(ierr);
7323d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetAllowDiagonalFill_C",PCFactorGetAllowDiagonalFill_Factor);CHKERRQ(ierr);
7333d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetPivotInBlocks_C",PCFactorSetPivotInBlocks_Factor);CHKERRQ(ierr);
7343d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetUseInPlace_C",PCFactorSetUseInPlace_Factor);CHKERRQ(ierr);
7353d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorGetUseInPlace_C",PCFactorGetUseInPlace_Factor);CHKERRQ(ierr);
7363d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetReuseOrdering_C",PCFactorSetReuseOrdering_Factor);CHKERRQ(ierr);
7373d1c1ea0SBarry Smith   ierr = PetscObjectComposeFunction((PetscObject)pc,"PCFactorSetReuseFill_C",PCFactorSetReuseFill_Factor);CHKERRQ(ierr);
7383d1c1ea0SBarry Smith   PetscFunctionReturn(0);
7393d1c1ea0SBarry Smith }
740