Changeset 22594
- Timestamp:
- 03/21/18 13:04:11 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp
r20553 r22594 55 55 IS isv=NULL; 56 56 IS isp=NULL; 57 58 #if _PETSC_MAJOR_ >= 359 57 char ksp_type[50]; 60 #endif61 58 62 59 /*Display message*/ … … 80 77 /*Initial guess */ 81 78 /*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */ 82 #if _PETSC_MAJOR_ >= 3 83 #if _PETSC_MINOR_<7 84 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 85 #else 86 PetscOptionsGetString(NULL,PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 87 #endif 79 #if _PETSC_MINOR_<7 80 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 81 #else 82 PetscOptionsGetString(NULL,PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 83 #endif 88 84 if (strcmp(ksp_type,"preonly")==0)uf0=NULL; 89 #endif90 85 91 86 /*If initial guess for the solution exists, use it to create uf, otherwise, … … 103 98 /*Check the solver is available*/ 104 99 if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){ 105 #if _PETSC_MAJOR_ >=3 106 #ifndef _HAVE_MUMPS_ 107 _error_("requested MUMPS solver, which was not compiled into ISSM!\n"); 108 #endif 100 #ifndef _HAVE_MUMPS_ 101 _error_("requested MUMPS solver, which was not compiled into ISSM!\n"); 109 102 #endif 110 103 } … … 119 112 KSPSetFromOptions(ksp); 120 113 121 #if _PETSC_MAJOR_==3122 114 /*Specific solver?: */ 123 115 KSPGetPC(ksp,&pc); 124 116 if (solver_type==MUMPSPACKAGE_LU){ 125 #if _PETSC_MINOR_==1126 PCFactorSetMatSolver Package(pc,MAT_SOLVER_MUMPS);117 #if defined(_HAVE_PETSCDEV_) 118 PCFactorSetMatSolverType(pc,MATSOLVERMUMPS); 127 119 #else 128 120 PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS); … … 147 139 148 140 } 149 #endif150 141 151 142 /*If there is an initial guess for the solution, use it
Note:
See TracChangeset
for help on using the changeset viewer.