PetscScalar#

PETSc type that represents either a double precision real number, a double precision complex number, a single precision real number, a __float128 real or complex or a __fp16 real - if the code is configured with --with-scalar-type=real,complex --with-precision=single,double,__float128,__fp16

Note#

For MPI calls that require datatypes, use MPIU_SCALAR as the datatype for PetscScalar and MPIU_SUM, etc for operations. They will automatically work correctly regardless of the size of PetscScalar.

See Also#

PetscReal, PetscComplex, PetscInt, MPIU_REAL, MPIU_SCALAR, MPIU_COMPLEX, MPIU_INT, PetscRealPart(), PetscImaginaryPart()

Level#

beginner

Location#

include/petscsystypes.h

Examples#

src/dm/dt/dualspace/impls/lagrange/tutorials/ex2.c
src/dm/field/tutorials/ex1.c
src/dm/impls/plex/tutorials/ex14.c
src/dm/impls/plex/tutorials/ex3f90.F90
src/dm/impls/stag/tutorials/ex4.c
src/dm/impls/stag/tutorials/ex8.c
src/dm/impls/swarm/tutorials/ex1f90.F90
src/dm/tutorials/ex11f90.F90
src/dm/tutorials/ex15.c
src/ksp/ksp/tutorials/ex13f90.F90
src/ksp/ksp/tutorials/ex14f.F90


Edit on GitLab

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages