~ubuntu-branches/ubuntu/warty/petsc/warty

« back to all changes in this revision

Viewing changes to src/sles/pc/impls/shell/shellpc.c.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2004-06-07 13:41:43 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040607134143-92p586zrauvie0le
Tags: 2.2.0-2
* Upstream patch level 2.
* New PETSC_BOPT_EXTRA option for different BOPT and lib names, with _c++
  symlinks only for plain and single (closes: #249617).
* New DEBIAN_DIST=contrib option to link with hypre, parmetis (closes:
  #249619).
* Combined petsc-c and petsc-fortran substvars into petsc-compilers.
* Extra quote in -dev prerm eliminates "too many arguments" problem.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<center><a href="shellpc.c">Actual source code: shellpc.c</a></center><br>
2
 
 
3
 
<html>
4
 
<head>
5
 
<title></title>
6
 
<meta name="generator" content="c2html 0.9.1">
7
 
<meta name="date" content="2002-05-31T16:22:06+00:00">
8
 
</head>
9
 
 
10
 
<body bgcolor="#FFFFFF">
11
 
<pre width="80"><a name="line1">  1: </a><font color="#B22222">/*$Id: shellpc.c,v 1.77 2001/08/21 21:03:18 bsmith Exp $*/</font>
12
 
 
13
 
<a name="line3">  3: </a><font color="#B22222">/*</font>
14
 
<a name="line4">  4: </a><font color="#B22222">   This provides a simple shell for Fortran (and C programmers) to </font>
15
 
<a name="line5">  5: </a><font color="#B22222">  create their own preconditioner without writing much interface code.</font>
16
 
<a name="line6">  6: </a><font color="#B22222">*/</font>
17
 
 
18
 
<a name="line8"> 8: </a> #include <A href="../../../../../src/sles/pc/pcimpl.h.html">src/sles/pc/pcimpl.h</A>
19
 
<a name="line9"> 9: </a> #include <A href="../../../../../src/vec/vecimpl.h.html">src/vec/vecimpl.h</A>
20
 
 
21
 
<a name="line11"> 11: </a><font color="#4169E1">typedef</font> <font color="#4169E1">struct</font> {
22
 
<a name="line12"> 12: </a>  void *ctx,*ctxrich;    <font color="#B22222">/* user provided contexts for preconditioner */</font>
23
 
<a name="line13"> 13: </a>  int  (*setup)(void *);
24
 
<a name="line14"> 14: </a>  int  (*apply)(void *,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>);
25
 
<a name="line15"> 15: </a>  int  (*view)(void *,<A href="../../../../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>);
26
 
<a name="line16"> 16: </a>  int  (*applytranspose)(void *,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>);
27
 
<a name="line17"> 17: </a>  int  (*applyrich)(void *,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,PetscReal,PetscReal,PetscReal,int);
28
 
<a name="line18"> 18: </a>  char *name;
29
 
<a name="line19"> 19: </a>} PC_Shell;
30
 
 
31
 
<a name="line21"> 21: </a><strong><font color="#4169E1"><a name="PCSetUp_Shell"></a>static int PCSetUp_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc)</font></strong>
32
 
<a name="line22"> 22: </a>{
33
 
<a name="line23"> 23: </a>  PC_Shell *shell;
34
 
<a name="line24"> 24: </a>  int      ierr;
35
 
 
36
 
<a name="line27"> 27: </a>  shell = (PC_Shell*)pc-&gt;data;
37
 
<a name="line28"> 28: </a>  <font color="#4169E1">if</font> (shell-&gt;setup) {
38
 
<a name="line29"> 29: </a>    ierr  = (*shell-&gt;setup)(shell-&gt;ctx);
39
 
<a name="line30"> 30: </a>  }
40
 
<a name="line31"> 31: </a>  <font color="#4169E1">return</font>(0);
41
 
<a name="line32"> 32: </a>}
42
 
 
43
 
<a name="line34"> 34: </a><strong><font color="#4169E1"><a name="PCApply_Shell"></a>static int PCApply_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> x,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> y)</font></strong>
44
 
<a name="line35"> 35: </a>{
45
 
<a name="line36"> 36: </a>  PC_Shell *shell;
46
 
<a name="line37"> 37: </a>  int      ierr;
47
 
 
48
 
<a name="line40"> 40: </a>  shell = (PC_Shell*)pc-&gt;data;
49
 
<a name="line41"> 41: </a>  <font color="#4169E1">if</font> (!shell-&gt;apply) <A href="../../../../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(1,<font color="#666666">"No apply() routine provided to Shell <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>"</font>);
50
 
<a name="line42"> 42: </a>  ierr  = (*shell-&gt;apply)(shell-&gt;ctx,x,y);
51
 
<a name="line43"> 43: </a>  <font color="#4169E1">return</font>(0);
52
 
<a name="line44"> 44: </a>}
53
 
 
54
 
<a name="line46"> 46: </a><strong><font color="#4169E1"><a name="PCApplyTranspose_Shell"></a>static int PCApplyTranspose_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> x,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> y)</font></strong>
55
 
<a name="line47"> 47: </a>{
56
 
<a name="line48"> 48: </a>  PC_Shell *shell;
57
 
<a name="line49"> 49: </a>  int      ierr;
58
 
 
59
 
<a name="line52"> 52: </a>  shell = (PC_Shell*)pc-&gt;data;
60
 
<a name="line53"> 53: </a>  <font color="#4169E1">if</font> (!shell-&gt;applytranspose) <A href="../../../../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(1,<font color="#666666">"No applytranspose() routine provided to Shell <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>"</font>);
61
 
<a name="line54"> 54: </a>  ierr  = (*shell-&gt;applytranspose)(shell-&gt;ctx,x,y);
62
 
<a name="line55"> 55: </a>  <font color="#4169E1">return</font>(0);
63
 
<a name="line56"> 56: </a>}
64
 
 
65
 
<a name="line58"> 58: </a><strong><font color="#4169E1"><a name="PCApplyRichardson_Shell"></a>static int PCApplyRichardson_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> x,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> y,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> w,PetscReal rtol,PetscReal atol, PetscReal dtol,int it)</font></strong>
66
 
<a name="line59"> 59: </a>{
67
 
<a name="line60"> 60: </a>  int      ierr;
68
 
<a name="line61"> 61: </a>  PC_Shell *shell;
69
 
 
70
 
<a name="line64"> 64: </a>  shell = (PC_Shell*)pc-&gt;data;
71
 
<a name="line65"> 65: </a>  ierr  = (*shell-&gt;applyrich)(shell-&gt;ctxrich,x,y,w,rtol,atol,dtol,it);
72
 
<a name="line66"> 66: </a>  <font color="#4169E1">return</font>(0);
73
 
<a name="line67"> 67: </a>}
74
 
 
75
 
<a name="line69"> 69: </a><strong><font color="#4169E1"><a name="PCDestroy_Shell"></a>static int PCDestroy_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc)</font></strong>
76
 
<a name="line70"> 70: </a>{
77
 
<a name="line71"> 71: </a>  PC_Shell *shell = (PC_Shell*)pc-&gt;data;
78
 
<a name="line72"> 72: </a>  int      ierr;
79
 
 
80
 
<a name="line75"> 75: </a>  <A href="../../../../../docs/manualpages/Sys/PetscFree.html#PetscFree">PetscFree</A>(shell);
81
 
<a name="line76"> 76: </a>  <font color="#4169E1">return</font>(0);
82
 
<a name="line77"> 77: </a>}
83
 
 
84
 
<a name="line79"> 79: </a><strong><font color="#4169E1"><a name="PCView_Shell"></a>static int PCView_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,<A href="../../../../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A> viewer)</font></strong>
85
 
<a name="line80"> 80: </a>{
86
 
<a name="line81"> 81: </a>  PC_Shell   *shell = (PC_Shell*)pc-&gt;data;
87
 
<a name="line82"> 82: </a>  int        ierr;
88
 
<a name="line83"> 83: </a>  <A href="../../../../../docs/manualpages/Sys/PetscTruth.html#PetscTruth">PetscTruth</A> isascii;
89
 
 
90
 
<a name="line86"> 86: </a>  <A href="../../../../../docs/manualpages/Sys/PetscTypeCompare.html#PetscTypeCompare">PetscTypeCompare</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)viewer,PETSC_VIEWER_ASCII,&amp;isascii);
91
 
<a name="line87"> 87: </a>  <font color="#4169E1">if</font> (isascii) {
92
 
<a name="line88"> 88: </a>    <font color="#4169E1">if</font> (shell-&gt;name) {<A href="../../../../../docs/manualpages/Viewer/PetscViewerASCIIPrintf.html#PetscViewerASCIIPrintf">PetscViewerASCIIPrintf</A>(viewer,<font color="#666666">"  Shell: %sn"</font>,shell-&gt;name);}
93
 
<a name="line89"> 89: </a>    <font color="#4169E1">else</font>             {<A href="../../../../../docs/manualpages/Viewer/PetscViewerASCIIPrintf.html#PetscViewerASCIIPrintf">PetscViewerASCIIPrintf</A>(viewer,<font color="#666666">"  Shell: no namen"</font>);}
94
 
<a name="line90"> 90: </a>  }
95
 
<a name="line91"> 91: </a>  <font color="#4169E1">if</font> (shell-&gt;view) {
96
 
<a name="line92"> 92: </a>    <A href="../../../../../docs/manualpages/Viewer/PetscViewerASCIIPushTab.html#PetscViewerASCIIPushTab">PetscViewerASCIIPushTab</A>(viewer);
97
 
<a name="line93"> 93: </a>    ierr  = (*shell-&gt;view)(shell-&gt;ctx,viewer);
98
 
<a name="line94"> 94: </a>    <A href="../../../../../docs/manualpages/Viewer/PetscViewerASCIIPopTab.html#PetscViewerASCIIPopTab">PetscViewerASCIIPopTab</A>(viewer);
99
 
<a name="line95"> 95: </a>  }
100
 
<a name="line96"> 96: </a>  <font color="#4169E1">return</font>(0);
101
 
<a name="line97"> 97: </a>}
102
 
 
103
 
<a name="line99"> 99: </a><font color="#B22222">/* ------------------------------------------------------------------------------*/</font>
104
 
<a name="line100">100: </a><strong><font color="#4169E1"><a name="PCShellSetSetUp_Shell"></a>EXTERN_C_BEGIN</font></strong>
105
 
<a name="line101">101: </a><strong><font color="#4169E1">int PCShellSetSetUp_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc, int (*setup)(void*))</font></strong>
106
 
<a name="line102">102: </a>{
107
 
<a name="line103">103: </a>  PC_Shell *shell;
108
 
 
109
 
<a name="line106">106: </a>  shell        = (PC_Shell*)pc-&gt;data;
110
 
<a name="line107">107: </a>  shell-&gt;setup = setup;
111
 
<a name="line108">108: </a>  <font color="#4169E1">return</font>(0);
112
 
<a name="line109">109: </a>}
113
 
<a name="line110">110: </a><strong><font color="#4169E1"><a name="PCShellSetApply_Shell"></a>EXTERN_C_END</font></strong>
114
 
 
115
 
<a name="line112">112: </a><strong><font color="#4169E1">EXTERN_C_BEGIN</font></strong>
116
 
<a name="line113">113: </a><strong><font color="#4169E1">int PCShellSetApply_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*apply)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>),void *ptr)</font></strong>
117
 
<a name="line114">114: </a>{
118
 
<a name="line115">115: </a>  PC_Shell *shell;
119
 
 
120
 
<a name="line118">118: </a>  shell        = (PC_Shell*)pc-&gt;data;
121
 
<a name="line119">119: </a>  shell-&gt;apply = apply;
122
 
<a name="line120">120: </a>  shell-&gt;ctx   = ptr;
123
 
<a name="line121">121: </a>  <font color="#4169E1">return</font>(0);
124
 
<a name="line122">122: </a>}
125
 
<a name="line123">123: </a><strong><font color="#4169E1"><a name="PCShellSetView_Shell"></a>EXTERN_C_END</font></strong>
126
 
 
127
 
<a name="line125">125: </a><strong><font color="#4169E1">EXTERN_C_BEGIN</font></strong>
128
 
<a name="line126">126: </a><strong><font color="#4169E1">int PCShellSetView_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*view)(void*,<A href="../../../../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>))</font></strong>
129
 
<a name="line127">127: </a>{
130
 
<a name="line128">128: </a>  PC_Shell *shell;
131
 
 
132
 
<a name="line131">131: </a>  shell        = (PC_Shell*)pc-&gt;data;
133
 
<a name="line132">132: </a>  shell-&gt;view = view;
134
 
<a name="line133">133: </a>  <font color="#4169E1">return</font>(0);
135
 
<a name="line134">134: </a>}
136
 
<a name="line135">135: </a><strong><font color="#4169E1"><a name="PCShellSetApplyTranspose_Shell"></a>EXTERN_C_END</font></strong>
137
 
 
138
 
<a name="line137">137: </a><strong><font color="#4169E1">EXTERN_C_BEGIN</font></strong>
139
 
<a name="line138">138: </a><strong><font color="#4169E1">int PCShellSetApplyTranspose_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*applytranspose)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>))</font></strong>
140
 
<a name="line139">139: </a>{
141
 
<a name="line140">140: </a>  PC_Shell *shell;
142
 
 
143
 
<a name="line143">143: </a>  shell                 = (PC_Shell*)pc-&gt;data;
144
 
<a name="line144">144: </a>  shell-&gt;applytranspose = applytranspose;
145
 
<a name="line145">145: </a>  <font color="#4169E1">return</font>(0);
146
 
<a name="line146">146: </a>}
147
 
<a name="line147">147: </a><strong><font color="#4169E1"><a name="PCShellSetName_Shell"></a>EXTERN_C_END</font></strong>
148
 
 
149
 
<a name="line149">149: </a><strong><font color="#4169E1">EXTERN_C_BEGIN</font></strong>
150
 
<a name="line150">150: </a><strong><font color="#4169E1">int PCShellSetName_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,char *name)</font></strong>
151
 
<a name="line151">151: </a>{
152
 
<a name="line152">152: </a>  PC_Shell *shell;
153
 
 
154
 
<a name="line155">155: </a>  shell       = (PC_Shell*)pc-&gt;data;
155
 
<a name="line156">156: </a>  shell-&gt;name = name;
156
 
<a name="line157">157: </a>  <font color="#4169E1">return</font>(0);
157
 
<a name="line158">158: </a>}
158
 
<a name="line159">159: </a><strong><font color="#4169E1"><a name="PCShellGetName_Shell"></a>EXTERN_C_END</font></strong>
159
 
 
160
 
<a name="line161">161: </a><strong><font color="#4169E1">EXTERN_C_BEGIN</font></strong>
161
 
<a name="line162">162: </a><strong><font color="#4169E1">int PCShellGetName_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,char **name)</font></strong>
162
 
<a name="line163">163: </a>{
163
 
<a name="line164">164: </a>  PC_Shell *shell;
164
 
 
165
 
<a name="line167">167: </a>  shell  = (PC_Shell*)pc-&gt;data;
166
 
<a name="line168">168: </a>  *name  = shell-&gt;name;
167
 
<a name="line169">169: </a>  <font color="#4169E1">return</font>(0);
168
 
<a name="line170">170: </a>}
169
 
<a name="line171">171: </a><strong><font color="#4169E1"><a name="PCShellSetApplyRichardson_Shell"></a>EXTERN_C_END</font></strong>
170
 
 
171
 
<a name="line173">173: </a><strong><font color="#4169E1">EXTERN_C_BEGIN</font></strong>
172
 
<a name="line174">174: </a><strong><font color="#4169E1">int PCShellSetApplyRichardson_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*apply)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,PetscReal,PetscReal,PetscReal,int),void *ptr)</font></strong>
173
 
<a name="line175">175: </a>{
174
 
<a name="line176">176: </a>  PC_Shell *shell;
175
 
 
176
 
<a name="line179">179: </a>  shell                     = (PC_Shell*)pc-&gt;data;
177
 
<a name="line180">180: </a>  pc-&gt;ops-&gt;applyrichardson  = PCApplyRichardson_Shell;
178
 
<a name="line181">181: </a>  shell-&gt;applyrich          = apply;
179
 
<a name="line182">182: </a>  shell-&gt;ctxrich            = ptr;
180
 
<a name="line183">183: </a>  <font color="#4169E1">return</font>(0);
181
 
<a name="line184">184: </a>}
182
 
<a name="line185">185: </a>EXTERN_C_END
183
 
 
184
 
<a name="line187">187: </a><font color="#B22222">/* -------------------------------------------------------------------------------*/</font>
185
 
 
186
 
<a name="line189">189: </a><font color="#B22222">/*@C</font>
187
 
<a name="line190">190: </a><font color="#B22222">   <A href="../../../../../docs/manualpages/PC/PCShellSetSetUp.html#PCShellSetSetUp">PCShellSetSetUp</A> - Sets routine to use to "setup" the preconditioner whenever the </font>
188
 
<a name="line191">191: </a><font color="#B22222">   matrix operator is changed.</font>
189
 
 
190
 
<a name="line193">193: </a><font color="#B22222">   Collective on <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A></font>
191
 
 
192
 
<a name="line195">195: </a><font color="#B22222">   Input Parameters:</font>
193
 
<a name="line196">196: </a><font color="#B22222">+  pc - the preconditioner context</font>
194
 
<a name="line197">197: </a><font color="#B22222">.  setup - the application-provided setup routine</font>
195
 
 
196
 
<a name="line199">199: </a><font color="#B22222">   Calling sequence of setup:</font>
197
 
<a name="line200">200: </a><font color="#B22222">.vb</font>
198
 
<a name="line201">201: </a><font color="#B22222">   int setup (void *ptr)</font>
199
 
<a name="line202">202: </a><font color="#B22222">.ve</font>
200
 
 
201
 
<a name="line204">204: </a><font color="#B22222">.  ptr - the application context</font>
202
 
 
203
 
<a name="line206">206: </a><font color="#B22222">   Level: developer</font>
204
 
 
205
 
<a name="line208">208: </a><font color="#B22222">.keywords: <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>, shell, set, setup, user-provided</font>
206
 
 
207
 
<a name="line210">210: </a><font color="#B22222">.seealso: <A href="../../../../../docs/manualpages/PC/PCShellSetApplyRichardson.html#PCShellSetApplyRichardson">PCShellSetApplyRichardson</A>(), <A href="../../../../../docs/manualpages/PC/PCShellSetApply.html#PCShellSetApply">PCShellSetApply</A>()</font>
208
 
<a name="line211">211: </a><font color="#B22222">@*/</font>
209
 
<a name="line212">212: </a><strong><font color="#4169E1"><a name="PCShellSetSetUp"></a>int <A href="../../../../../docs/manualpages/PC/PCShellSetSetUp.html#PCShellSetSetUp">PCShellSetSetUp</A>(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*setup)(void*))</font></strong>
210
 
<a name="line213">213: </a>{
211
 
<a name="line214">214: </a>  int ierr,(*f)(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>,int (*)(void*));
212
 
 
213
 
<a name="line218">218: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectQueryFunction.html#PetscObjectQueryFunction">PetscObjectQueryFunction</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetSetUp_C"</font>,(void (**)(void))&amp;f);
214
 
<a name="line219">219: </a>  <font color="#4169E1">if</font> (f) {
215
 
<a name="line220">220: </a>    (*f)(pc,setup);
216
 
<a name="line221">221: </a>  }
217
 
<a name="line222">222: </a>  <font color="#4169E1">return</font>(0);
218
 
<a name="line223">223: </a>}
219
 
 
220
 
 
221
 
<a name="line226">226: </a><font color="#B22222">/*@C</font>
222
 
<a name="line227">227: </a><font color="#B22222">   <A href="../../../../../docs/manualpages/PC/PCShellSetView.html#PCShellSetView">PCShellSetView</A> - Sets routine to use as viewer of shell preconditioner</font>
223
 
 
224
 
<a name="line229">229: </a><font color="#B22222">   Collective on <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A></font>
225
 
 
226
 
<a name="line231">231: </a><font color="#B22222">   Input Parameters:</font>
227
 
<a name="line232">232: </a><font color="#B22222">+  pc - the preconditioner context</font>
228
 
<a name="line233">233: </a><font color="#B22222">-  view - the application-provided view routine</font>
229
 
 
230
 
<a name="line235">235: </a><font color="#B22222">   Calling sequence of apply:</font>
231
 
<a name="line236">236: </a><font color="#B22222">.vb</font>
232
 
<a name="line237">237: </a><font color="#B22222">   int view(void *ptr,<A href="../../../../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A> v)</font>
233
 
<a name="line238">238: </a><font color="#B22222">.ve</font>
234
 
 
235
 
<a name="line240">240: </a><font color="#B22222">+  ptr - the application context</font>
236
 
<a name="line241">241: </a><font color="#B22222">-  v   - viewer</font>
237
 
 
238
 
<a name="line243">243: </a><font color="#B22222">   Level: developer</font>
239
 
 
240
 
<a name="line245">245: </a><font color="#B22222">.keywords: <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>, shell, set, apply, user-provided</font>
241
 
 
242
 
<a name="line247">247: </a><font color="#B22222">.seealso: <A href="../../../../../docs/manualpages/PC/PCShellSetApplyRichardson.html#PCShellSetApplyRichardson">PCShellSetApplyRichardson</A>(), <A href="../../../../../docs/manualpages/PC/PCShellSetSetUp.html#PCShellSetSetUp">PCShellSetSetUp</A>(), <A href="../../../../../docs/manualpages/PC/PCShellSetApplyTranspose.html#PCShellSetApplyTranspose">PCShellSetApplyTranspose</A>()</font>
243
 
<a name="line248">248: </a><font color="#B22222">@*/</font>
244
 
<a name="line249">249: </a><strong><font color="#4169E1"><a name="PCShellSetView"></a>int <A href="../../../../../docs/manualpages/PC/PCShellSetView.html#PCShellSetView">PCShellSetView</A>(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*view)(void*,<A href="../../../../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>))</font></strong>
245
 
<a name="line250">250: </a>{
246
 
<a name="line251">251: </a>  int ierr,(*f)(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>,int (*)(void*,<A href="../../../../../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>));
247
 
 
248
 
<a name="line255">255: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectQueryFunction.html#PetscObjectQueryFunction">PetscObjectQueryFunction</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetView_C"</font>,(void (**)(void))&amp;f);
249
 
<a name="line256">256: </a>  <font color="#4169E1">if</font> (f) {
250
 
<a name="line257">257: </a>    (*f)(pc,view);
251
 
<a name="line258">258: </a>  }
252
 
<a name="line259">259: </a>  <font color="#4169E1">return</font>(0);
253
 
<a name="line260">260: </a>}
254
 
 
255
 
<a name="line262">262: </a><font color="#B22222">/*@C</font>
256
 
<a name="line263">263: </a><font color="#B22222">   <A href="../../../../../docs/manualpages/PC/PCShellSetApply.html#PCShellSetApply">PCShellSetApply</A> - Sets routine to use as preconditioner.</font>
257
 
 
258
 
<a name="line265">265: </a><font color="#B22222">   Collective on <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A></font>
259
 
 
260
 
<a name="line267">267: </a><font color="#B22222">   Input Parameters:</font>
261
 
<a name="line268">268: </a><font color="#B22222">+  pc - the preconditioner context</font>
262
 
<a name="line269">269: </a><font color="#B22222">.  apply - the application-provided preconditioning routine</font>
263
 
<a name="line270">270: </a><font color="#B22222">-  ptr - pointer to data needed by this routine</font>
264
 
 
265
 
<a name="line272">272: </a><font color="#B22222">   Calling sequence of apply:</font>
266
 
<a name="line273">273: </a><font color="#B22222">.vb</font>
267
 
<a name="line274">274: </a><font color="#B22222">   int apply (void *ptr,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> xin,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> xout)</font>
268
 
<a name="line275">275: </a><font color="#B22222">.ve</font>
269
 
 
270
 
<a name="line277">277: </a><font color="#B22222">+  ptr - the application context</font>
271
 
<a name="line278">278: </a><font color="#B22222">.  xin - input vector</font>
272
 
<a name="line279">279: </a><font color="#B22222">-  xout - output vector</font>
273
 
 
274
 
<a name="line281">281: </a><font color="#B22222">   Level: developer</font>
275
 
 
276
 
<a name="line283">283: </a><font color="#B22222">.keywords: <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>, shell, set, apply, user-provided</font>
277
 
 
278
 
<a name="line285">285: </a><font color="#B22222">.seealso: <A href="../../../../../docs/manualpages/PC/PCShellSetApplyRichardson.html#PCShellSetApplyRichardson">PCShellSetApplyRichardson</A>(), <A href="../../../../../docs/manualpages/PC/PCShellSetSetUp.html#PCShellSetSetUp">PCShellSetSetUp</A>(), <A href="../../../../../docs/manualpages/PC/PCShellSetApplyTranspose.html#PCShellSetApplyTranspose">PCShellSetApplyTranspose</A>()</font>
279
 
<a name="line286">286: </a><font color="#B22222">@*/</font>
280
 
<a name="line287">287: </a><strong><font color="#4169E1"><a name="PCShellSetApply"></a>int <A href="../../../../../docs/manualpages/PC/PCShellSetApply.html#PCShellSetApply">PCShellSetApply</A>(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*apply)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>),void *ptr)</font></strong>
281
 
<a name="line288">288: </a>{
282
 
<a name="line289">289: </a>  int ierr,(*f)(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>,int (*)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>),void *);
283
 
 
284
 
<a name="line293">293: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectQueryFunction.html#PetscObjectQueryFunction">PetscObjectQueryFunction</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetApply_C"</font>,(void (**)(void))&amp;f);
285
 
<a name="line294">294: </a>  <font color="#4169E1">if</font> (f) {
286
 
<a name="line295">295: </a>    (*f)(pc,apply,ptr);
287
 
<a name="line296">296: </a>  }
288
 
<a name="line297">297: </a>  <font color="#4169E1">return</font>(0);
289
 
<a name="line298">298: </a>}
290
 
 
291
 
<a name="line300">300: </a><font color="#B22222">/*@C</font>
292
 
<a name="line301">301: </a><font color="#B22222">   <A href="../../../../../docs/manualpages/PC/PCShellSetApplyTranspose.html#PCShellSetApplyTranspose">PCShellSetApplyTranspose</A> - Sets routine to use as preconditioner transpose.</font>
293
 
 
294
 
<a name="line303">303: </a><font color="#B22222">   Collective on <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A></font>
295
 
 
296
 
<a name="line305">305: </a><font color="#B22222">   Input Parameters:</font>
297
 
<a name="line306">306: </a><font color="#B22222">+  pc - the preconditioner context</font>
298
 
<a name="line307">307: </a><font color="#B22222">-  apply - the application-provided preconditioning transpose routine</font>
299
 
 
300
 
<a name="line309">309: </a><font color="#B22222">   Calling sequence of apply:</font>
301
 
<a name="line310">310: </a><font color="#B22222">.vb</font>
302
 
<a name="line311">311: </a><font color="#B22222">   int applytranspose (void *ptr,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> xin,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> xout)</font>
303
 
<a name="line312">312: </a><font color="#B22222">.ve</font>
304
 
 
305
 
<a name="line314">314: </a><font color="#B22222">+  ptr - the application context</font>
306
 
<a name="line315">315: </a><font color="#B22222">.  xin - input vector</font>
307
 
<a name="line316">316: </a><font color="#B22222">-  xout - output vector</font>
308
 
 
309
 
<a name="line318">318: </a><font color="#B22222">   Level: developer</font>
310
 
 
311
 
<a name="line320">320: </a><font color="#B22222">   Notes: </font>
312
 
<a name="line321">321: </a><font color="#B22222">   Uses the same context variable as <A href="../../../../../docs/manualpages/PC/PCShellSetApply.html#PCShellSetApply">PCShellSetApply</A>().</font>
313
 
 
314
 
<a name="line323">323: </a><font color="#B22222">.keywords: <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>, shell, set, apply, user-provided</font>
315
 
 
316
 
<a name="line325">325: </a><font color="#B22222">.seealso: <A href="../../../../../docs/manualpages/PC/PCShellSetApplyRichardson.html#PCShellSetApplyRichardson">PCShellSetApplyRichardson</A>(), <A href="../../../../../docs/manualpages/PC/PCShellSetSetUp.html#PCShellSetSetUp">PCShellSetSetUp</A>(), <A href="../../../../../docs/manualpages/PC/PCShellSetApply.html#PCShellSetApply">PCShellSetApply</A>()</font>
317
 
<a name="line326">326: </a><font color="#B22222">@*/</font>
318
 
<a name="line327">327: </a><strong><font color="#4169E1"><a name="PCShellSetApplyTranspose"></a>int <A href="../../../../../docs/manualpages/PC/PCShellSetApplyTranspose.html#PCShellSetApplyTranspose">PCShellSetApplyTranspose</A>(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*applytranspose)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>))</font></strong>
319
 
<a name="line328">328: </a>{
320
 
<a name="line329">329: </a>  int ierr,(*f)(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>,int (*)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>));
321
 
 
322
 
<a name="line333">333: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectQueryFunction.html#PetscObjectQueryFunction">PetscObjectQueryFunction</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetApplyTranspose_C"</font>,(void (**)(void))&amp;f);
323
 
<a name="line334">334: </a>  <font color="#4169E1">if</font> (f) {
324
 
<a name="line335">335: </a>    (*f)(pc,applytranspose);
325
 
<a name="line336">336: </a>  }
326
 
<a name="line337">337: </a>  <font color="#4169E1">return</font>(0);
327
 
<a name="line338">338: </a>}
328
 
 
329
 
<a name="line340">340: </a><font color="#B22222">/*@C</font>
330
 
<a name="line341">341: </a><font color="#B22222">   <A href="../../../../../docs/manualpages/PC/PCShellSetName.html#PCShellSetName">PCShellSetName</A> - Sets an optional name to associate with a shell</font>
331
 
<a name="line342">342: </a><font color="#B22222">   preconditioner.</font>
332
 
 
333
 
<a name="line344">344: </a><font color="#B22222">   Not Collective</font>
334
 
 
335
 
<a name="line346">346: </a><font color="#B22222">   Input Parameters:</font>
336
 
<a name="line347">347: </a><font color="#B22222">+  pc - the preconditioner context</font>
337
 
<a name="line348">348: </a><font color="#B22222">-  name - character string describing shell preconditioner</font>
338
 
 
339
 
<a name="line350">350: </a><font color="#B22222">   Level: developer</font>
340
 
 
341
 
<a name="line352">352: </a><font color="#B22222">.keywords: <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>, shell, set, name, user-provided</font>
342
 
 
343
 
<a name="line354">354: </a><font color="#B22222">.seealso: <A href="../../../../../docs/manualpages/PC/PCShellGetName.html#PCShellGetName">PCShellGetName</A>()</font>
344
 
<a name="line355">355: </a><font color="#B22222">@*/</font>
345
 
<a name="line356">356: </a><strong><font color="#4169E1"><a name="PCShellSetName"></a>int <A href="../../../../../docs/manualpages/PC/PCShellSetName.html#PCShellSetName">PCShellSetName</A>(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,char *name)</font></strong>
346
 
<a name="line357">357: </a>{
347
 
<a name="line358">358: </a>  int ierr,(*f)(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>,char *);
348
 
 
349
 
<a name="line362">362: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectQueryFunction.html#PetscObjectQueryFunction">PetscObjectQueryFunction</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetName_C"</font>,(void (**)(void))&amp;f);
350
 
<a name="line363">363: </a>  <font color="#4169E1">if</font> (f) {
351
 
<a name="line364">364: </a>    (*f)(pc,name);
352
 
<a name="line365">365: </a>  }
353
 
<a name="line366">366: </a>  <font color="#4169E1">return</font>(0);
354
 
<a name="line367">367: </a>}
355
 
 
356
 
<a name="line369">369: </a><font color="#B22222">/*@C</font>
357
 
<a name="line370">370: </a><font color="#B22222">   <A href="../../../../../docs/manualpages/PC/PCShellGetName.html#PCShellGetName">PCShellGetName</A> - Gets an optional name that the user has set for a shell</font>
358
 
<a name="line371">371: </a><font color="#B22222">   preconditioner.</font>
359
 
 
360
 
<a name="line373">373: </a><font color="#B22222">   Not Collective</font>
361
 
 
362
 
<a name="line375">375: </a><font color="#B22222">   Input Parameter:</font>
363
 
<a name="line376">376: </a><font color="#B22222">.  pc - the preconditioner context</font>
364
 
 
365
 
<a name="line378">378: </a><font color="#B22222">   Output Parameter:</font>
366
 
<a name="line379">379: </a><font color="#B22222">.  name - character string describing shell preconditioner</font>
367
 
 
368
 
<a name="line381">381: </a><font color="#B22222">   Level: developer</font>
369
 
 
370
 
<a name="line383">383: </a><font color="#B22222">.keywords: <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>, shell, get, name, user-provided</font>
371
 
 
372
 
<a name="line385">385: </a><font color="#B22222">.seealso: <A href="../../../../../docs/manualpages/PC/PCShellSetName.html#PCShellSetName">PCShellSetName</A>()</font>
373
 
<a name="line386">386: </a><font color="#B22222">@*/</font>
374
 
<a name="line387">387: </a><strong><font color="#4169E1"><a name="PCShellGetName"></a>int <A href="../../../../../docs/manualpages/PC/PCShellGetName.html#PCShellGetName">PCShellGetName</A>(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,char **name)</font></strong>
375
 
<a name="line388">388: </a>{
376
 
<a name="line389">389: </a>  int ierr,(*f)(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>,char **);
377
 
 
378
 
<a name="line393">393: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectQueryFunction.html#PetscObjectQueryFunction">PetscObjectQueryFunction</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellGetName_C"</font>,(void (**)(void))&amp;f);
379
 
<a name="line394">394: </a>  <font color="#4169E1">if</font> (f) {
380
 
<a name="line395">395: </a>    (*f)(pc,name);
381
 
<a name="line396">396: </a>  } <font color="#4169E1">else</font> {
382
 
<a name="line397">397: </a>    <A href="../../../../../docs/manualpages/Sys/SETERRQ.html#SETERRQ">SETERRQ</A>(1,<font color="#666666">"Not shell preconditioner, cannot get name"</font>);
383
 
<a name="line398">398: </a>  }
384
 
<a name="line399">399: </a>  <font color="#4169E1">return</font>(0);
385
 
<a name="line400">400: </a>}
386
 
 
387
 
<a name="line402">402: </a><font color="#B22222">/*@C</font>
388
 
<a name="line403">403: </a><font color="#B22222">   <A href="../../../../../docs/manualpages/PC/PCShellSetApplyRichardson.html#PCShellSetApplyRichardson">PCShellSetApplyRichardson</A> - Sets routine to use as preconditioner</font>
389
 
<a name="line404">404: </a><font color="#B22222">   in Richardson iteration.</font>
390
 
 
391
 
<a name="line406">406: </a><font color="#B22222">   Collective on <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A></font>
392
 
 
393
 
<a name="line408">408: </a><font color="#B22222">   Input Parameters:</font>
394
 
<a name="line409">409: </a><font color="#B22222">+  pc - the preconditioner context</font>
395
 
<a name="line410">410: </a><font color="#B22222">.  apply - the application-provided preconditioning routine</font>
396
 
<a name="line411">411: </a><font color="#B22222">-  ptr - pointer to data needed by this routine</font>
397
 
 
398
 
<a name="line413">413: </a><font color="#B22222">   Calling sequence of apply:</font>
399
 
<a name="line414">414: </a><font color="#B22222">.vb</font>
400
 
<a name="line415">415: </a><font color="#B22222">   int apply (void *ptr,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> b,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> x,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A> r,PetscReal rtol,PetscReal atol,PetscReal dtol,int maxits)</font>
401
 
<a name="line416">416: </a><font color="#B22222">.ve</font>
402
 
 
403
 
<a name="line418">418: </a><font color="#B22222">+  ptr - the application context</font>
404
 
<a name="line419">419: </a><font color="#B22222">.  b - right-hand-side</font>
405
 
<a name="line420">420: </a><font color="#B22222">.  x - current iterate</font>
406
 
<a name="line421">421: </a><font color="#B22222">.  r - work space</font>
407
 
<a name="line422">422: </a><font color="#B22222">.  rtol - relative tolerance of residual norm to stop at</font>
408
 
<a name="line423">423: </a><font color="#B22222">.  atol - absolute tolerance of residual norm to stop at</font>
409
 
<a name="line424">424: </a><font color="#B22222">.  dtol - if residual norm increases by this factor than return</font>
410
 
<a name="line425">425: </a><font color="#B22222">-  maxits - number of iterations to run</font>
411
 
 
412
 
<a name="line427">427: </a><font color="#B22222">   Level: developer</font>
413
 
 
414
 
<a name="line429">429: </a><font color="#B22222">.keywords: <A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>, shell, set, apply, Richardson, user-provided</font>
415
 
 
416
 
<a name="line431">431: </a><font color="#B22222">.seealso: <A href="../../../../../docs/manualpages/PC/PCShellSetApply.html#PCShellSetApply">PCShellSetApply</A>()</font>
417
 
<a name="line432">432: </a><font color="#B22222">@*/</font>
418
 
<a name="line433">433: </a><strong><font color="#4169E1"><a name="PCShellSetApplyRichardson"></a>int <A href="../../../../../docs/manualpages/PC/PCShellSetApplyRichardson.html#PCShellSetApplyRichardson">PCShellSetApplyRichardson</A>(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc,int (*apply)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,PetscReal,PetscReal,PetscReal,int),void *ptr)</font></strong>
419
 
<a name="line434">434: </a>{
420
 
<a name="line435">435: </a>  int ierr,(*f)(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A>,int (*)(void*,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,PetscReal,PetscReal,PetscReal,int),void *);
421
 
 
422
 
<a name="line439">439: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectQueryFunction.html#PetscObjectQueryFunction">PetscObjectQueryFunction</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetApplyRichardson_C"</font>,(void (**)(void))&amp;f);
423
 
<a name="line440">440: </a>  <font color="#4169E1">if</font> (f) {
424
 
<a name="line441">441: </a>    (*f)(pc,apply,ptr);
425
 
<a name="line442">442: </a>  }
426
 
<a name="line443">443: </a>  <font color="#4169E1">return</font>(0);
427
 
<a name="line444">444: </a>}
428
 
 
429
 
<a name="line446">446: </a><font color="#B22222">/*</font>
430
 
<a name="line447">447: </a><font color="#B22222">   PCCreate_Shell - creates a new preconditioner class for use with your </font>
431
 
<a name="line448">448: </a><font color="#B22222">          own private data storage format. This is intended to </font>
432
 
<a name="line449">449: </a><font color="#B22222">          provide a simple class to use with <A href="../../../../../docs/manualpages/KSP/KSP.html#KSP">KSP</A>. You should </font>
433
 
<a name="line450">450: </a><font color="#B22222">          not use this if you plan to make a complete class.</font>
434
 
 
435
 
 
436
 
<a name="line453">453: </a><font color="#B22222">  Usage:</font>
437
 
<a name="line454">454: </a><font color="#B22222">$             int (*mult)(void *,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../../../../../docs/manualpages/Vec/Vec.html#Vec">Vec</A>);</font>
438
 
<a name="line455">455: </a><font color="#B22222">$             int (*setup)(void *);</font>
439
 
<a name="line456">456: </a><font color="#B22222">$             <A href="../../../../../docs/manualpages/PC/PCCreate.html#PCCreate">PCCreate</A>(<A href="../../../../../docs/manualpages/Sys/comm.html#comm">comm</A>,&amp;pc);</font>
440
 
<a name="line457">457: </a><font color="#B22222">$             <A href="../../../../../docs/manualpages/PC/PCSetType.html#PCSetType">PCSetType</A>(pc,PC_Shell);</font>
441
 
<a name="line458">458: </a><font color="#B22222">$             <A href="../../../../../docs/manualpages/PC/PCShellSetApply.html#PCShellSetApply">PCShellSetApply</A>(pc,mult,ctx);</font>
442
 
<a name="line459">459: </a><font color="#B22222">$             <A href="../../../../../docs/manualpages/PC/PCShellSetSetUp.html#PCShellSetSetUp">PCShellSetSetUp</A>(pc,setup);       (optional)</font>
443
 
 
444
 
<a name="line461">461: </a><font color="#B22222">*/</font>
445
 
<a name="line462">462: </a><strong><font color="#4169E1"><a name="PCCreate_Shell"></a>EXTERN_C_BEGIN</font></strong>
446
 
<a name="line463">463: </a><strong><font color="#4169E1">int PCCreate_Shell(<A href="../../../../../docs/manualpages/PC/PC.html#PC">PC</A> pc)</font></strong>
447
 
<a name="line464">464: </a>{
448
 
<a name="line465">465: </a>  int      ierr;
449
 
<a name="line466">466: </a>  PC_Shell *shell;
450
 
 
451
 
<a name="line469">469: </a>  pc-&gt;ops-&gt;destroy    = PCDestroy_Shell;
452
 
<a name="line470">470: </a>  ierr                = <A href="../../../../../docs/manualpages/Sys/PetscNew.html#PetscNew">PetscNew</A>(PC_Shell,&amp;shell);
453
 
<a name="line471">471: </a>  PetscLogObjectMemory(pc,<font color="#4169E1">sizeof</font>(PC_Shell));
454
 
 
455
 
<a name="line473">473: </a>  pc-&gt;data         = (void*)shell;
456
 
<a name="line474">474: </a>  pc-&gt;name         = 0;
457
 
 
458
 
<a name="line476">476: </a>  pc-&gt;ops-&gt;apply           = PCApply_Shell;
459
 
<a name="line477">477: </a>  pc-&gt;ops-&gt;view            = PCView_Shell;
460
 
<a name="line478">478: </a>  pc-&gt;ops-&gt;applytranspose  = PCApplyTranspose_Shell;
461
 
<a name="line479">479: </a>  pc-&gt;ops-&gt;applyrichardson = 0;
462
 
<a name="line480">480: </a>  pc-&gt;ops-&gt;setup           = PCSetUp_Shell;
463
 
<a name="line481">481: </a>  pc-&gt;ops-&gt;view            = PCView_Shell;
464
 
 
465
 
<a name="line483">483: </a>  shell-&gt;apply          = 0;
466
 
<a name="line484">484: </a>  shell-&gt;applytranspose = 0;
467
 
<a name="line485">485: </a>  shell-&gt;name           = 0;
468
 
<a name="line486">486: </a>  shell-&gt;applyrich      = 0;
469
 
<a name="line487">487: </a>  shell-&gt;ctxrich        = 0;
470
 
<a name="line488">488: </a>  shell-&gt;ctx            = 0;
471
 
<a name="line489">489: </a>  shell-&gt;setup          = 0;
472
 
<a name="line490">490: </a>  shell-&gt;view           = 0;
473
 
 
474
 
<a name="line492">492: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectComposeFunctionDynamic.html#PetscObjectComposeFunctionDynamic">PetscObjectComposeFunctionDynamic</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetSetUp_C"</font>,<font color="#666666">"PCShellSetSetUp_Shell"</font>,
475
 
<a name="line493">493: </a>                    PCShellSetSetUp_Shell);
476
 
<a name="line494">494: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectComposeFunctionDynamic.html#PetscObjectComposeFunctionDynamic">PetscObjectComposeFunctionDynamic</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetApply_C"</font>,<font color="#666666">"PCShellSetApply_Shell"</font>,
477
 
<a name="line495">495: </a>                    PCShellSetApply_Shell);
478
 
<a name="line496">496: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectComposeFunctionDynamic.html#PetscObjectComposeFunctionDynamic">PetscObjectComposeFunctionDynamic</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetView_C"</font>,<font color="#666666">"PCShellSetView_Shell"</font>,
479
 
<a name="line497">497: </a>                    PCShellSetView_Shell);
480
 
<a name="line498">498: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectComposeFunctionDynamic.html#PetscObjectComposeFunctionDynamic">PetscObjectComposeFunctionDynamic</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetApplyTranspose_C"</font>,
481
 
<a name="line499">499: </a>                    <font color="#666666">"PCShellSetApplyTranspose_Shell"</font>,
482
 
<a name="line500">500: </a>                    PCShellSetApplyTranspose_Shell);
483
 
<a name="line501">501: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectComposeFunctionDynamic.html#PetscObjectComposeFunctionDynamic">PetscObjectComposeFunctionDynamic</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetName_C"</font>,<font color="#666666">"PCShellSetName_Shell"</font>,
484
 
<a name="line502">502: </a>                    PCShellSetName_Shell);
485
 
<a name="line503">503: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectComposeFunctionDynamic.html#PetscObjectComposeFunctionDynamic">PetscObjectComposeFunctionDynamic</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellGetName_C"</font>,<font color="#666666">"PCShellGetName_Shell"</font>,
486
 
<a name="line504">504: </a>                    PCShellGetName_Shell);
487
 
<a name="line505">505: </a>  <A href="../../../../../docs/manualpages/Sys/PetscObjectComposeFunctionDynamic.html#PetscObjectComposeFunctionDynamic">PetscObjectComposeFunctionDynamic</A>((<A href="../../../../../docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</A>)pc,<font color="#666666">"PCShellSetApplyRichardson_C"</font>,
488
 
<a name="line506">506: </a>                    <font color="#666666">"PCShellSetApplyRichardson_Shell"</font>,
489
 
<a name="line507">507: </a>                    PCShellSetApplyRichardson_Shell);
490
 
 
491
 
<a name="line509">509: </a>  <font color="#4169E1">return</font>(0);
492
 
<a name="line510">510: </a>}
493
 
<a name="line511">511: </a>EXTERN_C_END
494
 
 
495
 
 
496
 
 
497
 
 
498
 
 
499
 
 
500
 
</pre>
501
 
</body>
502
 
 
503
 
</html>