Changeset 27656


Ignore:
Timestamp:
03/24/23 12:32:46 (2 years ago)
Author:
Mathieu Morlighem
Message:

CHG: updated counter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/solutionsequences/solutionsequence_newton.cpp

    r23587 r27656  
    4040        femmodel->UpdateConstraintsx();
    4141
    42         count=1;
     42        count=0;
    4343        converged=false;
    4444
     
    5757
    5858                /*Solver forward model*/
    59                 if(count==1 || newton==2){
     59                if(count==0 || newton==2){
    6060                        SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
    6161                        CreateNodalConstraintsx(&ys,femmodel->nodes);
     
    8787                Mergesolutionfromftogx(&ug,uf,ys,femmodel->nodes,femmodel->parameters);delete ys;
    8888                InputUpdateFromSolutionx(femmodel,ug);
     89                count++;
    8990
    9091                /*Check convergence*/
    9192                convergence(&converged,Kff,pf,uf,old_uf,eps_res,eps_rel,eps_abs);
    9293                delete Kff; delete pf;
    93                 if(converged==true){   
    94                         break;
    95                 }
     94                if(converged==true) break;
    9695                if(count>=max_nonlinear_iterations){
    9796                        _printf0_("   maximum number of Newton iterations (" << max_nonlinear_iterations << ") exceeded\n");
    9897                        break;
    9998                }
    100 
    101                 count++;
    10299        }
    103100
    104         if(VerboseConvergence()) _printf0_("\n   total number of iterations: " << count-1 << "\n");
     101        if(VerboseConvergence()) _printf0_("\n   total number of iterations: " << count << "\n");
    105102
    106103        /*clean-up*/
Note: See TracChangeset for help on using the changeset viewer.