Changeset 932


Ignore:
Timestamp:
06/12/09 07:27:04 (15 years ago)
Author:
Mathieu Morlighem
Message:

some fixing (new inputs/outputs in diagnostic_core)

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,results);
     1function md=loadresults(md,models,rawresults);
    22%LOADRESULTS - load results onto model
    33%
     
    66%
    77%   Usage:
    8 %      md=Loadresults(md,results,m_dh,m_ds,m_dhu)
     8%      md=Loadresults(md,models,rawresults)
    99
    1010%recover models
     
    2121
    2222%recover results
    23 u_g=results.u_g;
    24 p_g=results.p_g;
     23u_g=rawresults.u_g;
     24p_g=rawresults.p_g;
    2525
    2626if ~isstruct(md.results), md.results=struct(); end
  • issm/trunk/src/m/solutions/cielo/thermal.m

    r915 r932  
    1010        %Build all models requested for diagnostic simulation
    1111        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);
    1313
    1414        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);
    1616
    1717        % figure out number of dof: just for information purposes.
    18         md.dof=m_t.nodesets.fsize;
     18        md.dof=models.t.nodesets.fsize;
    1919
    2020        %initialize inputs
    2121        displaystring(md.debug,'\n%s',['setup inputs...']);
    2222        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');
    2626       
    2727        %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);
    2929
    3030        %plug onto the model
  • issm/trunk/src/m/solutions/cielo/transient2d.m

    r915 r932  
    99%Build all models requested
    1010displaystring(md.debug,'%s',['reading diagnostic horiz model data']);
    11 md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; m_dh=CreateFemModel(md);
     11md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; models.dh=CreateFemModel(md);
    1212
    1313displaystring(md.debug,'\n%s',['reading diagnostic vert model data']);
    14 md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; m_dv=CreateFemModel(md);
     14md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; models.dv=CreateFemModel(md);
    1515
    1616displaystring(md.debug,'\n%s',['reading diagnostic stokes model data']);
    17 md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; m_ds=CreateFemModel(md);
     17md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; models.ds=CreateFemModel(md);
    1818
    1919displaystring(md.debug,'\n%s',['reading diagnostic hutter model data']);
    20 md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; m_dhu=CreateFemModel(md);
     20md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; models.dhu=CreateFemModel(md);
    2121
    2222displaystring(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);
     23md.analysis_type='slope_compute'; md.sub_analysis_type=''; models.sl=CreateFemModel(md);
    2424
    2525displaystring(md.debug,'%s',['reading prognostic model data']);
    26 md.analysis_type='prognostic'; m_p=CreateFemModel(md);
     26md.analysis_type='prognostic'; models.p=CreateFemModel(md);
    2727
    2828%initialize solution
     
    3030solution.step=1;
    3131solution.time=0;
    32 solution.u_g=m_dh.parameters.u_g(dofsetgen([1,2],3,length(m_dh.parameters.u_g)));
     32solution.u_g=models.dh.parameters.u_g(dofsetgen([1,2],3,length(models.dh.parameters.u_g)));
    3333solution.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;
     34solution.h_g=models.p.parameters.h_g;
     35solution.s_g=models.p.parameters.s_g;
     36solution.b_g=models.p.parameters.b_g;
    3737
    3838%initialize inputs
    3939displaystring(md.debug,'\n%s',['setup inputs...']);
    4040inputs=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');
     41inputs=add(inputs,'velocity',solution.u_g,'doublevec',2,models.p.parameters.numberofnodes);
     42inputs=add(inputs,'melting',models.p.parameters.m_g,'doublevec',1,models.p.parameters.numberofnodes);
     43inputs=add(inputs,'accumulation',models.p.parameters.a_g,'doublevec',1,models.p.parameters.numberofnodes);
     44inputs=add(inputs,'dt',models.p.parameters.dt,'double');
    4545
    4646% figure out number of dof: just for information purposes.
    47 md.dof=modelsize(m_dh,m_dv,m_ds,m_dhu,m_sl);
     47md.dof=modelsize(models);
    4848
    4949%first time step is given by model.
    50 dt=m_p.parameters.dt;
    51 finaltime=m_p.parameters.ndt;
     50dt=models.p.parameters.dt;
     51finaltime=models.p.parameters.ndt;
    5252time=dt;
    53 yts=m_p.parameters.yts;
     53yts=models.p.parameters.yts;
    5454n=1; %counter
    5555
     
    6262
    6363        %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);
    6767
    6868        %Deal with velocities.
    6969
    7070        %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;
    7273
    7374        %compute new thickness
    7475        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','');
    7778
    7879        %update surface and bed using the new thickness
    7980        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);
    8182
    8283        %Record bed surface and thickness in the solution
  • issm/trunk/src/m/solutions/cielo/transient3d.m

    r915 r932  
    99%Build all models related to diagnostic
    1010displaystring(md.debug,'%s',['reading diagnostic horiz model data']);
    11 md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; m_dh=CreateFemModel(md);
     11md.analysis_type='diagnostic'; md.sub_analysis_type='horiz'; models.dh=CreateFemModel(md);
    1212
    1313displaystring(md.debug,'\n%s',['reading diagnostic vert model data']);
    14 md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; m_dv=CreateFemModel(md);
     14md.analysis_type='diagnostic'; md.sub_analysis_type='vert'; models.dv=CreateFemModel(md);
    1515
    1616displaystring(md.debug,'\n%s',['reading diagnostic stokes model data']);
    17 md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; m_ds=CreateFemModel(md);
     17md.analysis_type='diagnostic'; md.sub_analysis_type='stokes'; models.ds=CreateFemModel(md);
    1818
    1919displaystring(md.debug,'\n%s',['reading diagnostic hutter model data']);
    20 md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; m_dhu=CreateFemModel(md);
     20md.analysis_type='diagnostic'; md.sub_analysis_type='hutter'; models.dhu=CreateFemModel(md);
    2121
    2222displaystring(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);
     23md.analysis_type='slope_compute'; md.sub_analysis_type=''; models.sl=CreateFemModel(md);
    2424
    2525displaystring(md.debug,'%s',['reading prognostic model data']);
    26 md.analysis_type='prognostic'; m_p=CreateFemModel(md);
     26md.analysis_type='prognostic'; models.p=CreateFemModel(md);
    2727
    2828%Build all models related to thermal
    2929displaystring(md.debug,'%s',['reading thermal model data']);
    30 md.analysis_type='thermal'; m_t=CreateFemModel(md);
     30md.analysis_type='thermal'; models.t=CreateFemModel(md);
    3131
    3232displaystring(md.debug,'%s',['reading melting model data']);
    33 md.analysis_type='melting'; m_m=CreateFemModel(md);
     33md.analysis_type='melting'; models.m=CreateFemModel(md);
    3434
    3535
     
    3838solution.step=1;
    3939solution.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;
     40solution.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)));
     42solution.p_g=models.p.parameters.p_g;
     43solution.h_g=models.p.parameters.h_g;
     44solution.s_g=models.p.parameters.s_g;
     45solution.b_g=models.p.parameters.b_g;
     46solution.t_g=models.p.parameters.t_g;
     47solution.m_g=models.p.parameters.models.g;
     48solution.a_g=models.p.parameters.a_g;
    4949
    5050%initialize inputs
    5151displaystring(md.debug,'\n%s',['setup inputs...']);
    5252inputs=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');
     53inputs=add(inputs,'velocity',solution.u_g,'doublevec',3,models.p.parameters.numberofnodes);
     54inputs=add(inputs,'melting',solution_g,'doublevec',1,models.p.parameters.numberofnodes);
     55inputs=add(inputs,'accumulation',solution.a_g,'doublevec',1,models.p.parameters.numberofnodes);
     56inputs=add(inputs,'dt',models.p.parameters.dt,'double');
    5757
    5858% figure out number of dof: just for information purposes.
    59 md.dof=modelsize(m_dh,m_dv,m_ds,m_dhu,m_sl);
     59md.dof=modelsize(models);
    6060
    6161%first time step is given by model.
    62 dt=m_p.parameters.dt;
    63 finaltime=m_p.parameters.ndt;
     62dt=models.p.parameters.dt;
     63finaltime=models.p.parameters.ndt;
    6464time=dt;
    65 yts=m_p.parameters.yts;
     65yts=models.p.parameters.yts;
    6666n=1; %counter
    6767
     
    7474
    7575        %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);
    8282
    8383        %Deal with temperature first
    8484        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);
    8787       
    8888        displaystring(md.debug,'\n%s',['    computing melting...']);
    8989        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');
    9191
    9292        %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);
    9595
    9696        %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;
    9899
    99100        %compute new thickness
    100101        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','');
    103104
    104105        %update surface and bed using the new thickness
    105106        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);
    107108
    108109        %Record bed surface and thickness in the solution
     
    120121        %update node positions
    121122        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);
    129130
    130131        %update time and counter
Note: See TracChangeset for help on using the changeset viewer.