diff options
author | schnetter <schnetter@1d96b42b-98df-4a6a-9d84-1b24288d4588> | 2007-02-28 03:15:15 +0000 |
---|---|---|
committer | schnetter <schnetter@1d96b42b-98df-4a6a-9d84-1b24288d4588> | 2007-02-28 03:15:15 +0000 |
commit | 086552344ac5763cf0934c2a714f942646e328d9 (patch) | |
tree | 8902dbb0e0372882b3ed3ad8fb3a71e7e24a55ec | |
parent | 82aa48823d72fb92b1b4bdf145f53418c12ef1d1 (diff) |
Support PETSc 2.2.1 API
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllPETSc/trunk@98 1d96b42b-98df-4a6a-9d84-1b24288d4588
-rw-r--r-- | src/petsc_defines.h | 27 |
1 files 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 <sles.h> -#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 <petscsles.h> -#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 <petscmat.h> # include <petscksp.h> # 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 <petscmat.h> +# include <petscksp.h> +# 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 <petscmat.h> # include <petscksp.h> # define SLES KSP |