Changeset 302


Ignore:
Timestamp:
05/07/09 12:11:37 (16 years ago)
Author:
Eric.Larour
Message:

New framework for diagnostic solution sequence

Location:
issm/trunk/src/m/solutions/cielo
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/solutions/cielo/CreateFemModel.m

    r202 r302  
    88function  m=CreateFEMModel(md)
    99
    10         disp(sprintf('\n   reading data from model %s...',md.name));
     10        displaystring(md.debug,'\n   reading data from model %s...',md.name);
    1111        [m.elements,m.nodes,m.constraints,m.loads,m.materials,parameters]=ModelProcessor(md);
    1212       
    13         disp('   generating degrees of freedom...');
     13        displaystring(md.debug,'%s','   generating degrees of freedom...');
    1414        [m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,parameters);
    1515
    16         disp('   generating single point constraints...');
     16        displaystring(md.debug,'%s','   generating single point constraints...');
    1717        [m.nodes,m.yg]=SpcNodes(m.nodes,m.constraints);
    1818
    19         disp('   generating rigid body constraints...');
     19        displaystring(md.debug,'%s','   generating rigid body constraints...');
    2020        [m.Rmg,m.nodes]=MpcNodes(m.nodes,m.constraints);
    2121
    22         disp('   generating node sets...');
     22        displaystring(md.debug,'%s','   generating node sets...');
    2323        m.nodesets=BuildNodeSets(m.nodes);
    2424
    25         disp('   reducing single point constraints vector...');
     25        displaystring(md.debug,'%s','   reducing single point constraints vector...');
    2626        [m.ys m.ys0]=Reducevectorgtos(m.yg,m.nodesets);
    2727
    28         disp('   normalizing rigid body constraints matrix...');
     28        displaystring(md.debug,'%s','   normalizing rigid body constraints matrix...');
    2929        m.Gmn = NormalizeConstraints(m.Rmg,m.nodesets);
    3030       
    31         disp('   configuring element and loads...');
     31        displaystring(md.debug,'%s','   configuring element and loads...');
    3232        [m.elements,m.loads,m.nodes] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials);
    3333
    34         disp('   processing parameters...');
     34        displaystring(md.debug,'%s','   processing parameters...');
    3535        parameters= ProcessParams(parameters,m.part);
    3636
    37         disp('   creating parameters in matlab workspace...');
     37        displaystring(md.debug,'%s','   creating parameters in matlab workspace...');
    3838        m.parameters= ParamsToWorkspace(parameters);
    3939
  • issm/trunk/src/m/solutions/cielo/diagnostic.m

    r276 r302  
    1 function md=diagnostic(md)
    2 %DIAGNOSTIC - diagnostic solution sequence
    3 %
     1function md=diagnostic_proto(md);
     2%DIAGNOSTIC - compute the velocity field of a model
    43%   Usage:
    54%      md=diagnostic(md)
     5%
    66
    77        %timing
     
    99
    1010        %Build all models requested for diagnostic simulation
     11        displaystring(md.debug,'%s',['reading diagnostic horiz model data']);
    1112        md.analysis_type='diagnostic_horiz'; m_dh=CreateFemModel(md);
     13       
     14        displaystring(md.debug,'\n%s',['reading diagnostic vert model data']);
     15        md.analysis_type='diagnostic_vert'; m_dv=CreateFemModel(md);
     16       
     17        displaystring(md.debug,'\n%s',['reading diagnostic stokes model data']);
     18        md.analysis_type='diagnostic_stokes'; m_ds=CreateFemModel(md);
    1219
    13         if strcmpi(md.type,'3d'),
    14                 md.analysis_type='diagnostic_vert'; m_dv=CreateFemModel(md);
    15         end
    16 
     20        displaystring(md.debug,'\n%s',['reading diagnostic hutter model data']);
     21        md.analysis_type='diagnostic_hutter'; m_dhu=CreateFemModel(md);
     22       
     23        displaystring(md.debug,'\n%s',['reading surface and bed slope computation model data']);
     24        md.analysis_type='surface_slope_compute'; m_ss=CreateFemModel(md);
     25        md.analysis_type='bed_slope_compute'; m_bs=CreateFemModel(md);
     26       
    1727        % figure out number of dof: just for information purposes.
    1828        md.dof=m_dh.nodesets.fsize; %biggest dof number
     
    2232        inputs=add(inputs,'velocity',m_dh.parameters.u_g,'doublevec',3,m_dh.parameters.numberofnodes);
    2333
    24         %Get horizontal solution.
    25         disp(sprintf('\n%s',['computing horizontal velocities...']));
     34        %compute solution
     35        [u_g,p_g]=diagnostic_core(m_dh,m_dhu,m_dv,m_ds,m_ss,m_bs,inputs);
    2636
    27         u_g=diagnostic_core_nonlinear(m_dh,inputs);
     37        %Load results onto model
     38        md=loadresults(md,u_g,p_g,m_dh,m_ds,m_dhu);
    2839
    29         if strcmpi(md.type,'3d'),
    30        
    31                 %extrude velocities for collapsed penta elements
    32                 disp(sprintf('\n%s',['extruding horizontal velocities...']));
    33                 u_g=VelocityExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,u_g);
    34 
    35                 disp(sprintf('\n%s',['computing vertical velocities...']));
    36        
    37                 inputs=add(inputs,'velocity',u_g,'doublevec',m_dh.parameters.numberofdofspernode,m_dh.parameters.numberofnodes);
    38 
    39                 u_g_vert=diagnostic_core_linear(m_dv,inputs);
    40 
    41                 %load results onto model:
    42                 md.vx=u_g(1:2:end)*md.yts;
    43                 md.vy=u_g(2:2:end)*md.yts;
    44                 md.vz=u_g_vert*md.yts;
    45                 md.vel=sqrt(md.vx.^2+md.vy.^2+md.vz.^2);
    46                
    47                 %Computation of pressure with Pattyn's assumptions (P=rho_ice*g*(s-z) in Pa)
    48                 md.pressure=md.rho_ice*md.g*(md.surface-md.z);
    49         else
    50                 %load results onto model
    51                 md.vx=u_g(1:2:end)*md.yts;
    52                 md.vy=u_g(2:2:end)*md.yts;
    53                 md.vz=zeros(md.numberofgrids,1);
    54                 md.vel=sqrt(md.vx.^2+md.vy.^2+md.vz.^2);
    55        
    56                 %Computation of pressure with Pattyn's assumptions (P=rho_ice*g*(s-z) in Pa)
    57                 md.pressure=md.rho_ice*md.g*(md.thickness);
    58         end             
    59 
    60         %timing
     40        %stop timing
    6141        t2=clock;
    62         disp(sprintf('\n%s\n',['   solution converged in ' num2str(etime(t2,t1)) ' seconds']));
     42        displaystring(md.debug,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);
  • issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m

    r253 r302  
    1 function [u_g varargout]=diagnostic_core_nonlinear(m,inputs)
     1function [u_g varargout]=diagnostic_core_nonlinear(m,inputs,analysis_type)
    22%INPUT function [ru_g varargout]=cielodiagnostic_core_nonlinear(m,inputs)
    33       
Note: See TracChangeset for help on using the changeset viewer.