Package: getdp / 2.11.3+dfsg1-2

petsc-dev-5f171b22.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
diff --git a/Kernel/EigenSolve_SLEPC.cpp b/Kernel/EigenSolve_SLEPC.cpp
index 40deaa355998f5b12fc73538d9c237340677e588..774cd2390f1f82df355d1fad6433a2c1dc4fec6b 100644
--- a/Kernel/EigenSolve_SLEPC.cpp
+++ b/Kernel/EigenSolve_SLEPC.cpp
@@ -378,7 +378,10 @@ static void _linearEVP(struct DofData * DofData_P, int numEigenValues,
   PC pc;
   _try(KSPGetPC(ksp, &pc));
   _try(PCSetType(pc, PCLU));
-#if (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
+
+#if (PETSC_VERSION_RELEASE == 0) && defined(PETSC_HAVE_MUMPS)
+  _try(PCFactorSetMatSolverType(pc, "mumps"));
+#elif (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
   _try(PCFactorSetMatSolverPackage(pc, "mumps"));
 #endif
 
@@ -496,7 +499,9 @@ static void _quadraticEVP(struct DofData * DofData_P, int numEigenValues,
     PC pc;
     _try(KSPGetPC(ksp, &pc));
     _try(PCSetType(pc, PCLU));
-#if (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
+#if (PETSC_VERSION_RELEASE == 0) && defined(PETSC_HAVE_MUMPS)
+    _try(PCFactorSetMatSolverType(pc, "mumps"));
+#elif (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
     _try(PCFactorSetMatSolverPackage(pc, "mumps"));
 #endif
   }
@@ -614,7 +619,9 @@ static void _quadraticEVP(struct DofData * DofData_P, int numEigenValues,
     PC pc;
     _try(KSPGetPC(ksp, &pc));
     _try(PCSetType(pc, PCLU));
-#if (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
+#if (PETSC_VERSION_RELEASE == 0) && defined(PETSC_HAVE_MUMPS)
+    _try(PCFactorSetMatSolverType(pc, "mumps"));
+#elif (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
     _try(PCFactorSetMatSolverPackage(pc, "mumps"));
 #endif
     _try(EPSSetFromOptions(eps));
diff --git a/Kernel/LinAlg_PETSC.cpp b/Kernel/LinAlg_PETSC.cpp
index 0fe700be7045e30c0f0588986894e92d95fb3264..a5e9d3de2a5c29cb1751db6b428789281b2d38ea 100644
--- a/Kernel/LinAlg_PETSC.cpp
+++ b/Kernel/LinAlg_PETSC.cpp
@@ -1289,7 +1289,9 @@ static void _solve(gMatrix *A, gVector *B, gSolver *Solver, gVector *X,
     // native PETSc LU)
     _try(KSPSetType(Solver->ksp[kspIndex], "preonly"));
     _try(PCSetType(pc, PCLU));
-#if (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
+#if (PETSC_VERSION_RELEASE == 0)
+    _try(PCFactorSetMatSolverType(pc, "mumps"));
+#elif (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
     _try(PCFactorSetMatSolverPackage(pc, "mumps"));
 #elif (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MKL_PARDISO)
     _try(PCFactorSetMatSolverPackage(pc, "mkl_pardiso"));
@@ -1324,7 +1326,10 @@ static void _solve(gMatrix *A, gVector *B, gSolver *Solver, gVector *X,
       _try(PCGetType(pc, &pctype));
 #endif
 
-#if (PETSC_VERSION_MAJOR > 2)
+#if (PETSC_VERSION_RELEASE == 0)
+      MatSolverType stype;
+      _try(PCFactorGetMatSolverType(pc, &stype));
+#elif (PETSC_VERSION_MAJOR > 2)
       const MatSolverPackage stype;
       _try(PCFactorGetMatSolverPackage(pc, &stype));
 #else
@@ -1530,7 +1535,9 @@ static void _solveNL(gMatrix *A, gVector *B, gMatrix *J, gVector *R, gSolver *So
   _try(KSPGetPC(ksp, &pc));
   _try(KSPSetType(ksp, "preonly"));
   _try(PCSetType(pc, PCLU));
-#if (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
+#if (PETSC_VERSION_RELEASE == 0)
+  _try(PCFactorSetMatSolverType(pc, "mumps"));
+#elif (PETSC_VERSION_MAJOR > 2) && defined(PETSC_HAVE_MUMPS)
   _try(PCFactorSetMatSolverPackage(pc, "mumps"));
 #endif
   _try(SNESSolve(Solver->snes[solverIndex], PETSC_NULL, X->V));