Does TSSetFromOptions(), SNESSetFromOptions() or KSPSetFromOptions() reset all the parameters I previously set or how come my TS/SNES/KSPSetXXX() does not seem to work?
If XXSetFromOptions() is used (with -xxx_type aaaa) to change the type of the object then all parameters associated with the previous type are removed. Otherwise it does not reset parameters. TS/SNES/KSPSetXXX() commands that set properties for a particular type of object (such as KSPGMRESSetRestart()) ONLY work if the object is ALREADY of that type. For example, with KSPCreate(PETSC_COMM_WORLD,&ksp); KSPGMRESSetRestart(ksp,10); the restart will be ignored since the type has not yet been set to GMRES. To have those values take effect you should do one of the following XXXCreate(..,&obj); XXXSetFromOptions(obj); allow setting the type from the command line, if it is not on the command line then the default type is automatically set XXXSetYYYYY(obj,…); if the obj is the appropriate type then the operation takes place XXXSetFromOptions(obj); allow user to overwrite options hardwired in code (optional) The other approach is to replace the first XXXSetFromOptions() to XXXSetType(obj,type)
Related Questions
- Does TSSetFromOptions(), SNESSetFromOptions() or KSPSetFromOptions() reset all the parameters I previously set or how come my TS/SNES/KSPSetXXX() does not seem to work?
- How can the NS-500 (Profibus Indexer) parameters be reset to factory defaults?
- Is administrator intervention required to reset parameters after an attack?