<div dir="ltr"><span style="font-size:12.8px">Hello,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am using PCGAMG+KSPBCGS for shift and invert spectral transformation in SLEPc. I optimized the options that I need for GAMG using command line:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">-st_ksp_type bcgs</div><div style="font-size:12.8px">-st_pc_type gamg</div><div style="font-size:12.8px">-st_pc_gamg_agg_nsmooths 1</div><div style="font-size:12.8px">-st_mg_levels_ksp_type chebyshev </div><div style="font-size:12.8px">-st_mg_levels_pc_type jacobi </div><div style="font-size:12.8px">-st_mg_levels_ksp_max_it 8 </div><div style="font-size:12.8px">-st_pc_gamg_threshold 0.01<br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">How can I set these options inside my production code? Is okay to use <span style="font-size:12.8px">PetscOptionsSetValue for setting the options as following?</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><div style="font-size:12.8px">          ierr = PetscOptionsSetValue(NULL, "-st_mg_levels_ksp_type", "chebyshev");</div><div style="font-size:12.8px">          chkerr(ierr);</div><div style="font-size:12.8px">          ierr = PetscOptionsSetValue(NULL, "-st_mg_levels_pc_type", "jacobi");</div><div style="font-size:12.8px">          chkerr(ierr);</div><div style="font-size:12.8px">          ierr = PetscOptionsSetValue(NULL, "-st_mg_levels_ksp_max_it", "8");</div><div style="font-size:12.8px">          chkerr(ierr);</div><div style="font-size:12.8px">          ierr = PetscOptionsSetValue(NULL, "-st_pc_gamg_threshold", "0.01");</div><div style="font-size:12.8px">          chkerr(ierr);</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks!</div><div style="font-size:12.8px">Harshad</div></div></div>