Changeset 22594


Ignore:
Timestamp:
03/21/18 13:04:11 (7 years ago)
Author:
Mathieu Morlighem
Message:

CHG: reenable petsc dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp

    r20553 r22594  
    5555        IS         isv=NULL;
    5656        IS         isp=NULL;
    57 
    58         #if _PETSC_MAJOR_ >= 3
    5957        char ksp_type[50];
    60         #endif
    6158
    6259        /*Display message*/
     
    8077        /*Initial guess */
    8178        /*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
    8884        if (strcmp(ksp_type,"preonly")==0)uf0=NULL;
    89         #endif
    9085
    9186        /*If initial guess for the solution exists, use it to create uf, otherwise,
     
    10398        /*Check the solver is available*/
    10499        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");
    109102                #endif
    110103        }
     
    119112        KSPSetFromOptions(ksp);
    120113
    121         #if _PETSC_MAJOR_==3
    122114        /*Specific solver?: */
    123115        KSPGetPC(ksp,&pc);
    124116        if (solver_type==MUMPSPACKAGE_LU){
    125                 #if _PETSC_MINOR_==1
    126                 PCFactorSetMatSolverPackage(pc,MAT_SOLVER_MUMPS);
     117                #if defined(_HAVE_PETSCDEV_)
     118                PCFactorSetMatSolverType(pc,MATSOLVERMUMPS);
    127119                #else
    128120                PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS);
     
    147139
    148140        }
    149         #endif
    150141
    151142        /*If there is an initial guess for the solution, use it
Note: See TracChangeset for help on using the changeset viewer.