diff options
Diffstat (limited to 'src/petsc_flat_solver.c')
-rw-r--r-- | src/petsc_flat_solver.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/petsc_flat_solver.c b/src/petsc_flat_solver.c index 645502a..200e233 100644 --- a/src/petsc_flat_solver.c +++ b/src/petsc_flat_solver.c @@ -14,22 +14,26 @@ #include "cctk_CommandLine.h" #include "cctk_Parameters.h" -#include "petsc.h" -#include "petscversion.h" +#include <petsc.h> +#include <petscversion.h> #if PETSC_VERSION_MAJOR < 2 || (PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR == 0) -# include "sles.h" -#elif PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR < 2 -# include "petscsles.h" +/* Up to and including version 2.0.x */ +# include <sles.h> +#elif PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR <= 1 +/* Up to and including version 2.1.x */ +# include <petscsles.h> #else -# include "petscmat.h" -# include "petscksp.h" +/* Later versions */ +# 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) (KSPSetRhs((a),(b)),KSPSetSolution((a),(c)),KSPSolve(a),KSPGetIterationNumber(a,d)) +/* # define SLESSolve(a,b,c,d) (KSPSetRhs((a),(b)),KSPSetSolution((a),(c)),KSPSolve(a),KSPGetIterationNumber(a,d)) */ +# define SLESSolve(a,b,c,d) (KSPSolve((a),(b),(c)),KSPGetIterationNumber(a,d)) # define SLESDestroy KSPDestroy #endif |