[petsc-users] difference between left and right pc

Barry Smith bsmith at mcs.anl.gov
Fri Sep 21 07:45:54 CDT 2012


  What happens if you use -pc_type lu  ?


On Sep 21, 2012, at 3:29 AM, "Klaij, Christiaan" <C.Klaij at marin.nl> wrote:

> 
> When I use zero initial guess, GMRES with left PC gives a huge
> jump in true resisdual between iteration 0 and 1 and GMRES with
> right PC is stuck, the solution remains zero, as mentioned before.
> 
> When I use the Knoll trick, both issues are gone (!) and I do get
> similar results for left and right preconditioning, both for the
> iteration count and for the physics of the solution.
> 
> I didn't expect such a difference, did you? If so, why? Somehow
> it must be related to the rhs being quite small.
> 
> 
> GMRES, left PC, initial guess zero:
>  0 KSP preconditioned resid norm 2.980694554053e+01 true resid norm 7.058057578378e-05 ||r(i)||/||b|| 1.000000000000e+00
>  1 KSP preconditioned resid norm 1.121717063399e+01 true resid norm 2.239445995669e+00 ||r(i)||/||b|| 3.172892783603e+04
>  2 KSP preconditioned resid norm 8.419094257245e+00 true resid norm 4.482707776056e+00 ||r(i)||/||b|| 6.351191848857e+04
>  3 KSP preconditioned resid norm 6.113655853636e+00 true resid norm 1.759217056899e+00 ||r(i)||/||b|| 2.492494623858e+04
>  4 KSP preconditioned resid norm 4.949889403847e+00 true resid norm 3.572848898052e-01 ||r(i)||/||b|| 5.062085224406e+03
>  5 KSP preconditioned resid norm 4.187220822242e+00 true resid norm 7.071876172117e-01 ||r(i)||/||b|| 1.001957846558e+04
>  6 KSP preconditioned resid norm 3.598699773848e+00 true resid norm 6.751395101318e-01 ||r(i)||/||b|| 9.565514344910e+03
>  7 KSP preconditioned resid norm 3.024026574700e+00 true resid norm 5.529170377011e-01 ||r(i)||/||b|| 7.833841415447e+03
>  8 KSP preconditioned resid norm 2.609636515722e+00 true resid norm 5.689992696649e-01 ||r(i)||/||b|| 8.061697759565e+03
>  9 KSP preconditioned resid norm 2.254221020819e+00 true resid norm 4.949259965429e-01 ||r(i)||/||b|| 7.012212510975e+03
> 10 KSP preconditioned resid norm 1.873529244708e+00 true resid norm 6.109183824231e-01 ||r(i)||/||b|| 8.655616302912e+03
> 11 KSP preconditioned resid norm 1.505474576580e+00 true resid norm 4.363808762555e-01 ||r(i)||/||b|| 6.182733300340e+03
> 12 KSP preconditioned resid norm 1.273391808351e+00 true resid norm 5.799473619663e-01 ||r(i)||/||b|| 8.216812565299e+03
> 13 KSP preconditioned resid norm 1.092596045026e+00 true resid norm 5.341297417537e-01 ||r(i)||/||b|| 7.567659172829e+03
> 14 KSP preconditioned resid norm 9.145639963916e-01 true resid norm 4.424631524670e-01 ||r(i)||/||b|| 6.268908230820e+03
> 15 KSP preconditioned resid norm 7.619506249149e-01 true resid norm 4.154893466277e-01 ||r(i)||/||b|| 5.886737845558e+03
> 16 KSP preconditioned resid norm 6.305034569873e-01 true resid norm 4.166530590059e-01 ||r(i)||/||b|| 5.903225559994e+03
> 17 KSP preconditioned resid norm 5.020718919136e-01 true resid norm 3.542538361268e-01 ||r(i)||/||b|| 5.019140637390e+03
> 18 KSP preconditioned resid norm 4.099172843566e-01 true resid norm 2.942812083953e-01 ||r(i)||/||b|| 4.169436209997e+03
> 19 KSP preconditioned resid norm 3.456791256934e-01 true resid norm 2.474858759247e-01 ||r(i)||/||b|| 3.506430390747e+03
> 20 KSP preconditioned resid norm 2.730195605094e-01 true resid norm 2.641558094323e-01 ||r(i)||/||b|| 3.742613410260e+03
> 
> 
> GMRES, right PC, initial guess zero:
>  0 KSP unpreconditioned resid norm 7.058057578378e-05 true resid norm 7.058057578378e-05 ||r(i)||/||b|| 1.000000000000e+00
>  1 KSP unpreconditioned resid norm 7.054747142321e-05 true resid norm 7.054747142321e-05 ||r(i)||/||b|| 9.995309706643e-01
>  2 KSP unpreconditioned resid norm 7.020651831374e-05 true resid norm 7.020651831373e-05 ||r(i)||/||b|| 9.947002774360e-01
>  3 KSP unpreconditioned resid norm 7.006225380599e-05 true resid norm 7.006225374905e-05 ||r(i)||/||b|| 9.926563076458e-01
>  4 KSP unpreconditioned resid norm 7.004188290578e-05 true resid norm 7.004188287852e-05 ||r(i)||/||b|| 9.923676889953e-01
>  5 KSP unpreconditioned resid norm 7.004130975499e-05 true resid norm 7.004130973557e-05 ||r(i)||/||b|| 9.923595685891e-01
>  6 KSP unpreconditioned resid norm 7.002915081650e-05 true resid norm 7.002915072237e-05 ||r(i)||/||b|| 9.921872972090e-01
>  7 KSP unpreconditioned resid norm 6.992906439247e-05 true resid norm 6.992906454226e-05 ||r(i)||/||b|| 9.907692557861e-01
>  8 KSP unpreconditioned resid norm 6.992498998319e-05 true resid norm 6.992499016218e-05 ||r(i)||/||b|| 9.907115291379e-01
>  9 KSP unpreconditioned resid norm 6.992334551935e-05 true resid norm 6.992334572069e-05 ||r(i)||/||b|| 9.906882303552e-01
> 10 KSP unpreconditioned resid norm 6.992269976389e-05 true resid norm 6.992269995062e-05 ||r(i)||/||b|| 9.906790809531e-01
> 11 KSP unpreconditioned resid norm 6.992074987133e-05 true resid norm 6.992075003662e-05 ||r(i)||/||b|| 9.906514541736e-01
> 12 KSP unpreconditioned resid norm 6.991044260131e-05 true resid norm 6.991044279866e-05 ||r(i)||/||b|| 9.905054191230e-01
> 13 KSP unpreconditioned resid norm 6.990672948921e-05 true resid norm 6.990672970817e-05 ||r(i)||/||b|| 9.904528112992e-01
> 14 KSP unpreconditioned resid norm 6.990672944080e-05 true resid norm 6.990672965979e-05 ||r(i)||/||b|| 9.904528106138e-01
> 15 KSP unpreconditioned resid norm 6.990484339200e-05 true resid norm 6.990484361213e-05 ||r(i)||/||b|| 9.904260887057e-01
> 16 KSP unpreconditioned resid norm 6.990392558763e-05 true resid norm 6.990392579857e-05 ||r(i)||/||b|| 9.904130849359e-01
> 17 KSP unpreconditioned resid norm 6.990024258014e-05 true resid norm 6.990024281929e-05 ||r(i)||/||b|| 9.903609037340e-01
> 18 KSP unpreconditioned resid norm 6.989684197988e-05 true resid norm 6.989684218329e-05 ||r(i)||/||b|| 9.903127228292e-01
> 19 KSP unpreconditioned resid norm 6.985738628710e-05 true resid norm 6.985738637250e-05 ||r(i)||/||b|| 9.897537048507e-01
> 20 KSP unpreconditioned resid norm 6.984955654109e-05 true resid norm 6.984955670609e-05 ||r(i)||/||b|| 9.896427725393e-01
> 
> 
> GMRES, left PC, initial guess Knoll:
>  0 KSP preconditioned resid norm 2.536595064974e+01 true resid norm 3.944974940985e-01 ||r(i)||/||b|| 5.589320995439e+03
>  1 KSP preconditioned resid norm 9.971908215661e+00 true resid norm 4.077906575518e-01 ||r(i)||/||b|| 5.777661247778e+03
>  2 KSP preconditioned resid norm 6.198762212035e+00 true resid norm 3.853236164713e-01 ||r(i)||/||b|| 5.459343625245e+03
>  3 KSP preconditioned resid norm 4.951817153938e+00 true resid norm 4.674909493321e-01 ||r(i)||/||b|| 6.623507163843e+03
>  4 KSP preconditioned resid norm 4.188493255513e+00 true resid norm 6.015128222440e-01 ||r(i)||/||b|| 8.522356407046e+03
>  5 KSP preconditioned resid norm 3.598679986172e+00 true resid norm 6.793369544706e-01 ||r(i)||/||b|| 9.624984592810e+03
>  6 KSP preconditioned resid norm 3.026306816528e+00 true resid norm 6.207257182597e-01 ||r(i)||/||b|| 8.794568638278e+03
>  7 KSP preconditioned resid norm 2.611366914822e+00 true resid norm 4.740155530307e-01 ||r(i)||/||b|| 6.715949080421e+03
>  8 KSP preconditioned resid norm 2.255031232002e+00 true resid norm 5.349008778459e-01 ||r(i)||/||b|| 7.578584786338e+03
>  9 KSP preconditioned resid norm 1.876627495146e+00 true resid norm 5.138940584869e-01 ||r(i)||/||b|| 7.280955883120e+03
> 10 KSP preconditioned resid norm 1.506188962283e+00 true resid norm 4.643670549998e-01 ||r(i)||/||b|| 6.579247191499e+03
> 11 KSP preconditioned resid norm 1.273921387013e+00 true resid norm 5.547288999142e-01 ||r(i)||/||b|| 7.859512249002e+03
> 12 KSP preconditioned resid norm 1.093007569456e+00 true resid norm 5.471894647153e-01 ||r(i)||/||b|| 7.752691992647e+03
> 13 KSP preconditioned resid norm 9.148792210071e-01 true resid norm 4.290679437670e-01 ||r(i)||/||b|| 6.079122180604e+03
> 14 KSP preconditioned resid norm 7.621434670141e-01 true resid norm 4.204495201638e-01 ||r(i)||/||b|| 5.957014596364e+03
> 15 KSP preconditioned resid norm 6.309047197329e-01 true resid norm 4.055181123700e-01 ||r(i)||/||b|| 5.745463363919e+03
> 16 KSP preconditioned resid norm 5.022199545208e-01 true resid norm 3.536062790063e-01 ||r(i)||/||b|| 5.009965915970e+03
> 17 KSP preconditioned resid norm 4.100790738955e-01 true resid norm 2.905349530225e-01 ||r(i)||/||b|| 4.116358499434e+03
> 18 KSP preconditioned resid norm 3.458485004841e-01 true resid norm 2.487595183782e-01 ||r(i)||/||b|| 3.524475616921e+03
> 19 KSP preconditioned resid norm 2.732837304652e-01 true resid norm 2.634708100274e-01 ||r(i)||/||b|| 3.732908198915e+03
> 20 KSP preconditioned resid norm 2.148737365384e-01 true resid norm 2.428458971510e-01 ||r(i)||/||b|| 3.440690224672e+03
> 
> 
> GMRES, right PC, initial guess Knoll:
>  0 KSP unpreconditioned resid norm 3.944974940985e-01 true resid norm 3.944974940985e-01 ||r(i)||/||b|| 5.589320995439e+03
>  1 KSP unpreconditioned resid norm 3.940913664585e-01 true resid norm 3.940913578719e-01 ||r(i)||/||b|| 5.583566774507e+03
>  2 KSP unpreconditioned resid norm 3.605826275419e-01 true resid norm 3.605793788632e-01 ||r(i)||/||b|| 5.108762217636e+03
>  3 KSP unpreconditioned resid norm 3.525824891368e-01 true resid norm 3.525778821245e-01 ||r(i)||/||b|| 4.995395379099e+03
>  4 KSP unpreconditioned resid norm 3.517641531250e-01 true resid norm 3.517589349038e-01 ||r(i)||/||b|| 4.983792367766e+03
>  5 KSP unpreconditioned resid norm 3.325758429609e-01 true resid norm 3.325658592167e-01 ||r(i)||/||b|| 4.711860954995e+03
>  6 KSP unpreconditioned resid norm 3.247494282670e-01 true resid norm 3.247370694407e-01 ||r(i)||/||b|| 4.600941063948e+03
>  7 KSP unpreconditioned resid norm 3.189071703462e-01 true resid norm 3.188945126635e-01 ||r(i)||/||b|| 4.518162527328e+03
>  8 KSP unpreconditioned resid norm 3.151473946748e-01 true resid norm 3.151329240142e-01 ||r(i)||/||b|| 4.464867571775e+03
>  9 KSP unpreconditioned resid norm 3.051927212838e-01 true resid norm 3.051755614688e-01 ||r(i)||/||b|| 4.323789627385e+03
> 10 KSP unpreconditioned resid norm 3.002500146185e-01 true resid norm 3.002270739730e-01 ||r(i)||/||b|| 4.253678446783e+03
> 11 KSP unpreconditioned resid norm 2.901039932221e-01 true resid norm 2.900782484433e-01 ||r(i)||/||b|| 4.109887815762e+03
> 12 KSP unpreconditioned resid norm 2.841009118718e-01 true resid norm 2.840678386064e-01 ||r(i)||/||b|| 4.024731102742e+03
> 13 KSP unpreconditioned resid norm 2.688743733473e-01 true resid norm 2.688391744653e-01 ||r(i)||/||b|| 3.808968281711e+03
> 14 KSP unpreconditioned resid norm 2.610702842020e-01 true resid norm 2.610215351071e-01 ||r(i)||/||b|| 3.698206372058e+03
> 15 KSP unpreconditioned resid norm 2.446243742637e-01 true resid norm 2.445600184232e-01 ||r(i)||/||b|| 3.464976244631e+03
> 16 KSP unpreconditioned resid norm 2.349762947397e-01 true resid norm 2.348876685032e-01 ||r(i)||/||b|| 3.327936417276e+03
> 17 KSP unpreconditioned resid norm 2.114220662561e-01 true resid norm 2.113137631497e-01 ||r(i)||/||b|| 2.993936515863e+03
> 18 KSP unpreconditioned resid norm 1.946947209126e-01 true resid norm 1.945481276255e-01 ||r(i)||/||b|| 2.756397570650e+03
> 19 KSP unpreconditioned resid norm 1.769817110500e-01 true resid norm 1.767956706672e-01 ||r(i)||/||b|| 2.504877137994e+03
> 20 KSP unpreconditioned resid norm 1.591399642978e-01 true resid norm 1.589097747697e-01 ||r(i)||/||b|| 2.251466115217e+03
> 
> 
> 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