Changeset 11284


Ignore:
Timestamp:
02/01/12 13:24:45 (13 years ago)
Author:
seroussi
Message:

minor ConvergedEnum should always be a bool

Location:
issm/trunk-jpl/src/c/solvers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/solvers/solver_nonlinear.cpp

    r9761 r11284  
    2222       
    2323        Loads* loads=NULL;
    24         int converged;
     24        bool converged;
    2525        int constraints_converged;
    2626        int num_unstable_constraints;
     
    4343
    4444        count=1;
    45         converged=0;
     45        converged=false;
    4646
    4747        /*Start non-linear iteration using input velocity: */
     
    5050
    5151        //Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
     52        InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
    5253        InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
    5354
     
    7475                if (!constraints_converged) {
    7576                        if (converged){
    76                                 if (num_unstable_constraints <= min_mechanical_constraints) converged=1;
    77                                 else converged=0;
     77                                if (num_unstable_constraints <= min_mechanical_constraints) converged=true;
     78                                else converged=false;
    7879                        }
    7980                }
     
    8182                /*Increase count: */
    8283                count++;
    83                 if(converged==1)break;
     84                if(converged==true)break;
    8485                if(count>=max_nonlinear_iterations){
    8586                        _printf_(true,"   maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations);
  • issm/trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp

    r10997 r11284  
    1414
    1515        /*intermediary: */
    16         Mat Kff_horiz = NULL, Kfs_horiz   = NULL;
    17         Vec ug_horiz  = NULL, uf_horiz  = NULL, old_uf_horiz = NULL;
    18         Vec pf_horiz  = NULL;
    19         Vec df_horiz  = NULL;
    20         Mat Kff_vert  = NULL, Kfs_vert    = NULL;
    21         Vec ug_vert   = NULL, uf_vert   = NULL;
    22         Vec pf_vert   = NULL;
    23         Vec df_vert   = NULL;
    24         Vec ys   = NULL;
    25         int converged;
    26         int constraints_converged;
    27         int num_unstable_constraints;
    28         int count;
     16        Mat  Kff_horiz = NULL, Kfs_horiz   = NULL;
     17        Vec  ug_horiz  = NULL, uf_horiz  = NULL, old_uf_horiz = NULL;
     18        Vec  pf_horiz  = NULL;
     19        Vec  df_horiz  = NULL;
     20        Mat  Kff_vert  = NULL, Kfs_vert    = NULL;
     21        Vec  ug_vert   = NULL, uf_vert   = NULL;
     22        Vec  pf_vert   = NULL;
     23        Vec  df_vert   = NULL;
     24        Vec  ys   = NULL;
     25        bool converged;
     26        int  constraints_converged;
     27        int  num_unstable_constraints;
     28        int  count;
    2929
    3030        /*parameters:*/
    31         int min_mechanical_constraints;
    32         int max_nonlinear_iterations;
    33         int configuration_type;
     31        int  min_mechanical_constraints;
     32        int  max_nonlinear_iterations;
     33        int  configuration_type;
    3434
    3535        /*Recover parameters: */
     
    3939       
    4040        count=1;
    41         converged=0;
     41        converged=false;
    4242
    4343        /*First get ug_horiz:*/
     
    8484                /*Increase count: */
    8585                count++;
    86                 if(converged==1)break;
     86                if(converged==true)break;
    8787                if(count>=max_nonlinear_iterations){
    8888                        _printf_(true,"   maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations);
Note: See TracChangeset for help on using the changeset viewer.