On Nov 12, 2013, at 11:55 PM, Roy Stogner wrote:

> 
> On Tue, 12 Nov 2013, Hui Zhang wrote:
> 
>> When I 'make' with complex enabled before in 'configure', I got the following
>> 
>> ./include/libmesh/petsc_vector.h: In member function ‘void 
>> libMesh::PetscVector<T>::zero() [with T = std::complex<double>]’:
>> src/numerics/numeric_vector.C:391:   instantiated from here
>> ./include/libmesh/petsc_vector.h:1008: error: cannot convert 
>> ‘std::complex<double>’ to ‘double __complex__’ in initialization
>> make[1]: *** [src/numerics/libmesh_dbg_la-numeric_vector.lo] Error 1
>> 
>> Note that I compiled petsc with --c-language=c++ and 
>> --with-petsc-scalar=complex.
> 
> Isn't the current PETSc configure.py argument
> "--with-scalar-type=complex"?

Yes, you are right. I used what you said.

> 
> If that's not the problem:
> 
> What version of PETSc are you using?  Our continuous integration tests
> show the complex build working against PETSc 3.3, but I don't think
> we've started automated testing against PETSc 3.4 yet and I'm
> currently using real-valued numbers for all my manual builds.  Maybe
> there's a bug in our complex interface that got exposed by 3.4?

I use petsc-dev updated and compiled today. In petsc_vector.h, line 1008 reads

PetscScalar z=0.0;

Now I modified it to 

PetscScalar z=0.0 + PETSC_i;

then it says ok for this line. But it has more errors

src/numerics/petsc_matrix.C:1125:   instantiated from here
src/numerics/petsc_matrix.C:424: error: cannot convert ‘std::complex<double>’ 
to ‘double __complex__’ for argument ‘4’ to ‘PetscErrorCode 
MatZeroRows(_p_Mat*, PetscInt, const PetscInt*, double __complex__, _p_Vec*, 
_p_Vec*)’

Maybe, I should recompile the petsc and try again.


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to