[dune-fem] Errors with petsc in example-solvers, dune-fem-howto

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Wed Jul 16 18:09:16 CEST 2014


Hi all,

I just installed petsc 3.5.0, and I was curious to see how to use it with dune-fem-1.4.0.
So I tried to play with one of the examples in the howto, but unfortunately I got this compilation error:

In file included from main.cc:43:0:
/usr/local_machine/dune-2.3.1/dune-fem-1.4.0/dune/fem/misc/petsc/petsccommon.hh: In function ‘void Dune::Petsc::initialize(bool, int&, char**&, const char*, const char*, bool)’:
/usr/local_machine/dune-2.3.1/dune-fem-1.4.0/dune/fem/misc/petsc/petsccommon.hh:143:51: error: invalid conversion from ‘Dune::Petsc::ErrorCode (*)(MPI_Comm, int, const char*, const char*, const char*, Dune::Petsc::ErrorCode, PetscErrorType, const char*, void*) {aka int (*)(ompi_communicator_t*, int, const char*, const char*, const char*, int, PetscErrorType, const char*, void*)}’ to ‘PetscErrorCode (*)(MPI_Comm, int, const char*, const char*, PetscErrorCode, PetscErrorType, const char*, void*) {aka int (*)(ompi_communicator_t*, int, const char*, const char*, int, PetscErrorType, const char*, void*)}’ [-fpermissive]
         ::PetscPushErrorHandler( &ErrorHandler, 0 );
                                                   ^
In file included from /usr/local_machine/petsc-3.5.0/include/petscsys.h:1525:0,
                 from /usr/local_machine/petsc-3.5.0/include/petscbag.h:4,
                 from /usr/local_machine/petsc-3.5.0/include/petsc.h:5,
                 from /usr/local_machine/dune-2.3.1/dune-fem-1.4.0/dune/fem/misc/petsc/petsccommon.hh:62,
                 from main.cc:43:
/usr/local_machine/petsc-3.5.0/include/petscerror.h:352:29: error:   initializing argument 1 of ‘PetscErrorCode PetscPushErrorHandler(PetscErrorCode (*)(MPI_Comm, int, const char*, const char*, PetscErrorCode, PetscErrorType, const char*, void*), void*)’ [-fpermissive]
 PETSC_EXTERN PetscErrorCode PetscPushErrorHandler(PetscErrorCode (*handler)(MPI_Comm,int,const char*,const char*,PetscErrorCode,PetscErrorType,const char*,void*),void*);
                             ^
In file included from main.cc:43:0:
/usr/local_machine/dune-2.3.1/dune-fem-1.4.0/dune/fem/misc/petsc/petsccommon.hh: In function ‘void Dune::Petsc::KSPSetOperators(KSP, Mat, Mat, MatStructure)’:
/usr/local_machine/dune-2.3.1/dune-fem-1.4.0/dune/fem/misc/petsc/petsccommon.hh:215:138: error: too many arguments to function ‘PetscErrorCode KSPSetOperators(KSP, Mat, Mat)’
     inline void KSPSetOperators (KSP ksp, Mat Amat, Mat Pmat, MatStructure flag ) { ErrorCheck( ::KSPSetOperators( ksp, Amat, Pmat, flag ) ); }

Is the howto currently working?
If someone of you does manage to use it, which version of petsc do you use? Could it be a problem of compatibility?

Thanks in advance!
Andrea
__________________________________________________________

Andrea Sacconi
PhD student, Applied Mathematics
AMMP Section, Department of Mathematics, Imperial College London,
London SW7 2AZ, UK
a.sacconi11 at imperial.ac.uk




More information about the dune-fem mailing list