Changeset 12021


Ignore:
Timestamp:
04/17/12 07:07:23 (13 years ago)
Author:
Mathieu Morlighem
Message:

minor, removed folds for easier debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp

    r12018 r12021  
    4343        #endif
    4444
    45 
    4645        /*Display message*/
    4746        _printf_(VerboseModule(),"   Solving\n");
     
    5251        #endif
    5352
    54         /*First, check that f-set is not NULL, i.e. model is fully constrained: {{{*/
     53        /*First, check that f-set is not NULL, i.e. model is fully constrained:*/
    5554        _assert_(Kff);
    5655        MatGetSize(Kff,&global_m,&global_n); _assert_(global_m==global_m);
     
    5857                *puf=NULL; return;
    5958        }
    60         /*}}}*/
    61         /*Initial guess logic here: {{{1*/
     59
     60        /*Initial guess */
    6261        /*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */
    6362        #if _PETSC_MAJOR_ >= 3
     
    7473                MatGetLocalSize(Kff,&local_m,&local_n);uf=NewVec(local_n,fromlocalsize);
    7574        }
    76         /*}}}*/
    77         /*Process petsc options to see if we are using special types of external solvers: {{{1*/
     75
     76        /*Process petsc options to see if we are using special types of external solvers*/
    7877        PetscOptionsDetermineSolverType(&solver_type);
    7978
    80         /*}}}*/
    81         /*Check the solver is available: {{{1*/
     79        /*Check the solver is available*/
    8280        if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
    83         #if _PETSC_MAJOR_ >=3
    84                 #ifndef _HAVE_MUMPS_
    85                 _error_("requested MUMPS solver, which was not compiled into ISSM!\n");
     81                #if _PETSC_MAJOR_ >=3
     82                        #ifndef _HAVE_MUMPS_
     83                        _error_("requested MUMPS solver, which was not compiled into ISSM!\n");
     84                        #endif
    8685                #endif
     86        }
    8787
    88         #endif
    89         }
    90         /*}}}*/
    91         /*Prepare solver:{{{1*/
     88        /*Prepare solver*/
    9289        KSPCreate(MPI_COMM_WORLD,&ksp);
    9390        KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);
     
    124121        #endif
    125122
    126         /*}}}*/
    127         /*If there is an initial guess for the solution, use it, except if we are using the MUMPS direct solver, where any initial guess will crash Petsc: {{{1*/
     123        /*If there is an initial guess for the solution, use it
     124         * except if we are using the MUMPS direct solver
     125         * where any initial guess will crash Petsc*/
    128126        if (uf0){
    129                 if( (solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU) && (solver_type!=SPOOLESPACKAGE_CHOL) && (solver_type!=SUPERLUDISTPACKAGE)){
     127                if((solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU) && (solver_type!=SPOOLESPACKAGE_CHOL) && (solver_type!=SUPERLUDISTPACKAGE)){
    130128                        KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);
    131129                }
    132130        }
    133         /*}}}*/
    134        
    135         if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
    136131
    137132        /*Solve: */
     133        if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
    138134        KSPSolve(ksp,pf,uf);
    139135       
Note: See TracChangeset for help on using the changeset viewer.