It looks like when we change a KSP type, we need to reset the PC_SIDE and KSP_NORM back to the defaults. Is<div>there an argument against this?</div><div><br></div><div>   Matt<br><br><div class="gmail_quote">On Mon, Mar 26, 2012 at 10:02 AM, Lisandro Dalcin <span dir="ltr"><<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Please look at the following example. The error is really unexpected<br>
for me, but I'm not sure how to fix it:<br>
<br>
In [1]: from petsc4py import PETSc<br>
<br>
In [2]: ksp = PETSc.KSP().create()<br>
<br>
In [3]: ksp.setType('gmres')<br>
<br>
In [4]: ksp.getNormType()<br>
Out[4]: 1<br>
<br>
In [5]: ksp.setType('fgmres') # changing ksp type<br>
<br>
In [6]: ksp.getNormType()<br>
---------------------------------------------------------------------------<br>
Error                                     Traceback (most recent call last)<br>
/Users/dalcinl/Devel/PetIGA/demo/<ipython-input-6-40949252afeb> in <module>()<br>
----> 1 ksp.getNormType()<br>
<br>
/Users/dalcinl/Library/Python/2.7/lib/python/site-packages/petsc4py/lib/arch-darwin-c-debug/PETSc.so<br>
in petsc4py.PETSc.KSP.getNormType (src/petsc4py.PETSc.c:106669)()<br>
<br>
Error: error code 56<br>
[0] KSPGetNormType() line 317 in<br>
/Users/dalcinl/Devel/petsc-3.2/src/ksp/ksp/interface/itcreate.c<br>
[0] KSPSetUpNorms_Private() line 284 in<br>
/Users/dalcinl/Devel/petsc-3.2/src/ksp/ksp/interface/itcreate.c<br>
[0] No support for this operation for this object type<br>
[0] KSP fgmres does not support PRECONDITIONED with LEFT<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Lisandro Dalcin<br>
---------------<br>
CIMEC (INTEC/CONICET-UNL)<br>
Predio CONICET-Santa Fe<br>
Colectora RN 168 Km 472, Paraje El Pozo<br>
3000 Santa Fe, Argentina<br>
Tel: <a href="tel:%2B54-342-4511594" value="+543424511594">+54-342-4511594</a> (ext 1011)<br>
Tel/Fax: <a href="tel:%2B54-342-4511169" value="+543424511169">+54-342-4511169</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div>