[petsc-users] Inquiry about the interpolation and restriction matrix for PCMG

Mark Adams mfadams at lbl.gov
Fri Mar 20 19:24:22 CDT 2020


On Fri, Mar 20, 2020 at 6:26 PM Xiaodong Liu <xliu29 at ncsu.edu> wrote:

> Hi, Petsc team,
>
> I am practising  PCMG using the following case (3DQ1)
>
> https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex45.c.html
>
>
> I have several questions.
> *1)  About the interpolation and restriction matrix*
>
> For both Galerkin and non-Galerkin type, the interpolation matrix P  is
> based on the trilinear interpolation (*I found the source code*) and the
> restriction one R is 1/8*P^T?
>

That sounds right if the course grid operator is not Galerkin. If it
Galerkin you do not need the 1/8 scaling.


> *Could you please tell me where  the source code to define the restriction
> matrix is? *
> *2) About the operator on the coarse level*
>
>  It is straightforward to calculate the operator on the coarse level  for
> Galerkin type by R*A*P. But how did you define the operator for
> non-Galerkin type? Did you use DMRestrict ?
>

When I have these questions I just search for where restricthook is set. Or
run a debugger and step through the code. Maybe someone else knows this.


> Could you please tell me where is the source code to define
> (*link->restricthook)(fine,restrct,rscale,inject,coarse,link->ctx);
> in
> 2933: PetscErrorCode DMRestrict(DM fine,Mat restrct,Vec rscale,Mat
> inject,DM coarse)
> 2934: {
> 2935:   PetscErrorCode    ierr;
> 2936:   DMCoarsenHookLink link;
>
> 2939:   for (link=fine->coarsenhook; link; link=link->next) {
> 2940:     if (link->restricthook) {
> 2941:
> (*link->restricthook)(fine,restrct,rscale,inject,coarse,link->ctx);
> 2942:     }
> 2943:   }
> 2944:   return(0);
> 2945: }
> on
>
> https://www.mcs.anl.gov/petsc/petsc-current/src/dm/interface/dm.c.html#DMRestrict
>
>
> Thanks a lot !
> Take care!
> Xiaodong
>
>
>
> Xiaodong Liu, PhD
> X: Computational Physics Division
> Los Alamos National Laboratory
> P.O. Box 1663,
> Los Alamos, NM 87544
> 505-709-0534
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200320/1cd2ff5f/attachment-0001.html>


More information about the petsc-users mailing list