From 086552344ac5763cf0934c2a714f942646e328d9 Mon Sep 17 00:00:00 2001 From: schnetter Date: Wed, 28 Feb 2007 03:15:15 +0000 Subject: Support PETSc 2.2.1 API git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllPETSc/trunk@98 1d96b42b-98df-4a6a-9d84-1b24288d4588 --- src/petsc_defines.h | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/petsc_defines.h b/src/petsc_defines.h index 7f915e7..6c0a702 100644 --- a/src/petsc_defines.h +++ b/src/petsc_defines.h @@ -18,17 +18,17 @@ #if PETSC_VERSION_MAJOR < 2 || \ (PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR == 0) -/* Up to and including version 2.0.x */ +/* Version 2.0.0 and higher */ # include -#elif PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR <= 1 +#elif PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR == 1 -/* Up to and including version 2.1.x */ +/* Version 2.1.0 and higher */ # include -#elif PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR == 2 +#elif PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR == 2 && PETSC_VERSION_SUBMINOR == 0 -/* Version 2.2.x */ +/* Version 2.2.0 */ # include # include # define SLES KSP @@ -43,9 +43,24 @@ KSPGetIterationNumber(a,d)) # define SLESDestroy KSPDestroy +#elif PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR == 2 + +/* Version 2.2.1 and higher */ +# include +# include +# define SLES KSP +# define SLESCreate KSPCreate +# define SLESSetOperators KSPSetOperators +# define SLESGetKSP(a,b) ((*b) = (a), 0) +# define SLESGetPC KSPGetPC +# define SLESSetFromOptions KSPSetFromOptions +# define SLESSolve(a,b,c,d) (KSPSolve(a,b,c), \ + KSPGetIterationNumber(a,d)) +# define SLESDestroy KSPDestroy + #else -/* Later versions */ +/* Version 2.3.0 and higher */ # include # include # define SLES KSP -- cgit v1.2.3