From: Roy S. <roy...@ic...> - 2016-09-15 14:25:27
|
On Thu, 15 Sep 2016, Sahai, Amal wrote: > I have an equation system consisting of multiple Linear Implicit > systems which I am solving using Petsc. What would be the easiest > way to set the size of krylov subspace and the preconditioner being > employed for a particular system? I don't want to use command line > arguments because those get applied across systems. Hmm... for KSP options we do call KSPSetOptionsPrefix, so you ought to be able to use -MySystemNameksp_type cg and such. However: We don't have any test coverage of this in libMesh (or GRINS or FIN-S IIRC), so unless Moose has our back I'm not sure we're doing it properly. It didn't seem to work for me when I gave it a quick try. IMHO we ought to be sticking an underscore at the end of the system name before using it as a prefix... I don't see PCSetOptionsPrefix anywhere, and I'm not sure whether it defaults to "" or to "whatever the KSP was set to". If that's not working right now, we do have ways to set the most basic options in C++ via abstract base classes, but for anything even mildly sophisticated I think you need to cast to PetscLinearSolver, extract the ksp() or pc() reference, and use PETSc methods on those. --- Roy |