huttercompute

PURPOSE ^

HUTTERCOMPUTE - compute the velocity field of the model using Hutter's model

SYNOPSIS ^

function md=huttercompute(md);

DESCRIPTION ^

HUTTERCOMPUTE - compute the velocity field of the model using Hutter's model

   Usage:
      md=huttercompute(md)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md=huttercompute(md);
0002 %HUTTERCOMPUTE - compute the velocity field of the model using Hutter's model
0003 %
0004 %   Usage:
0005 %      md=huttercompute(md)
0006 
0007 %define global variables
0008 iceglobal
0009 
0010 %determine if run is parallel
0011 if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
0012 
0013 %for now, only serial support is in
0014 if cluster,
0015     error('icediagnostic error message: parallel support not implemented yet');
0016 end
0017 
0018 %setup some parameters to be passed to the core solution
0019 params.sparsity=md.sparsity;
0020 params.solver_type=md.solver_type;
0021 params.eps_abs=md.eps_abs;
0022 params.eps_rel=md.eps_rel;
0023 params.debug=md.debug;
0024 
0025 %First, build elements,grids,loads, etc ... for horizontal, base vertical and vertical model
0026 disp('   processing model');
0027 [elements,grids,loads,constraints,materials,part,tpart]=ModelProcessor(md,'diagnostic_hutter');
0028 
0029 %generate degrees of freedom
0030 disp('   generating degrees of freedom');
0031 grids=Dof(grids); 
0032 
0033 %add constraints to grids. Create y_g vector of constraint values for the entire g set.
0034 disp('   generating constraint vector');
0035 [grids y_g]=SpcGrids(grids,constraints);
0036 
0037 %generate grid sets and reduce y_g to ys from g-set to s-set.
0038 disp('   generating grid sets');
0039 BuildGridSets(grids);gridset=gridset; ys=Reducevector_g(y_g);
0040 
0041 %Compute velocity, in 3d
0042 gridset=gridset;
0043 slopesurface=zeros(gridset.gsize,1);
0044 slopesurface(1:6:gridset.gsize,1)=md.surface_slopex;
0045 slopesurface(2:6:gridset.gsize,1)=md.surface_slopey;
0046 disp(sprintf('\n%s',['computing Hutter''s velocities...']));
0047 u_g=icediagnostic_core_linear(elements,grids,materials,loads,params,ys,'diagnostic_hutter',struct('slopesurface',slopesurface));
0048     
0049 md.vx=u_g(1:6:end)*md.yts;
0050 md.vy=u_g(2:6:end)*md.yts;
0051 md.vel=sqrt(md.vx.^2+md.vy.^2);

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003