File: | ksp/pc/impls/ksp/pcksp.c |
Warning: | line 26, column 3 Value stored to 'ierr' is never read |
[?] Use j/k keys for keyboard navigation
1 | #include <petsc/private/pcimpl.h> |
2 | #include <petsc/private/kspimpl.h> |
3 | #include <petscksp.h> /*I "petscksp.h" I*/ |
4 | |
5 | typedef struct { |
6 | KSP ksp; |
7 | PetscInt its; /* total number of iterations KSP uses */ |
8 | } PC_KSP; |
9 | |
10 | static PetscErrorCode PCKSPCreateKSP_KSP(PC pc) |
11 | { |
12 | PetscErrorCode ierr; |
13 | const char *prefix; |
14 | PC_KSP *jac = (PC_KSP*)pc->data; |
15 | DM dm; |
16 | |
17 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 17; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
18 | ierr = KSPCreate(PetscObjectComm((PetscObject)pc),&jac->ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),18,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
19 | ierr = KSPSetErrorIfNotConverged(jac->ksp,pc->erroriffailure);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),19,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
20 | ierr = PetscObjectIncrementTabLevel((PetscObject)jac->ksp,(PetscObject)pc,1);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),20,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
21 | ierr = PCGetOptionsPrefix(pc,&prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),21,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
22 | ierr = KSPSetOptionsPrefix(jac->ksp,prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),22,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
23 | ierr = KSPAppendOptionsPrefix(jac->ksp,"ksp_");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),23,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
24 | ierr = PCGetDM(pc, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),24,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
25 | ierr = KSPSetDM(jac->ksp, dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),25,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
26 | ierr = KSPSetDMActive(jac->ksp, PETSC_FALSE); |
Value stored to 'ierr' is never read | |
27 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
28 | } |
29 | |
30 | static PetscErrorCode PCApply_KSP(PC pc,Vec x,Vec y) |
31 | { |
32 | PetscErrorCode ierr; |
33 | PetscInt its; |
34 | PC_KSP *jac = (PC_KSP*)pc->data; |
35 | |
36 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 36; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
37 | if (jac->ksp->presolve) { |
38 | ierr = VecCopy(x,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),38,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
39 | ierr = KSPSolve(jac->ksp,y,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),39,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
40 | } else { |
41 | ierr = KSPSolve(jac->ksp,x,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),41,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
42 | } |
43 | ierr = KSPCheckSolve(jac->ksp,pc,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),43,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
44 | ierr = KSPGetIterationNumber(jac->ksp,&its);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),44,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
45 | jac->its += its; |
46 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
47 | } |
48 | |
49 | static PetscErrorCode PCApplyTranspose_KSP(PC pc,Vec x,Vec y) |
50 | { |
51 | PetscErrorCode ierr; |
52 | PetscInt its; |
53 | PC_KSP *jac = (PC_KSP*)pc->data; |
54 | |
55 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 55; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
56 | if (jac->ksp->presolve) { |
57 | ierr = VecCopy(x,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),57,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
58 | ierr = KSPSolve(jac->ksp,y,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),58,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
59 | } else { |
60 | ierr = KSPSolveTranspose(jac->ksp,x,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),60,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
61 | } |
62 | ierr = KSPCheckSolve(jac->ksp,pc,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),62,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
63 | ierr = KSPGetIterationNumber(jac->ksp,&its);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),63,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
64 | jac->its += its; |
65 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
66 | } |
67 | |
68 | static PetscErrorCode PCSetUp_KSP(PC pc) |
69 | { |
70 | PetscErrorCode ierr; |
71 | PC_KSP *jac = (PC_KSP*)pc->data; |
72 | Mat mat; |
73 | |
74 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 74; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
75 | if (!jac->ksp) { |
76 | ierr = PCKSPCreateKSP_KSP(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),76,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
77 | ierr = KSPSetFromOptions(jac->ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),77,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
78 | } |
79 | if (pc->useAmat) mat = pc->mat; |
80 | else mat = pc->pmat; |
81 | ierr = KSPSetOperators(jac->ksp,mat,pc->pmat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),81,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
82 | ierr = KSPSetUp(jac->ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),82,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
83 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
84 | } |
85 | |
86 | /* Default destroy, if it has never been setup */ |
87 | static PetscErrorCode PCReset_KSP(PC pc) |
88 | { |
89 | PC_KSP *jac = (PC_KSP*)pc->data; |
90 | PetscErrorCode ierr; |
91 | |
92 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 92; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
93 | ierr = KSPDestroy(&jac->ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),93,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
94 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
95 | } |
96 | |
97 | static PetscErrorCode PCDestroy_KSP(PC pc) |
98 | { |
99 | PC_KSP *jac = (PC_KSP*)pc->data; |
100 | PetscErrorCode ierr; |
101 | |
102 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 102; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
103 | ierr = KSPDestroy(&jac->ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),103,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
104 | ierr = PetscObjectComposeFunction((PetscObject)pc,"PCKSPGetKSP_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCKSPGetKSP_C" ,(PetscVoidFunction)(((void*)0)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),104,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
105 | ierr = PetscObjectComposeFunction((PetscObject)pc,"PCKSPSetKSP_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCKSPSetKSP_C" ,(PetscVoidFunction)(((void*)0)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),105,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
106 | ierr = PetscFree(pc->data)((*PetscTrFree)((void*)(pc->data),106,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ) || ((pc->data) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),106,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
107 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
108 | } |
109 | |
110 | static PetscErrorCode PCView_KSP(PC pc,PetscViewer viewer) |
111 | { |
112 | PC_KSP *jac = (PC_KSP*)pc->data; |
113 | PetscErrorCode ierr; |
114 | PetscBool iascii; |
115 | |
116 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 116; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
117 | if (!jac->ksp) {ierr = PCKSPCreateKSP_KSP(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),117,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0);} |
118 | ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII"ascii",&iascii);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),118,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
119 | if (iascii) { |
120 | if (pc->useAmat) { |
121 | ierr = PetscViewerASCIIPrintf(viewer," Using Amat (not Pmat) as operator on inner solve\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),121,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
122 | } |
123 | ierr = PetscViewerASCIIPrintf(viewer," KSP and PC on KSP preconditioner follow\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),123,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
124 | ierr = PetscViewerASCIIPrintf(viewer," ---------------------------------\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),124,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
125 | } |
126 | ierr = PetscViewerASCIIPushTab(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),126,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
127 | ierr = KSPView(jac->ksp,viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),127,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
128 | ierr = PetscViewerASCIIPopTab(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),128,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
129 | if (iascii) { |
130 | ierr = PetscViewerASCIIPrintf(viewer," ---------------------------------\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),130,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
131 | } |
132 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
133 | } |
134 | |
135 | static PetscErrorCode PCKSPSetKSP_KSP(PC pc,KSP ksp) |
136 | { |
137 | PC_KSP *jac = (PC_KSP*)pc->data; |
138 | PetscErrorCode ierr; |
139 | |
140 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 140; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
141 | ierr = PetscObjectReference((PetscObject)ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),141,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
142 | ierr = KSPDestroy(&jac->ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),142,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
143 | jac->ksp = ksp; |
144 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
145 | } |
146 | |
147 | /*@ |
148 | PCKSPSetKSP - Sets the KSP context for a KSP PC. |
149 | |
150 | Collective on PC |
151 | |
152 | Input Parameter: |
153 | + pc - the preconditioner context |
154 | - ksp - the KSP solver |
155 | |
156 | Notes: |
157 | The PC and the KSP must have the same communicator |
158 | |
159 | Level: advanced |
160 | |
161 | @*/ |
162 | PetscErrorCode PCKSPSetKSP(PC pc,KSP ksp) |
163 | { |
164 | PetscErrorCode ierr; |
165 | |
166 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 166; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
167 | PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),167,__func__ ,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c",85, PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer (pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),167 ,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d" ,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if ( ((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm )0x44000001),167,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d" ,1); else return PetscError(((MPI_Comm)0x44000001),167,__func__ ,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c",62, PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1) ; } } while (0); |
168 | PetscValidHeaderSpecific(ksp,KSP_CLASSID,2)do { if (!ksp) return PetscError(((MPI_Comm)0x44000001),168,__func__ ,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c",85, PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (!PetscCheckPointer (ksp,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001), 168,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d" ,2); if (((PetscObject)(ksp))->classid != KSP_CLASSID) { if (((PetscObject)(ksp))->classid == -1) return PetscError(( (MPI_Comm)0x44000001),168,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d" ,2); else return PetscError(((MPI_Comm)0x44000001),168,__func__ ,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c",62, PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2) ; } } while (0); |
169 | PetscCheckSameComm(pc,1,ksp,2)do { PetscErrorCode _6_ierr,__flag; _6_ierr = MPI_Comm_compare (PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject )ksp),&__flag);do {if (__builtin_expect(!!(_6_ierr),0)) return PetscError(((MPI_Comm)0x44000001),169,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,_6_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (__flag != 1 && __flag != 0) return PetscError(((MPI_Comm)0x44000001 ),169,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d" ,1,2,__flag); } while (0); |
170 | ierr = PetscTryMethod(pc,"PCKSPSetKSP_C",(PC,KSP),(pc,ksp))0; do { PetscErrorCode (*f)(PC,KSP), __ierr; __ierr = PetscObjectQueryFunction_Private (((PetscObject)pc),("PCKSPSetKSP_C"),(PetscVoidFunction*)(& f));do {if (__builtin_expect(!!(__ierr),0)) return PetscError (((MPI_Comm)0x44000001),170,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,__ierr,PETSC_ERROR_REPEAT," ");} while (0); if (f) {__ierr = (*f)(pc,ksp);do {if (__builtin_expect(!!(__ierr),0)) return PetscError (((MPI_Comm)0x44000001),170,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,__ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),170,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
171 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
172 | } |
173 | |
174 | static PetscErrorCode PCKSPGetKSP_KSP(PC pc,KSP *ksp) |
175 | { |
176 | PC_KSP *jac = (PC_KSP*)pc->data; |
177 | PetscErrorCode ierr; |
178 | |
179 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 179; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
180 | if (!jac->ksp) {ierr = PCKSPCreateKSP_KSP(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),180,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0);} |
181 | *ksp = jac->ksp; |
182 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
183 | } |
184 | |
185 | /*@ |
186 | PCKSPGetKSP - Gets the KSP context for a KSP PC. |
187 | |
188 | Not Collective but KSP returned is parallel if PC was parallel |
189 | |
190 | Input Parameter: |
191 | . pc - the preconditioner context |
192 | |
193 | Output Parameters: |
194 | . ksp - the KSP solver |
195 | |
196 | Notes: |
197 | You must call KSPSetUp() before calling PCKSPGetKSP(). |
198 | |
199 | If the PC is not a PCKSP object it raises an error |
200 | |
201 | Level: advanced |
202 | |
203 | @*/ |
204 | PetscErrorCode PCKSPGetKSP(PC pc,KSP *ksp) |
205 | { |
206 | PetscErrorCode ierr; |
207 | |
208 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 208; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
209 | PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),209,__func__ ,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c",85, PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer (pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),209 ,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d" ,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if ( ((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm )0x44000001),209,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d" ,1); else return PetscError(((MPI_Comm)0x44000001),209,__func__ ,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c",62, PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1) ; } } while (0); |
210 | PetscValidPointer(ksp,2)do { if (!ksp) return PetscError(((MPI_Comm)0x44000001),210,__func__ ,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c",85, PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (!PetscCheckPointer (ksp,PETSC_CHAR)) return PetscError(((MPI_Comm)0x44000001),210 ,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2); } while (0); |
211 | ierr = PetscUseMethod(pc,"PCKSPGetKSP_C",(PC,KSP*),(pc,ksp))0; do { PetscErrorCode (*f)(PC,KSP*), __ierr; __ierr = PetscObjectQueryFunction_Private (((PetscObject)pc),("PCKSPGetKSP_C"),(PetscVoidFunction*)(& f));do {if (__builtin_expect(!!(__ierr),0)) return PetscError (((MPI_Comm)0x44000001),211,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,__ierr,PETSC_ERROR_REPEAT," ");} while (0); if (f) {__ierr = (*f)(pc,ksp);do {if (__builtin_expect(!!(__ierr),0)) return PetscError (((MPI_Comm)0x44000001),211,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,__ierr,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError (PetscObjectComm((PetscObject)pc),211,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object" ,"PCKSPGetKSP_C"); } while(0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),211,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
212 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
213 | } |
214 | |
215 | static PetscErrorCode PCSetFromOptions_KSP(PetscOptionItems *PetscOptionsObject,PC pc) |
216 | { |
217 | PC_KSP *jac = (PC_KSP*)pc->data; |
218 | PetscErrorCode ierr; |
219 | |
220 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 220; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
221 | ierr = PetscOptionsHead(PetscOptionsObject,"PC KSP options");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),221,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
222 | if (jac->ksp) { |
223 | ierr = KSPSetFromOptions(jac->ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),223,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
224 | } |
225 | ierr = PetscOptionsTail()0; do {if (PetscOptionsObject->count != 1) do { do { ; if ( petscstack && petscstack->currentsize > 0) { petscstack ->currentsize--; petscstack->function[petscstack->currentsize ] = 0; petscstack->file[petscstack->currentsize] = 0; petscstack ->line[petscstack->currentsize] = 0; petscstack->petscroutine [petscstack->currentsize] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)< (0)) ? (0) : (petscstack->hotdepth-1)); } ; } while (0); return (0);} while (0);} while(0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),225,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
226 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
227 | } |
228 | |
229 | /* ----------------------------------------------------------------------------------*/ |
230 | |
231 | /*MC |
232 | PCKSP - Defines a preconditioner that can consist of any KSP solver. |
233 | This allows, for example, embedding a Krylov method inside a preconditioner. |
234 | |
235 | Options Database Key: |
236 | . -pc_use_amat - use the matrix that defines the linear system, Amat as the matrix for the |
237 | inner solver, otherwise by default it uses the matrix used to construct |
238 | the preconditioner, Pmat (see PCSetOperators()) |
239 | |
240 | Level: intermediate |
241 | |
242 | Notes: |
243 | Using a Krylov method inside another Krylov method can be dangerous (you get divergence or |
244 | the incorrect answer) unless you use KSPFGMRES as the other Krylov method |
245 | |
246 | Developer Notes: |
247 | If the outer Krylov method has a nonzero initial guess it will compute a new residual based on that initial guess |
248 | and pass that as the right hand side into this KSP (and hence this KSP will always have a zero initial guess). For all outer Krylov methods |
249 | except Richardson this is neccessary since Krylov methods, even the flexible ones, need to "see" the result of the action of the preconditioner on the |
250 | input (current residual) vector, the action of the preconditioner cannot depend also on some other vector (the "initial guess"). For |
251 | KSPRICHARDSON it is possible to provide a PCApplyRichardson_PCKSP() that short circuits returning to the KSP object at each iteration to compute the |
252 | residual, see for example PCApplyRichardson_SOR(). We do not implement a PCApplyRichardson_PCKSP() because (1) using a KSP directly inside a Richardson |
253 | is not an efficient algorithm anyways and (2) implementing it for its > 1 would essentially require that we implement Richardson (reimplementing the |
254 | Richardson code) inside the PCApplyRichardson_PCKSP() leading to duplicate code. |
255 | |
256 | .seealso: PCCreate(), PCSetType(), PCType (for list of available types), PC, |
257 | PCSHELL, PCCOMPOSITE, PCSetUseAmat(), PCKSPGetKSP() |
258 | |
259 | M*/ |
260 | |
261 | PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PCCreate_KSP(PC pc) |
262 | { |
263 | PetscErrorCode ierr; |
264 | PC_KSP *jac; |
265 | |
266 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c"; petscstack ->line[petscstack->currentsize] = 266; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); |
267 | ierr = PetscNewLog(pc,&jac)(PetscMallocA(1,PETSC_TRUE,267,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,(size_t)(1)*sizeof(**(((&jac)))),(((&jac)))) || PetscLogObjectMemory ((PetscObject)pc,sizeof(**(&jac))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),267,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
268 | pc->data = (void*)jac; |
269 | |
270 | ierr = PetscMemzero(pc->ops,sizeof(struct _PCOps));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),270,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
271 | pc->ops->apply = PCApply_KSP; |
272 | pc->ops->applytranspose = PCApplyTranspose_KSP; |
273 | pc->ops->setup = PCSetUp_KSP; |
274 | pc->ops->reset = PCReset_KSP; |
275 | pc->ops->destroy = PCDestroy_KSP; |
276 | pc->ops->setfromoptions = PCSetFromOptions_KSP; |
277 | pc->ops->view = PCView_KSP; |
278 | |
279 | ierr = PetscObjectComposeFunction((PetscObject)pc,"PCKSPGetKSP_C",PCKSPGetKSP_KSP)PetscObjectComposeFunction_Private((PetscObject)pc,"PCKSPGetKSP_C" ,(PetscVoidFunction)(PCKSPGetKSP_KSP));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),279,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
280 | ierr = PetscObjectComposeFunction((PetscObject)pc,"PCKSPSetKSP_C",PCKSPSetKSP_KSP)PetscObjectComposeFunction_Private((PetscObject)pc,"PCKSPSetKSP_C" ,(PetscVoidFunction)(PCKSPSetKSP_KSP));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),280,__func__,"/sandbox/petsc/petsc.next/src/ksp/pc/impls/ksp/pcksp.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); |
281 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); |
282 | } |