chaos-polymtl / lethe

Repository for the open-source lethe CFD/DEM/CFD-DEM project
https://chaos-polymtl.github.io/lethe/index.html
GNU Lesser General Public License v2.1
267 stars 59 forks source link

Remove duplicated code in GMG preconditioner #1119

Closed lpsaavedra closed 3 months ago

lpsaavedra commented 3 months ago

Description of the problem

There was a lot of code duplication in the MFNavierStokesPreconditionGMG<dim>::initialize(..) function of the multigrid preconditioners since the smoothers and the coarse-grid solver are almost the same in both cases.

Description of the solution

This PR removes the duplicated code and uses if's statements to differentiate between both multigrid approaches only if strictly needed.

How Has This Been Tested?

Future changes