On 03/31/2015 08:26 PM, Barry Smith wrote:
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
>call PCShellSetApply(pc,PCShellSetUp,ierr)
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.
It works, thank you!
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.
I am confused about this, I am using matrix-free SNES and Manual Section
5.5. says:
The matrix-free variant is allowed only when the linear systems are
solved by an it-
erative method in combination with no preconditioning (PCNONE or
-pc_type none), a user-provided
preconditioner matrix, or a user-provided preconditioner shell
(PCSHELL, discussed in Section 4.4); ...
PETSc has function "PCShellSetApply " which sets routine to use as
preconditioner.
How can I set a routine if I do not use PCSHELL? There is no such
function as " PCSetApply" anymore.