Changeset 9679 for issm/trunk/src/m/solutions/convergence.m
- Timestamp:
- 09/08/11 08:07:18 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/solutions/convergence.m
r9597 r9679 6 6 %Get convergence options 7 7 yts=parameters.ConstantsYts; 8 eps_res=parameters.EpsRes;9 eps_rel=parameters.EpsRel;10 eps_abs=parameters.EpsAbs;8 restol=parameters.DiagnosticRestol; 9 reltol=parameters.DiagnosticReltol; 10 abstol=parameters.DiagnosticAbstol; 11 11 12 12 %initialization … … 25 25 error('convergence error message: mechanical equilibrium convergence criterion is NaN!'); 26 26 end 27 if (res<= eps_res),28 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' < ', eps_res*100,' %');27 if (res<=restol), 28 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' < ',restol*100,' %'); 29 29 converged=true; 30 30 else 31 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' > ', eps_res*100,' %');31 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' mechanical equilibrium convergence criterion',res*100,' > ',restol*100,' %'); 32 32 converged=false; 33 33 end 34 34 35 35 %Relative criterion (optional) 36 if ((~isnan( eps_rel)) | (VerboseConvergence())),36 if ((~isnan(reltol)) | (VerboseConvergence())), 37 37 38 38 %compute ndu/nu … … 45 45 46 46 %print criterion 47 if ~isnan( eps_rel),47 if ~isnan(reltol), 48 48 if nu, %avoid "dividing by zero" warning 49 if (ndu/nu<= eps_rel),50 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' < ', eps_rel*100,' %');49 if (ndu/nu<=reltol), 50 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' < ',reltol*100,' %'); 51 51 else 52 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' > ', eps_rel*100,' %');52 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' relative convergence criterion: norm(du)/norm(u)',ndu/nu*100,' > ',reltol*100,' %'); 53 53 converged=false; 54 54 end … … 65 65 66 66 %Absolute criterion (optional) 67 if ((~isnan( eps_abs)) | VerboseConvergence()),67 if ((~isnan(abstol)) | VerboseConvergence()), 68 68 69 69 %compute max(du) … … 75 75 76 76 %print criterion 77 if ~isnan( eps_abs),78 if (nduinf<= eps_abs),79 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' < ', eps_abs,' m/yr');77 if ~isnan(abstol), 78 if (nduinf<=abstol), 79 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' < ',abstol,' m/yr'); 80 80 else 81 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' > ', eps_abs,' m/yr');81 issmprintf(VerboseConvergence(),'%-60s%g%s%g%s',' absolute convergence criterion: max(du)',nduinf,' > ',abstol,' m/yr'); 82 82 converged=false; 83 83 end
Note:
See TracChangeset
for help on using the changeset viewer.