[petsc-dev] Use KSPSetUpNorms_Private() in KSPSetFromOptions()
Dmitry Karpeev
karpeev at mcs.anl.gov
Tue Feb 26 16:44:47 CST 2013
These calls compute default values for normtype and pcside based on partial
KSP options,
which can cause an unwarranted error to be thrown.
For example, in code there may be
KSPSetPCSide(ksp, PC_RIGHT); /* hardwired default, e.g., in Moose. */
Now, when I'm using command-line arguments
-ksp_type preonly
an error is thrown, since KSPPREONLY doesn't work with PC_RIGHT.
Fine, I try
-ksp_type preonly -ksp_pc_side left
but still get the same error, since KSPSetUpNorms_Private() is called after
KSP type has been set to KSPPREONLY,
but BEFORE there was a chance to set the PC side!
Is there any reason to keep these calls to KSPSetUpNorms_Private() in
KSPSetFromOptions()?
KSPSetUpNorms_Private() will be just about the first thing called in
KSPSetUp() and will compute the appropriate normtype and pcside,
but now based on complete KSP options.
Not to mention that calling XXXSetUp_YYY() XXXSetFromOptions() seems
generally contrary to PETSc's design
philosophy.
Dmitry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130226/c32ef212/attachment.html>
More information about the petsc-dev
mailing list