iceprognostic_core

PURPOSE ^

ICEPROGNOSTIC_CORE - core of prognostic solution

SYNOPSIS ^

function h_g=iceprognostic_core(m,analysis_type,varargin)

DESCRIPTION ^

ICEPROGNOSTIC_CORE - core of prognostic solution

   This routine is used to compute the new thickness of a model after a time step ∆t
   
   Usage:
      h_g=iceprognostic_core(m,analysis_type,varargin)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function h_g=iceprognostic_core(m,analysis_type,varargin)
0002 %ICEPROGNOSTIC_CORE - core of prognostic solution
0003 %
0004 %   This routine is used to compute the new thickness of a model after a time step ∆t
0005 %
0006 %   Usage:
0007 %      h_g=iceprognostic_core(m,analysis_type,varargin)
0008 
0009 %global variables
0010 global cluster gridset
0011 
0012 %recover fem model fields
0013 elements=m.elements;
0014 grids=m.grids;
0015 materials=m.materials;
0016 loads=m.loads;
0017 ys=m.ys;
0018 gridset=m.gridset;
0019 G_mn=m.Gmn;
0020 params=m.params;
0021 
0022 %recover parameters
0023 sparsity=params.sparsity;
0024 solver_type=params.solver_type;
0025 
0026 %recover extra inputs and initialize solution
0027 if nargin==3,
0028     inputs=varargin{1};
0029 else    
0030     inputs=struct();
0031 end
0032 
0033 disp(sprintf('%s','   solving'));
0034 
0035 % Generate system matrices (stiffness and load)
0036 kflag=1; pflag=1;
0037 
0038 %generate stiffness and loads
0039 [K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type);
0040 [K_gg,p_g]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type,K_gg,p_g);
0041 
0042 if cluster, 
0043     K_gg=distributed(gplus(K_gg),'convert');
0044     p_g=gplus(p_g);
0045 end
0046 
0047 % Reduce stiffness matrix from g set to f set (effectively rooting out the single point constraints),
0048 % and compute modifications to loads from single point constraints.
0049 [K_ff K_fs]=IceReducematrixfromgtof(K_gg,G_mn); 
0050 
0051 % Reduce load from g set to f set
0052 p_f=IceReducerightside(p_g,G_mn,K_fs,ys);
0053 
0054 % Solve
0055 uf=Solver(K_ff,p_f,solver_type);
0056 
0057 % Add single point constraints back, ie increase f-set by s-set into the global g-set.
0058 h_g= full(Mergesolution_g(uf,G_mn,ys));

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