[petsc-users] petsc-3.5 quadruple precision mixed with double

Jed Brown jed at jedbrown.org
Wed Jun 28 20:00:22 CDT 2017


Hao Zhang <hbcbh1999 at gmail.com> writes:

> hi, all:
>
> I'm developing a CFD project, which all the matrix solver is PETSc based.
> It works fine with double precision until I need some more, like quadruple
> precision.

What sort of CFD problem do you need quad precision for?

> Ax = b is the system
> input are double precision
>
> shall I use PetscScalar instead of double?

Yes.

> Or is there a better way to pass double type to PETSc solver?

No, use PetscScalar in your code.

> Or shall I convert double type to quadruple type before passing into the
> solver?

That tends to be uglier and slower.  It also loses accuracy in the
input, which is important for extremely ill-conditioned problems.

> I'm using PETSc 3.5.4. GCC 5.2.0 comiple with float128. I think there
> should be no compiling error.
> I can provide more code part if necessary. Thanks!
>
> -- 
> Hao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170628/11c1f4ca/attachment.pgp>


More information about the petsc-users mailing list