complex support

Jed Brown jed at 59A2.org
Mon Sep 29 05:23:48 CDT 2008


On Mon 2008-09-29 11:56, bruno.zerbo at gmail.com 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?

PETSC_i

Jed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080929/8982c9b3/attachment.pgp>


More information about the petsc-users mailing list