Changeset 932
- Timestamp:
- 06/12/09 07:27:04 (15 years ago)
- Location:
- issm/trunk/src/m/solutions/cielo
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/solutions/cielo/loadresults.m
r922 r932 1 function md=loadresults(md,models,r esults);1 function md=loadresults(md,models,rawresults); 2 2 %LOADRESULTS - load results onto model 3 3 % … … 6 6 % 7 7 % Usage: 8 % md=Loadresults(md, results,m_dh,m_ds,m_dhu)8 % md=Loadresults(md,models,rawresults) 9 9 10 10 %recover models … … 21 21 22 22 %recover results 23 u_g=r esults.u_g;24 p_g=r esults.p_g;23 u_g=rawresults.u_g; 24 p_g=rawresults.p_g; 25 25 26 26 if ~isstruct(md.results), md.results=struct(); end -
issm/trunk/src/m/solutions/cielo/thermal.m
r915 r932 10 10 %Build all models requested for diagnostic simulation 11 11 displaystring(md.debug,'%s',['reading thermal model data']); 12 md.analysis_type='thermal'; m _t=CreateFemModel(md);12 md.analysis_type='thermal'; models.t=CreateFemModel(md); 13 13 14 14 displaystring(md.debug,'%s',['reading melting model data']); 15 md.analysis_type='melting'; m _m=CreateFemModel(md);15 md.analysis_type='melting'; models.m=CreateFemModel(md); 16 16 17 17 % figure out number of dof: just for information purposes. 18 md.dof=m _t.nodesets.fsize;18 md.dof=models.t.nodesets.fsize; 19 19 20 20 %initialize inputs 21 21 displaystring(md.debug,'\n%s',['setup inputs...']); 22 22 inputs=inputlist; 23 inputs=add(inputs,'velocity',m _t.parameters.u_g,'doublevec',3,m_t.parameters.numberofnodes);24 inputs=add(inputs,'pressure',m _t.parameters.p_g,'doublevec',1,m_t.parameters.numberofnodes);25 inputs=add(inputs,'dt',m _t.parameters.dt,'double');23 inputs=add(inputs,'velocity',models.t.parameters.u_g,'doublevec',3,models.t.parameters.numberofnodes); 24 inputs=add(inputs,'pressure',models.t.parameters.p_g,'doublevec',1,models.t.parameters.numberofnodes); 25 inputs=add(inputs,'dt',models.t.parameters.dt,'double'); 26 26 27 27 %call core 28 results=thermal_core(m _t,m_m,inputs,md.sub_analysis_type);28 results=thermal_core(models.t,models.m,inputs,md.sub_analysis_type); 29 29 30 30 %plug onto the model -
issm/trunk/src/m/solutions/cielo/transient2d.m
r915 r932 9 9 %Build all models requested 10 10 displaystring(md.debug,'%s',['reading diagnostic horiz model data']); 11 md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; m _dh=CreateFemModel(md);11 md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; models.dh=CreateFemModel(md); 12 12 13 13 displaystring(md.debug,'\n%s',['reading diagnostic vert model data']); 14 md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; m _dv=CreateFemModel(md);14 md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; models.dv=CreateFemModel(md); 15 15 16 16 displaystring(md.debug,'\n%s',['reading diagnostic stokes model data']); 17 md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; m _ds=CreateFemModel(md);17 md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; models.ds=CreateFemModel(md); 18 18 19 19 displaystring(md.debug,'\n%s',['reading diagnostic hutter model data']); 20 md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; m _dhu=CreateFemModel(md);20 md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; models.dhu=CreateFemModel(md); 21 21 22 22 displaystring(md.debug,'\n%s',['reading surface and bed slope computation model data']); 23 md.analysis_type='slope_compute'; md.sub_analysis_type=''; m _sl=CreateFemModel(md);23 md.analysis_type='slope_compute'; md.sub_analysis_type=''; models.sl=CreateFemModel(md); 24 24 25 25 displaystring(md.debug,'%s',['reading prognostic model data']); 26 md.analysis_type='prognostic'; m _p=CreateFemModel(md);26 md.analysis_type='prognostic'; models.p=CreateFemModel(md); 27 27 28 28 %initialize solution … … 30 30 solution.step=1; 31 31 solution.time=0; 32 solution.u_g=m _dh.parameters.u_g(dofsetgen([1,2],3,length(m_dh.parameters.u_g)));32 solution.u_g=models.dh.parameters.u_g(dofsetgen([1,2],3,length(models.dh.parameters.u_g))); 33 33 solution.p_g=[]; 34 solution.h_g=m _p.parameters.h_g;35 solution.s_g=m _p.parameters.s_g;36 solution.b_g=m _p.parameters.b_g;34 solution.h_g=models.p.parameters.h_g; 35 solution.s_g=models.p.parameters.s_g; 36 solution.b_g=models.p.parameters.b_g; 37 37 38 38 %initialize inputs 39 39 displaystring(md.debug,'\n%s',['setup inputs...']); 40 40 inputs=inputlist; 41 inputs=add(inputs,'velocity',solution.u_g,'doublevec',2,m _p.parameters.numberofnodes);42 inputs=add(inputs,'melting',m _p.parameters.m_g,'doublevec',1,m_p.parameters.numberofnodes);43 inputs=add(inputs,'accumulation',m _p.parameters.a_g,'doublevec',1,m_p.parameters.numberofnodes);44 inputs=add(inputs,'dt',m _p.parameters.dt,'double');41 inputs=add(inputs,'velocity',solution.u_g,'doublevec',2,models.p.parameters.numberofnodes); 42 inputs=add(inputs,'melting',models.p.parameters.m_g,'doublevec',1,models.p.parameters.numberofnodes); 43 inputs=add(inputs,'accumulation',models.p.parameters.a_g,'doublevec',1,models.p.parameters.numberofnodes); 44 inputs=add(inputs,'dt',models.p.parameters.dt,'double'); 45 45 46 46 % figure out number of dof: just for information purposes. 47 md.dof=modelsize(m _dh,m_dv,m_ds,m_dhu,m_sl);47 md.dof=modelsize(models); 48 48 49 49 %first time step is given by model. 50 dt=m _p.parameters.dt;51 finaltime=m _p.parameters.ndt;50 dt=models.p.parameters.dt; 51 finaltime=models.p.parameters.ndt; 52 52 time=dt; 53 yts=m _p.parameters.yts;53 yts=models.p.parameters.yts; 54 54 n=1; %counter 55 55 … … 62 62 63 63 %update inputs 64 inputs=add(inputs,'thickness',solution(n).h_g,'doublevec',1,m _p.parameters.numberofnodes);65 inputs=add(inputs,'surface',solution(n).s_g,'doublevec',1,m _p.parameters.numberofnodes);66 inputs=add(inputs,'bed',solution(n).b_g,'doublevec',1,m _p.parameters.numberofnodes);64 inputs=add(inputs,'thickness',solution(n).h_g,'doublevec',1,models.p.parameters.numberofnodes); 65 inputs=add(inputs,'surface',solution(n).s_g,'doublevec',1,models.p.parameters.numberofnodes); 66 inputs=add(inputs,'bed',solution(n).b_g,'doublevec',1,models.p.parameters.numberofnodes); 67 67 68 68 %Deal with velocities. 69 69 70 70 %Get horizontal solution. 71 [solution(n+1).u_g solution(n+1).p_g]=diagnostic_core(m_dh,m_dhu,m_dv,m_ds,m_sl,inputs); 71 resultsdiag=diagnostic_core(models,inputs); 72 solution(n+1).u_g=resultsdiag.u_g; solution(n+1).p_g=resultsdiag.p_g; 72 73 73 74 %compute new thickness 74 75 disp(sprintf('%s',' computing new thickness...')); 75 inputs=add(inputs,'velocity',solution(n+1).u_g,'doublevec',2,m _p.parameters.numberofnodes);76 new_thickness=prognostic_core(m _p,inputs,'prognostic','');76 inputs=add(inputs,'velocity',solution(n+1).u_g,'doublevec',2,models.p.parameters.numberofnodes); 77 new_thickness=prognostic_core(models.p,inputs,'prognostic',''); 77 78 78 79 %update surface and bed using the new thickness 79 80 disp(sprintf('%s',' updating geometry...')); 80 [new_thickness,new_bed,new_surface]=UpdateGeometry(m _p.elements,m_p.nodes,m_p.loads,m_p.materials,m_p.parameters,new_thickness,solution(n).b_g,solution(n).s_g);81 [new_thickness,new_bed,new_surface]=UpdateGeometry(models.p.elements,models.p.nodes,models.p.loads,models.p.materials,models.p.parameters,new_thickness,solution(n).b_g,solution(n).s_g); 81 82 82 83 %Record bed surface and thickness in the solution -
issm/trunk/src/m/solutions/cielo/transient3d.m
r915 r932 9 9 %Build all models related to diagnostic 10 10 displaystring(md.debug,'%s',['reading diagnostic horiz model data']); 11 md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; m _dh=CreateFemModel(md);11 md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; models.dh=CreateFemModel(md); 12 12 13 13 displaystring(md.debug,'\n%s',['reading diagnostic vert model data']); 14 md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; m _dv=CreateFemModel(md);14 md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; models.dv=CreateFemModel(md); 15 15 16 16 displaystring(md.debug,'\n%s',['reading diagnostic stokes model data']); 17 md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; m _ds=CreateFemModel(md);17 md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; models.ds=CreateFemModel(md); 18 18 19 19 displaystring(md.debug,'\n%s',['reading diagnostic hutter model data']); 20 md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; m _dhu=CreateFemModel(md);20 md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; models.dhu=CreateFemModel(md); 21 21 22 22 displaystring(md.debug,'\n%s',['reading surface and bed slope computation model data']); 23 md.analysis_type='slope_compute'; md.sub_analysis_type=''; m _sl=CreateFemModel(md);23 md.analysis_type='slope_compute'; md.sub_analysis_type=''; models.sl=CreateFemModel(md); 24 24 25 25 displaystring(md.debug,'%s',['reading prognostic model data']); 26 md.analysis_type='prognostic'; m _p=CreateFemModel(md);26 md.analysis_type='prognostic'; models.p=CreateFemModel(md); 27 27 28 28 %Build all models related to thermal 29 29 displaystring(md.debug,'%s',['reading thermal model data']); 30 md.analysis_type='thermal'; m _t=CreateFemModel(md);30 md.analysis_type='thermal'; models.t=CreateFemModel(md); 31 31 32 32 displaystring(md.debug,'%s',['reading melting model data']); 33 md.analysis_type='melting'; m _m=CreateFemModel(md);33 md.analysis_type='melting'; models.m=CreateFemModel(md); 34 34 35 35 … … 38 38 solution.step=1; 39 39 solution.time=0; 40 solution.u_g=m _dh.parameters.u_g;41 %solution.u_g=m _dh.parameters.u_g(dofsetgen([1,2],3,length(m_dh.parameters.u_g)));42 solution.p_g=m _p.parameters.p_g;43 solution.h_g=m _p.parameters.h_g;44 solution.s_g=m _p.parameters.s_g;45 solution.b_g=m _p.parameters.b_g;46 solution.t_g=m _p.parameters.t_g;47 solution.m_g=m _p.parameters.m_g;48 solution.a_g=m _p.parameters.a_g;40 solution.u_g=models.dh.parameters.u_g; 41 %solution.u_g=models.dh.parameters.u_g(dofsetgen([1,2],3,length(models.dh.parameters.u_g))); 42 solution.p_g=models.p.parameters.p_g; 43 solution.h_g=models.p.parameters.h_g; 44 solution.s_g=models.p.parameters.s_g; 45 solution.b_g=models.p.parameters.b_g; 46 solution.t_g=models.p.parameters.t_g; 47 solution.m_g=models.p.parameters.models.g; 48 solution.a_g=models.p.parameters.a_g; 49 49 50 50 %initialize inputs 51 51 displaystring(md.debug,'\n%s',['setup inputs...']); 52 52 inputs=inputlist; 53 inputs=add(inputs,'velocity',solution.u_g,'doublevec',3,m _p.parameters.numberofnodes);54 inputs=add(inputs,'melting',solution .m_g,'doublevec',1,m_p.parameters.numberofnodes);55 inputs=add(inputs,'accumulation',solution.a_g,'doublevec',1,m _p.parameters.numberofnodes);56 inputs=add(inputs,'dt',m _p.parameters.dt,'double');53 inputs=add(inputs,'velocity',solution.u_g,'doublevec',3,models.p.parameters.numberofnodes); 54 inputs=add(inputs,'melting',solution_g,'doublevec',1,models.p.parameters.numberofnodes); 55 inputs=add(inputs,'accumulation',solution.a_g,'doublevec',1,models.p.parameters.numberofnodes); 56 inputs=add(inputs,'dt',models.p.parameters.dt,'double'); 57 57 58 58 % figure out number of dof: just for information purposes. 59 md.dof=modelsize(m _dh,m_dv,m_ds,m_dhu,m_sl);59 md.dof=modelsize(models); 60 60 61 61 %first time step is given by model. 62 dt=m _p.parameters.dt;63 finaltime=m _p.parameters.ndt;62 dt=models.p.parameters.dt; 63 finaltime=models.p.parameters.ndt; 64 64 time=dt; 65 yts=m _p.parameters.yts;65 yts=models.p.parameters.yts; 66 66 n=1; %counter 67 67 … … 74 74 75 75 %update inputs 76 inputs=add(inputs,'thickness',solution(n).h_g,'doublevec',1,m _p.parameters.numberofnodes);77 inputs=add(inputs,'surface',solution(n).s_g,'doublevec',1,m _p.parameters.numberofnodes);78 inputs=add(inputs,'bed',solution(n).b_g,'doublevec',1,m _p.parameters.numberofnodes);79 inputs=add(inputs,'velocity',solution(n).u_g,'doublevec',3,m _p.parameters.numberofnodes);80 inputs=add(inputs,'pressure',solution(n).p_g,'doublevec',1,m _p.parameters.numberofnodes);81 inputs=add(inputs,'temperature',solution(n).t_g,'doublevec',1,m _t.parameters.numberofnodes);76 inputs=add(inputs,'thickness',solution(n).h_g,'doublevec',1,models.p.parameters.numberofnodes); 77 inputs=add(inputs,'surface',solution(n).s_g,'doublevec',1,models.p.parameters.numberofnodes); 78 inputs=add(inputs,'bed',solution(n).b_g,'doublevec',1,models.p.parameters.numberofnodes); 79 inputs=add(inputs,'velocity',solution(n).u_g,'doublevec',3,models.p.parameters.numberofnodes); 80 inputs=add(inputs,'pressure',solution(n).p_g,'doublevec',1,models.p.parameters.numberofnodes); 81 inputs=add(inputs,'temperature',solution(n).t_g,'doublevec',1,models.t.parameters.numberofnodes); 82 82 83 83 %Deal with temperature first 84 84 displaystring(md.debug,'\n%s',[' computing temperatures...']); 85 [solution(n+1).t_g m _t.loads melting_offset]=thermal_core_nonlinear(m_t,inputs,'thermal','transient');86 inputs=add(inputs,'temperature',solution(n+1).t_g,'doublevec',1,m _t.parameters.numberofnodes);85 [solution(n+1).t_g models.t.loads melting_offset]=thermal_core_nonlinear(models.t,inputs,'thermal','transient'); 86 inputs=add(inputs,'temperature',solution(n+1).t_g,'doublevec',1,models.t.parameters.numberofnodes); 87 87 88 88 displaystring(md.debug,'\n%s',[' computing melting...']); 89 89 inputs=add(inputs,'melting_offset',melting_offset,'double'); 90 solution(n+1).m_g=diagnostic_core_linear(m _m,inputs,'melting','transient');90 solution(n+1).m_g=diagnostic_core_linear(models.m,inputs,'melting','transient'); 91 91 92 92 %Compute depth averaged temperature 93 temperature_average=FieldDepthAverage(m _t.elements,m_t.nodes,m_t.loads,m_t.materials,solution(n+1).t_g,'temperature');94 inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,m _t.parameters.numberofnodes);93 temperature_average=FieldDepthAverage(models.t.elements,models.t.nodes,models.t.loads,models.t.materials,solution(n+1).t_g,'temperature'); 94 inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,models.t.parameters.numberofnodes); 95 95 96 96 %Deal with velocities. 97 [solution(n+1).u_g,solution(n+1).p_g]=diagnostic_core(m_dh,m_dhu,m_dv,m_ds,m_sl,inputs); 97 resultsdiag=diagnostic_core(models,inputs); 98 solution(n+1).u_g=resultsdiag.u_g; solution(n+1).p_g=resultsdiag.p_g; 98 99 99 100 %compute new thickness 100 101 displaystring(md.debug,'\n%s',[' computing new thickness...']); 101 inputs=add(inputs,'velocity',solution(n+1).u_g,'doublevec',3,m _p.parameters.numberofnodes);102 new_thickness=prognostic_core(m _p,inputs,'prognostic','');102 inputs=add(inputs,'velocity',solution(n+1).u_g,'doublevec',3,models.p.parameters.numberofnodes); 103 new_thickness=prognostic_core(models.p,inputs,'prognostic',''); 103 104 104 105 %update surface and bed using the new thickness 105 106 displaystring(md.debug,'\n%s',[' updating geometry...']); 106 [new_thickness,new_bed,new_surface]=UpdateGeometry(m _p.elements,m_p.nodes,m_p.loads,m_p.materials,m_p.parameters,new_thickness,solution(n).b_g,solution(n).s_g);107 [new_thickness,new_bed,new_surface]=UpdateGeometry(models.p.elements,models.p.nodes,models.p.loads,models.p.materials,models.p.parameters,new_thickness,solution(n).b_g,solution(n).s_g); 107 108 108 109 %Record bed surface and thickness in the solution … … 120 121 %update node positions 121 122 displaystring(md.debug,'\n%s',[' updating node positions...']); 122 nodes_dh=UpdateNodePositions(m _dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,new_bed,new_thickness);123 nodes_dv=UpdateNodePositions(m _dv.elements,m_dv.nodes,m_dv.loads,m_dv.materials,new_bed,new_thickness);124 nodes_ds=UpdateNodePositions(m _ds.elements,m_ds.nodes,m_ds.loads,m_ds.materials,new_bed,new_thickness);125 nodes_sl=UpdateNodePositions(m _sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,new_bed,new_thickness);126 nodes_p=UpdateNodePositions(m _p.elements,m_p.nodes,m_p.loads,m_p.materials,new_bed,new_thickness);127 nodes_t=UpdateNodePositions(m _t.elements,m_t.nodes,m_t.loads,m_t.materials,new_bed,new_thickness);128 nodes_m=UpdateNodePositions(m _m.elements,m_m.nodes,m_m.loads,m_m.materials,new_bed,new_thickness);123 nodes_dh=UpdateNodePositions(models.dh.elements,models.dh.nodes,models.dh.loads,models.dh.materials,new_bed,new_thickness); 124 nodes_dv=UpdateNodePositions(models.dv.elements,models.dv.nodes,models.dv.loads,models.dv.materials,new_bed,new_thickness); 125 nodes_ds=UpdateNodePositions(models.ds.elements,models.ds.nodes,models.ds.loads,models.ds.materials,new_bed,new_thickness); 126 nodes_sl=UpdateNodePositions(models.sl.elements,models.sl.nodes,models.sl.loads,models.sl.materials,new_bed,new_thickness); 127 nodes_p=UpdateNodePositions(models.p.elements,models.p.nodes,models.p.loads,models.p.materials,new_bed,new_thickness); 128 nodes_t=UpdateNodePositions(models.t.elements,models.t.nodes,models.t.loads,models.t.materials,new_bed,new_thickness); 129 nodes_m=UpdateNodePositions(models.m.elements,models.m.nodes,models.m.loads,models.m.materials,new_bed,new_thickness); 129 130 130 131 %update time and counter
Note:
See TracChangeset
for help on using the changeset viewer.