[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question regarding PCMG



Concerning the first I understand now.... The equation for
Gauss-Seidel is exactly,

x_{result} = x_{initial guess} + (L+D)^{-1}(b - Ax_{initial guess})

So what the PC_{GS} does is to apply (L+D)^{-1} to a vector.

This changes the form of my first question which I will restate in a following
email.


Sincerely,

-Tsuyoshi Koyma

----- Original Message ----- From: "TsuyoshiKoyama(berkeley)" <tkoyama@xxxxxxxxxxxx>
To: <petsc-users@xxxxxxxxxxx>
Sent: Tuesday, August 14, 2007 2:38 AM
Subject: Re: Question regarding PCMG



Thank you very much for the quick response. Considering the first comment,
after again looking at the Richardson KSP code  I observe the following.
Given the precondioned system,

PAx = Pb

the iteration is conducted as,

x_{n+1} = x_{n} + scale*P(b-Ax_{n})

If  one gives, NonZeroInitialGuess what happens is the following,

1) r = (b-A_x{initial guess})
2) Do the following maxit times,

   x_{new} = x_{old} + scale*Pr
   r = b - x_{new}

Thus if one sets the preconditioner Gauss-Seidel as P_{GS}, then one
iteration produces the following value of x

x_{result} = x_{initial guess} + scale*P_{GS}(b-Ax_{initial guess})

when one desires in a Gauss-Seidel smoother,

x_{result} = x_{initial guess} + (L+D)^{-1}(b - Ux_{initial guess})

where, A = L(strict lower) + D+ U(strict upper)

Does this mean that somehow Petsc internally modifies Amat in the PC
object so that Amat = P, and PC_Apply multiplies by (L+D)^{-1}? Am
I missing some detail or misunderstanding the behavior of PC?

As for the second case, the reason I might not select a coarse solver is since I
am trying to solve a Helmholtz equation and the coarse grid solve might not be
correct enough to apply. Thus, you may just point out that the coarse grid should
be large enough to resolve the so called low frequency error and that if you do so
you should still be able to solve direct, but I was curious on testing different types
of operations at the coarsest level.


In both of the comments I know I can get around them by changing(commenting out) the corresponding source code lines(I assume that this effect will be minimal though I do not
know how much) but I was wondering if some other people had made similar remarks
or questions.


Again, thank you very much.

Sincerely,

Tsuyoshi Koyama

----- Original Message ----- From: "Matthew Knepley" <knepley@xxxxxxxxx>
To: <petsc-users@xxxxxxxxxxx>
Sent: Tuesday, August 14, 2007 1:11 AM
Subject: Re: Question regarding PCMG



On 8/13/07, TsuyoshiKoyama(berkeley) <tkoyama@xxxxxxxxxxxx> wrote:
Dear petsc-users,

I am currently trying to use the PCMG object and
had some questions with the preconditioner.

---------------------------------------------------------
1. In this multigrid preconditioner, the default KSP smoother seems
to be GMRES. If one wanted to use the Gauss-Seidel
iteration as a smoother what would one do?

The solution that I thought feasible is to use the PCGauss-Seidel
and set this into the KSP smoother, and set the Krylov solver
type to KSPPreonly. Since we are using a Gauss-Seidel smoothing
and in the case that we include post-smoothing, the smoother must
be able to incorporate a nonzero initial guess. Thus one would think
of setting the flag for KSPSetInitialGuessNonzero. Unfortunately the
combination of,

-KSPPreonly
-KSPSetInitialGuessNonzero

is rejected in /src/ksp/ksp/impls/preonly/preonly.c line:24. Here it
advises one to use a Richardson but that is not what I would like.

Actually, I believe Richardson is exactly what you want. It is just the simple
update.


2. In the setting of the coarse grid KSP smoother(solver) in PCMG, in the
function
PCSetUp_MG in file /src/ksp/pc/impls/mg/mg.c line:474 there is
a setting that requires one to only be able to use lu, redundant, or
cholesky as the solver in the case of preonly. This means that one would
not again be able to use the type of solver that I have stated above,
a Gauss-Seidel solver or any other user-specified stationary
solver with KSPPreonly.
---------------------------------------------------------

I do not really understand what you want here. Can you give me more explanation?
The coarse problem by default is solved exactly.


 Thanks,

   Matt

If you have any comments or tricks to get by this, it would be very
helpful.

Sincerely,

-Tsuyoshi Koyama
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener