<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello PETSc Users,<br>
<br>
I am using Matrix-Free SNES solver with the following options<br>
PETSC_OPTIONS="ksp_type gmres -snes_monitor_short -snes_mf
-user_precond"<br>
<br>
and shell-ILU preconditioner that I create as following:<br>
<br>
! ===============================<br>
<br>
call PCSetType(pc,PCSHELL,ierr)<br>
call PCShellSetUp<br>
call PCShellSetApply(pc,PCShellApply,ierr)<br>
call PCShellSetName(pc,"ShellPC",ierr)<br>
<br>
! ===============================<br>
<br>
subroutine PCShellSetUp() <br>
implicit none<br>
<br>
call SetInitialMatrix ! Assambles matrix A<br>
<br>
call PCCreate(PETSC_COMM_WORLD,mf_prec,ierr)<br>
call PCSetType(mf_prec,PCILU,ierr)<br>
call PCSetOperators(mf_prec,A,A,ierr)<br>
call PCSetUp(mf_prec,ierr)<br>
call PCShellSetName(mf_prec,"LinPC",ierr)<br>
<br>
end subroutine PCShellSetUp<br>
<br>
! ===============================<br>
<br>
subroutine PCShellApply(pc_tmp,x_tmp,y_tmp,ierr)<br>
implicit none<br>
PC :: pc_tmp<br>
Vec :: x_tmp,y_tmp<br>
PetscErrorCode :: ierr<br>
<br>
call PCApply(mf_prec,x_tmp,y_tmp,ierr)<br>
<br>
end subroutine PCShellApply<br>
<br>
! ===============================<br>
<br>
* If matrix A changes during a simulation, how can I update
preconditioner? Is calling "PCSetUp(mf_prec,ierr)" enough?<br>
<br>
* Function
<meta http-equiv="content-type" content="text/html; charset=utf-8">
PCView prints out information about type and size of preconditioner.
Can I view/get preconditioner matrix itself? I want to compare it
with reference matrix.<br>
<br>
If I try to MatView factored matrix:<br>
call PCFactorGetMatrix(mf_prec,pcmat,ierr)<br>
call MatView(pcmat, PETSC_VIEWER_STDOUT_SELF,ierr)<br>
<br>
Then I get the following error:<br>
[0]PETSC ERROR: No viewers for factored matrix except ASCII info
or info_detailed<br>
<br>
Thanks!<br>
<br>
<br>
<br>
</body>
</html>