Changeset 332
- Timestamp:
- 05/11/09 09:44:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/solutions/ice/diagnostic_core_nonlinear.m
r112 r332 55 55 converged=0; 56 56 57 if debug, 58 disp(sprintf('%s',' starting direct shooting method')); 59 end 60 57 displaystring(debug,'\n%s',[' starting direct shooting method']); 61 58 while(~converged), 62 59 … … 105 102 % Solve 106 103 u_f=Solver(K_ff,p_f,solver_type); 107 if debug, 108 disp(sprintf('%s%g',' condition number of stiffness matrix: ',condest(K_ff))); 109 end 104 displaystring(debug,'%s%g',' condition number of stiffness matrix: ',condest(K_ff)); 110 105 111 106 %increment index … … 120 115 %compute relative velocity difference for this step. 121 116 relative_change=norm(soln(count).u_g-soln(count-1).u_g,2)/norm(soln(count-1).u_g,2); 122 123 117 if relative_change<eps_rel, 124 if debug, disp(sprintf('%s %g %s %g',' convergence criterion: norm(du)/norm(u)=',relative_change,' < ',eps_rel)); end118 displaystring(debug,'%s%g%s%g',' convergence criterion: norm(du)/norm(u)=',relative_change,' < ',eps_rel); 125 119 converged=1; 126 120 else 127 if debug, disp(sprintf('%s %g %s %g',' convergence criterion: norm(du)/norm(u)=',relative_change,' > ',eps_rel)); end121 displaystring(debug,'%s%g%s%g',' convergence criterion: norm(du)/norm(u)=',relative_change,' > ',eps_rel); 128 122 converged=0; 129 123 end … … 134 128 135 129 if change<eps_abs, 136 if debug, disp(sprintf('%s %g %s %g %s',' convergence criterion: max(du)=',change,' < ',eps_abs,'m/yr')); end130 displaystring(debug,'%s%g%s%g',' convergence criterion: max(du)=',change,' < ',eps_abs,'m/yr'); 137 131 else 138 if debug, disp(sprintf('%s %g %s %g %s',' convergence criterion: max(du)=',change,' > ',eps_abs,'m/yr')); end132 displaystring(debug,'%s%g%s%g',' convergence criterion: max(du)=',change,' > ',eps_abs,'m/yr'); 139 133 converged=0; 140 134 end
Note:
See TracChangeset
for help on using the changeset viewer.