Changeset 20553


Ignore:
Timestamp:
04/25/16 16:39:30 (9 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added support for PETSc 3.7

Location:
issm/trunk-jpl
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Params/Parameters.cpp

    r19254 r20553  
    560560                PetscOptionsInsertMultipleString(options); //our patch
    561561                #else
     562                #if (_PETSC_MINOR_>=7)
     563                PetscOptionsSetFromOptions(NULL);
     564                PetscOptionsClear(NULL);
     565                #else
    562566                PetscOptionsSetFromOptions();
    563567                PetscOptionsClear();
     568                #endif
    564569                //PetscOptionsSetFromOptions();
    565570                PetscOptionsInsertMultipleString(options); //our patch
  • issm/trunk-jpl/src/c/cores/controltao_core.cpp

    r19345 r20553  
    3636        int                 num_controls,solution_type;
    3737        int                 maxsteps,maxiter;
    38         IssmDouble          fatol,frtol,gatol,grtol,gttol;
     38        IssmDouble          gatol,grtol,gttol;
    3939        AppCtx              user;
    4040        #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
     
    6464        femmodel->parameters->FindParam(&maxsteps,InversionMaxstepsEnum);
    6565        femmodel->parameters->FindParam(&maxiter,InversionMaxiterEnum);
    66         femmodel->parameters->FindParam(&fatol,InversionFatolEnum);
    67         femmodel->parameters->FindParam(&frtol,InversionFrtolEnum);
    6866        femmodel->parameters->FindParam(&gatol,InversionGatolEnum);
    6967        femmodel->parameters->FindParam(&grtol,InversionGrtolEnum);
     
    8583        TaoSetMaximumFunctionEvaluations(tao,maxiter);
    8684        TaoSetMaximumIterations(tao,maxsteps);
    87         TaoSetTolerances(tao,fatol,frtol,gatol,grtol,gttol);
     85        #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_<7)
     86        TaoSetTolerances(tao,0,0,gatol,grtol,gttol);
     87        #else
     88        TaoSetTolerances(tao,gatol,grtol,gttol);
     89        #endif
    8890
    8991        GetVectorFromControlInputsx(&X, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp

    r18223 r20553  
    6464        if(VerboseSolver())PetscOptionsPrint(stdout);
    6565        #else
    66         if(VerboseSolver())PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD);
     66                #if _PETSC_MINOR_<7
     67                if(VerboseSolver())PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD);
     68                #else
     69                if(VerboseSolver())PetscOptionsView(NULL,PETSC_VIEWER_STDOUT_WORLD);
     70                #endif
    6771        #endif
    6872
     
    7781        /*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */
    7882        #if _PETSC_MAJOR_ >= 3
    79         PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg);
     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
    8088        if (strcmp(ksp_type,"preonly")==0)uf0=NULL;
    8189        #endif
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp

    r15564 r20553  
    3131
    3232        /*retrieve mat_type option: */
     33        #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=7)
     34        PetscOptionsGetString(NULL,PETSC_NULL,"-mat_type",&option[0],100,&flag);
     35        #else
    3336        PetscOptionsGetString(PETSC_NULL,"-mat_type",&option[0],100,&flag);
     37        #endif
    3438
    3539        if (strcmp(option,"aijmumps")==0){
     
    5357
    5458        #if _PETSC_MAJOR_ >= 3
    55         PetscOptionsGetString(PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag);
     59                #if (_PETSC_MINOR_>=7)
     60                PetscOptionsGetString(NULL,PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag);
     61                #else
     62                PetscOptionsGetString(PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag);
     63                #endif
    5664        if (strcmp(option,"mumps")==0){
    5765                solver_type=MUMPSPACKAGE_LU;
     
    5967        #endif
    6068
     69        #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=7)
     70        PetscOptionsGetString(NULL,PETSC_NULL,"-issm_option_solver",&option[0],100,&flag);
     71        #else
    6172        PetscOptionsGetString(PETSC_NULL,"-issm_option_solver",&option[0],100,&flag);
     73        #endif
    6274        if (strcmp(option,"FS")==0){
    6375                solver_type=FSSolverEnum;
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp

    r14917 r20553  
    5656                                len--; first[len] = 0;
    5757                        }
     58                        #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 7
    5859                        PetscOptionsSetValue(first,second);
     60                        #else
     61                        PetscOptionsSetValue(NULL,first,second);
     62                        #endif
    5963                        break;
    6064                }
     
    6771                                        len--; first[len] = 0;
    6872                                }
     73                                #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 7
    6974                                PetscOptionsSetValue(first,NULL);
     75                                #else
     76                                PetscOptionsSetValue(NULL,first,NULL);
     77                                #endif
    7078                                /*Preparing next loop step*/
    7179                                first=second;
     
    7886                                        len--; second[len] = 0;
    7987                                }
     88                                #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 7
    8089                                PetscOptionsSetValue(first,second);
     90                                #else
     91                                PetscOptionsSetValue(NULL,first,second);
     92                                #endif
    8193                                first_token=1;
    8294                        }
Note: See TracChangeset for help on using the changeset viewer.