The manual is pretty clear on this, but your code is purely algebraic, that is you do not use a DM, and so you will need to use algebraic multigrid (AMG). So you want to look at AMG preconditioners (-pc_type gamg [or hypre if you configured with --download-hypre]).
Mark On Sun, Nov 18, 2018 at 1:28 PM Fazlul Huq via petsc-users < petsc-users@mcs.anl.gov> wrote: > Hello PETSc developers, > > I have solved a problem using ksp. Please find the problem in attachment 1 > and PETSc code for solution in attachment 2. > Now I need to solve the same problem using multigrid. > I never solved problem using multigrid. Can you please guide me about > steps that I should follow > to solve this problem using multigrid. > > Thanks. > Sincerely, > Huq > -- > > Fazlul Huq > Graduate Research Assistant > Department of Nuclear, Plasma & Radiological Engineering (NPRE) > University of Illinois at Urbana-Champaign (UIUC) > E-mail: huq2...@gmail.com >