PetscScalar, PetscReal

Jed Brown jed at 59A2.org
Thu Nov 12 05:33:45 CST 2009


jarunan at ascomp.ch wrote:
> 
> Hello,
> 
> I would like to ask about PetscScalar.
> - What is PetscScalar by default?(double precision real number?)
> - Is PetscReal represent double precision real number?
> - Is PetscScalar need more memory than PetscReal?

By default they are both double precision reals and thus use the same
amount of memory.  When built with complex, PetscScalar is complex,
hence takes twice as much space.  You should use Scalar for all "state"
variables, Real is for parameters or time that only make sense as reals.

> By the way, in the Petsc command I cannot use Integer or normal real
> array from fortran. I have to convert every variables I need Petsc
> command to PetscInt, PetscReal or PetscScalar. Is it meant to be so? In
> the last version, I used to be able to use common integer or real in
> Petsc code.

Can you be more specific about what no longer works.

Jed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20091112/6f2b111d/attachment.pgp>


More information about the petsc-users mailing list