Changeset 130
- Timestamp:
- 04/29/09 14:54:53 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/solutions/macayeal/diagnostic.m
r119 r130 25 25 x=md.x; 26 26 y=md.y; 27 28 27 index=md.elements;index=sort(index,2); %necessary 29 28 nods=md.numberofgrids; … … 47 46 drag_type=md.drag_type; 48 47 drag=md.drag; 49 50 48 criterion_rel=md.eps_rel; 51 49 criterion_abs=md.eps_abs; … … 53 51 B=md.B; B_bar=(B(index(:,1))+B(index(:,2))+B(index(:,3)))/3; 54 52 glen_coeff=md.n; 53 54 %initialize velocities if any 55 if (~isnan(md.vx) & ~isnan(md.vy)), 56 u=md.vx/yts; v=md.vy/yts; 57 velocity_is_present=1; 58 else 59 velocity_is_present=0; 60 end 55 61 56 62 %average of p and q over the grids (size nel->nods) … … 266 272 267 273 %Compute viscosity (as in ICE and CIELO) 268 if convergence_count==1;274 if (convergence_count==1), 269 275 %Initialize viscosity 270 nu_bar=viscosity(index,nel,alpha,beta,{},{},B_bar,glen_coeff); 271 elseif convergence_count==2, 276 if ~velocity_is_present; 277 nu_bar=viscosity(index,nel,alpha,beta,{},{},B_bar,glen_coeff); 278 else 279 nu_bar=viscosity(index,nel,alpha,beta,u,v,B_bar,glen_coeff); 280 nu_bar(find(nu_bar<=0))=-nu_bar(find(nu_bar<=0)); 281 u_old=u; v_old=v; 282 end 283 elseif (convergence_count==2), 272 284 nu_bar_oldvalue=nu_bar; 273 285 nu_bar=viscosity(index,nel,alpha,beta,u,v,B_bar,glen_coeff); … … 421 433 422 434 %Test for direct shooting convergence 423 if convergence_count>1,435 if (convergence_count>1 | velocity_is_present), 424 436 425 437 ug=[u_old;v_old];
Note:
See TracChangeset
for help on using the changeset viewer.