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

Andreas Dedner a.s.dedner at warwick.ac.uk
Wed Jul 16 18:12:57 CEST 2014


Hi Andrea.
I tested main in dune-fem-howto-1.4/.example-solver/src
With petsc 3.3-p6 its compiling fine. Would be nice if you could figure
out what the compatibility problem
is between the newer Petsc version and dune-fem.
Andreas


On 16/07/14 17:09, Sacconi, Andrea wrote:
> 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
>
> _______________________________________________
> dune-fem mailing list
> dune-fem at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-fem

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-fem/attachments/20140716/d0988053/attachment.htm>


More information about the dune-fem mailing list