Hello,

I could have posted my message on the user list but it seems to me that it's more in the petsc development part. Don't hesitate to tell me if I'm wrong. I am developing a code called cafes that studies fluid-particle interactions in a Stokes fluid. For that, we implemented the whole solver in matrix free on a cartesian grid. The preconditioner is naturally a geometrical multigrid for the velocity. The set of matrix free for each level is set by hand (I worked with Matthew on this a long time ago now!). I would have liked to implement telescope on this part. I started it but I didn't get out of it. So I would like to have your help. What I tried to do was to describe my classical multigrid up to a level N1 and then take the coarse solver and apply the telescope preconditioner to it up to a level N2. I don't know if this is the best way but it seemed the most intuitive. The problem is that I could not get the coarse matrix because the setup is not done yet (I use a DMKSPSetComputeOperators for the matrices).

The construction of the matrix free for each level is here: https://github.com/gouarin/cafes/blob/master/cafes/problem/stokes.hpp#L59-L88

The description of the Stokes preconditioner is described here : https://github.com/gouarin/cafes/blob/master/cafes/problem/stokes.hpp#L109-L162

I have tried multiple implementations without success. For me, the start is to add at line 105 something like

KSP coarse;
ierr = PCMGGetCoarseSolve(pc_i, &coarse);CHKERRQ(ierr);
PC pc_coarse;
ierr = KSPGetPC(coarse, &pc_coarse);CHKERRQ(ierr);
ierr = PCSetType(pc_coarse, PCTELESCOPE);CHKERRQ(ierr);

Then, to create the several matrices of the levels of TELESCOPE, I thought using the same process as before with DMKSPSetComputeOperators. But it doesn't work...
Could you tell me how I can make it work ?

Thanks,
Loic

Reply via email to