Unfortunately PETSc is restricted to working with only real or complex objects at one time and one cannot mix some real and some complex.
Barry On Jun 3, 2011, at 9:03 AM, Danesh Daroui wrote: > > Hi, > > In this case, can I create a preconditioner in double precision format > and apply it to the system while I am using PETSc to solve a system of > complex numbers? The reason is that I am solving equations in several > iterations and I want to create an ILU-based preconditioner only on real > part of my coefficient matrix because it is unchanged and I can create > and store is once. The imaginary parts will change but they do not have > big effect. > > Regards, > > D. > > > On Tue, 2011-05-31 at 15:13 +0200, Jed Brown wrote: >> On Tue, May 31, 2011 at 08:02, Danesh Daroui <danesh.daroui at ltu.se> >> wrote: >> I have a complex system of equations and I use PETSc to solve >> the >> system. I also use MKL to create the preconditioner using ILU. >> The ILU >> preconditioner is created only on the real part of the >> coefficient >> matrix and is stored in CSR format with the data type of >> double >> precision. I wanted to ask if it is possible to use this >> preconditioner >> and pass it to PETSc in CSR format? Can it be used with PETSc >> complex >> solver although the preconditioner is in double precision >> format? >> >> You can create a PCShell() that manages the factorization using MKL >> and applies the preconditioner stored in whatever format MKL likes. >> PETSc would not know that it is ILU or otherwise. It sounds like that >> would do what you want. > > >
