Changeset 1415
- Timestamp:
- 07/29/09 15:40:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m
r1412 r1415 49 49 [soln(count).u_f]=Solver(K_ff,p_f,[],m.parameters); 50 50 51 %Get residue52 residu=norm(K_ff*soln(count).u_f-p_f,2)/norm(p_f,2);53 54 51 %Merge back to g set 55 52 [soln(count).u_g]= Mergesolutionfromftog( soln(count).u_f, m.Gmn, m.ys, m.nodesets ); 56 57 if (count>2),58 soln(count-1).u_f=NaN;59 end60 53 61 54 %Deal with penalty loads … … 65 58 [loads,constraints_converged,num_unstable_constraints] =PenaltyConstraints( m.elements,m.nodes, loads, m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 66 59 67 % Figure out if convergence is reached. 60 %Figure out if convergence have been reached 61 62 %Residue criterion 63 solver_residue=norm(K_ff*soln(count).u_f-p_f,2)/norm(p_f,2); 64 displaystring(m.parameters.debug,'%-53s%g',' convergence criterion: norm(KU-F)/norm(F)',solver_residue); 65 66 %Force equilibrium 67 if count>2, 68 mechanical_residue=norm(K_ff*soln(count-1).u_f-p_f,2)/norm(p_f,2); 69 else 70 mechanical_residue=NaN; 71 end 72 displaystring(m.parameters.debug,'%-53s%g%s',' convergence criterion: norm(KUold-F)/norm(F)',mechanical_residue*100,' %'); 73 74 %Relative criterion 68 75 dug=soln(count).u_g-soln(count-1).u_g; 69 nduinf=norm(dug,inf)*m.parameters.yts;70 76 ndu=norm(dug,2); 71 77 nu=norm(soln(count-1).u_g,2); 72 73 %Residue criterion74 displaystring(m.parameters.debug,'%s%g',' convergence criterion: norm(KU-F)/norm(F)=',residu);75 76 %Relative criterion77 78 if (ndu/nu<=m.parameters.eps_rel), 78 displaystring(m.parameters.debug,'% s%g%s%g',' convergence criterion: norm(du)/norm(u)=',ndu/nu,' < ',m.parameters.eps_rel);79 displaystring(m.parameters.debug,'%-53s%g%s%g%s',' convergence criterion: norm(du)/norm(u)',ndu/nu*100,' < ',m.parameters.eps_rel*100,' %'); 79 80 converged=1; 80 81 else 81 displaystring(m.parameters.debug,'% s%g%s%g',' convergence criterion: norm(du)/norm(u)=',ndu/nu,' > ',m.parameters.eps_rel);82 displaystring(m.parameters.debug,'%-53s%g%s%g%s',' convergence criterion: norm(du)/norm(u)',ndu/nu*100,' > ',m.parameters.eps_rel*100,' %'); 82 83 converged=0; 83 84 end 84 85 85 86 %Absolute criterion 87 nduinf=norm(dug,inf)*m.parameters.yts; 86 88 if ~isnan(m.parameters.eps_abs), 87 89 if (nduinf<=m.parameters.eps_abs), 88 displaystring(m.parameters.debug,'% s%g%s%g',' convergence criterion: max(du)=',nduinf,' < ',m.parameters.eps_abs);90 displaystring(m.parameters.debug,'%-53s%g%s%g%s',' convergence criterion: max(du)',nduinf,' < ',m.parameters.eps_abs,' m/yr'); 89 91 else 90 displaystring(m.parameters.debug,'% s%g%s%g',' convergence criterion: max(du)=',nduinf,' > ',m.parameters.eps_abs);92 displaystring(m.parameters.debug,'%-53s%g%s%g%s',' convergence criterion: max(du)',nduinf,' > ',m.parameters.eps_abs,' m/yr'); 91 93 converged=0; 92 94 end … … 97 99 converged=0; 98 100 end 99 100 %if (count>2),101 % soln(count-1).u_g=NaN;102 %end103 101 end 104 102 105 103 %some cleanup 106 [soln(count).u_f]=NaN;107 108 104 u_g=soln(count).u_g; 105 clear soln 109 106 110 107 %more output might be needed, when running in cielocontrol.m 111 108 nout=max(nargout,1)-1; 112 109 if nout==2, 113 inputs=add(inputs,'velocity', soln(count).u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes);110 inputs=add(inputs,'velocity',u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes); 114 111 m.parameters.kflag=1; m.parameters.pflag=0; 115 112 [K_gg, p_g]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type);
Note:
See TracChangeset
for help on using the changeset viewer.