complex support

Jed Brown jed at
Mon Sep 29 05:23:48 CDT 2008

On Mon 2008-09-29 11:56, bruno.zerbo at wrote:
> Hi, 
> I use PetscScalar to specify a complex and PetscReal for a double,
> 1) is it wrong?

Matrices and vectors have entries of type PetscScalar (which is complex
if compiled --with-scalar-type=complex).  When solving a complex
problem, there will be certain values (e.g. coordinates and parameters)
which are always real.  This is the main purpose of PetscReal.  You
can't make vectors of type PetscReal.

> 2) is there a constant equal to the imaginary unit?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the petsc-users mailing list