[petsc-users] PCDiagonalScale
Barry Smith
bsmith at mcs.anl.gov
Thu Feb 24 08:08:42 CST 2011
On Feb 23, 2011, at 9:45 AM, Klaij, Christiaan wrote:
> I'm trying to understand the use of PCDiagonalScale since I want to apply additional diagonal scaling when solving my linear system.
Do you want to use it exactly for the reason given in
PCSetDiagonalScale - Indicates the left scaling to use to apply an additional left and right
scaling as needed by certain time-stepping codes.
Logically Collective on PC
Input Parameters:
+ pc - the preconditioner context
- s - scaling vector
Level: intermediate
Notes: The system solved via the Krylov method is
$ D M A D^{-1} y = D M b for left preconditioning or
$ D A M D^{-1} z = D b for right preconditioning
>
> As a first step I modified src/ksp/ksp/examples/tutorials/ex2f.F in petsc-3.1-p7 as follows:
>
> 1) at line 87 added 3 lines:
> PC pc
> PCType ptype
> PetscScalar tol
>
> 2) then I uncommented lines 247 -- 252 (the ones to use PCJACOBI)
>
> 3) at line 253 I added :
> call PCDiagonalScale(pc,PETSC_TRUE,ierr)
>
> Running "make ex2f" gives:
>
> ex2f.o: In function `MAIN__':
> ex2f.F:(.text+0x767): undefined reference to `pcdiagonalscale_'
>
> Without the call to PCDiagonalScale "make ex2f" does not give any errors and runs fine...
>
>
> dr. ir. Christiaan Klaij
> CFD Researcher
> Research & Development
> E mailto:C.Klaij at marin.nl
> T +31 317 49 33 44
>
> MARIN
> 2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands
> T +31 317 49 39 11, F +31 317 49 32 45, I www.marin.nl
>
More information about the petsc-users
mailing list