[petsc-users] PETSC_i

Jin, Shuangshuang Shuangshuang.Jin at pnnl.gov
Mon Jan 11 13:15:27 CST 2016


Hi, I have the following codes (The version of Petsc installed on my machine has PetscScalar set to be complex number):

double ival_re, ival_im;
PetscScalar val;
...
val  = ival_re + PETSC_i * ival_im;

I got a compilation error below:

error: cannot convert 'std::complex<double>' to 'PetscScalar {aka double}' in assignment

Even if I set "val = 1.0 * PETSC_i;", the error stays the same.

Can anyone help to evaluate the problem?

Thanks,
Shuangshuang

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160111/679646a3/attachment.html>


More information about the petsc-users mailing list