You can retrieve real and imaginary part of a petsc scalar from PetscRealPart()/PetscImaginaryPart()
See an example at ~petsc/src/ksp/ksp/examples/tutorials/ex11.c Hong On Wed, 2 Aug 2006, jiaxun hou wrote: > Hong Zhang, > Thanks for your respones. > > In FFTW3, complex type is set by double[2], and it is very easy to handle. > But in Petsc, I don't konw exactly how the complex type be set. And when I > want to do the fast fourier transform on a Petsc's complex vector by using > FFTW3, I get the trouble of the translation between Petsc and FFTW3. > > Regards, > Mason > > Hong Zhang <hzhang at mcs.anl.gov> ?????? > > Manson, > > We don't have support for FFTW3 yet(we are currently developing > an interface between petsc and FFTW3). How do you use FFTW3 in PETSC? > > To build petsc with complex, you need configure petsc with > '--with-scalar-type=complex' > > Hong > > On Wed, 2 Aug 2006, jiaxun hou wrote: > > > Hi all, > > I am trying to using the package FFTW3 in PETSC. > > How can I change type from PetscScalar to complex or double[2]? > > The documentation seems a bit sketchy. > > > > Regards > > Mason > > > > > > > > --------------------------------- > > ????????????????-3.5G??????20M?????? > > > > > --------------------------------- > ????????????-3.5G??????20M????
