# Calculating coarse grid matrix in geometric multigird

The coarse grid matrix is calculated via RAP where R,P are the restriction and interpolation matrix,respectively.By checking a typical MG algorithm I want to ask how to calculate efficiently coarse grid matrix in each MG iteration?Isn't it a computational cost to calulate RAP every time until you reach the coarsest level?And why in the above code A is not passed as a parameter in the MG function since we need coarse grid matrix in each level?Somewhere I saw that for 1D Poisson model the coefficients of coarse grid matrix is the same with one on the finer multiplied by 1/4h^2,is this holds for every case?

• For geometric multigrid the grids and therefore the system matrices are given explicitly by the created meshes. The Galerkin product that you mentioned is only used by the algebraic multigrid as far as I know. – vydesaster Apr 9 '20 at 13:14

## 1 Answer

I assume that you mean the algebraic multigrid because you are asking about the Galerkin product.
You typically do not perform the Galerkin product for every iteration as the matrices will not change from iteration to iteration. What you typically do is, you first create all matrices needed for the iterations and then perform the iterations. Even for very large matrices with hundreds of millions of unknowns you do not perform the Galerkin product more than 3 or 4 times. Depending on the method and the parameters. Only the first one or two products are costly as the matrices are quite big but the size reduces quite fast.
For multigrid method you have to pay the extra setup costs but you will save time as you do not need as much iterations compared to CG methods.

• I ment Geometric multigrid.I thought that we also use Galerkin product here beacause I found it on every book about MG.Thank you for make it clear.One last question to see If i fully understand what you said.So in line when we restrict the residual(line 4) Ah is the same matrix as the initial one,but with less rows and columns? – spyros Apr 9 '20 at 13:43
• According to the picture in your original post $h$ is the fine grid and $2h$ is the coarse grid. When you want to restrict the residual you first calculate the residual which is the term im the brackets. Multiplying this with the restriction operator results in the restricted residual. – vydesaster Apr 9 '20 at 13:48
• Yes I got this.I am confused about A.My question was if A on ,let's say for example, level 4 is the same as A in level 5 but with less column and rows due to a coarser mesh.(sorry for my stupid question but i am confused) – spyros Apr 9 '20 at 13:52
• A is different on each level. This is only shown with the different indices. There might be some very simple cases where it is possible to just delete some rows and columns but for the general case this does not work. – vydesaster Apr 9 '20 at 13:54
• So A2h can be a direct analog of Ah on Ω2h? – spyros Apr 9 '20 at 15:12