# 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. Apr 9, 2020 at 13:14

• 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. Apr 9, 2020 at 13:48