[petsc-users] changing solver options at runtime

Barry Smith bsmith at mcs.anl.gov
Thu Feb 26 23:55:58 CST 2015


 TSSetOptionsPrefix() or SNESSetOptionsPrefix() or KSPSetOptionsPrefix(); you can call them at any time and then any call to TS/SNES/KSPSetFromOptions() on that object after that will use the command line options associated with that prefix. Check the manual pages.

  Barry



> On Feb 26, 2015, at 11:01 PM, Manav Bhatia <bhatiamanav at gmail.com> wrote:
> 
> Hi, 
> 
>   Is there a way to change, between two consecutive linear solves, the command line options that petsc uses to initialize the solver (using xxxSetFromOptions)? 
> 
>   I am attempting a multidisciplinary simulation, such that each discipline has its own linear system of equations to solve (perhaps repeatedly), and I wish to set separate options for each disciplinary solve. Passing the options at command line will set the same values for each discipline, which is what I wish to change. Of course, this can be done by writing code to set each option, but the convenience of doing it through command line options is very attractive. 
> 
>   Any help will be greatly appreciated. 
> 
> Thanks,
> Manav
> 
> 



More information about the petsc-users mailing list