<div class="gmail_quote">On Fri, Jun 3, 2011 at 16:20, Danesh Daroui <span dir="ltr">&lt;<a href="mailto:danesh.daroui@ltu.se">danesh.daroui@ltu.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":17q">Yes that&#39;s exactly what I want to do. I can also use PETSc to calculate<br>
the preconditioner, but can I use it to calculate real part&#39;s ILU while<br>
I am using complex solver?</div></blockquote></div><br><div>No, the scalar type is chosen at configuration time. You can&#39;t mix real and complex Mat and Vec types in the same program (without weird non-portable shared library tricks, and I&#39;m not sure that would even work).</div>
<div><br></div><div>I would just use complex everywhere to check that the algorithm works. You can even create a preconditioning matrix that is just the real part (still using complex arithmetic) to check that the algorithm you propose really works. Then you can do the PCShell implementation, but still put the result in a PETSc Mat which uses complex scalars. Once that works, you can swap out the PETSc Mat for some external library that does ILU in real arithmetic.</div>