<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 03/31/2015 08:26 PM, Barry Smith wrote:<br>
<blockquote
cite="mid:0D2B2AB5-D789-49F6-9EF8-81399BB7A100@mcs.anl.gov"
type="cite">
<pre wrap=""> No, the model is that each time the matrix changes the PCSetUp is called automatically and so is a shell set up if you have provided it, so you need to change your PCShellSetUp() function so that it can be called repeatedly for each new matrix and call
</pre>
<blockquote type="cite" style="color: #000000;">
<pre wrap=""><span class="moz-txt-citetags">> </span>call PCShellSetApply(pc,PCShellSetUp,ierr)
</pre>
</blockquote>
<pre wrap="">when you create the Shell PC.
Then make a test run in the debugger to make sure that your setup is being called each time the matrix changes.
</pre>
</blockquote>
<br>
It works, thank you! <br>
<br>
<blockquote type="cite">
<pre wrap=""> Note: also if you are using ILU preconditioning, you do not need to use PCSHELL, you can just use PCSetType(pc,PCILU) or -pc_type ilu.</pre>
</blockquote>
<br>
I am confused about this, I am using matrix-free SNES and Manual
Section 5.5. says:<br>
<br>
<blockquote type="cite">The matrix-free variant is allowed only when
the linear systems are solved by an it-<br>
erative method in combination with no preconditioning (PCNONE or
-pc_type none), a user-provided<br>
preconditioner matrix, or a user-provided preconditioner shell
(PCSHELL, discussed in Section 4.4); ...</blockquote>
<br>
PETSc has function "PCShellSetApply
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
" which sets routine to use as preconditioner.<br>
How can I set a routine if I do not use PCSHELL? There is no such
function as "
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
PCSetApply" anymore.<br>
</body>
</html>