icediagnostic_core_linear

PURPOSE ^

ICEDIAGNOSTIC_CORE_LINEAR - core solution of linear problems

SYNOPSIS ^

function u_g=icediagnostic_core_linear(m,analysis_type,varargin);

DESCRIPTION ^

ICEDIAGNOSTIC_CORE_LINEAR - core solution of linear problems

   Core of the vertical diagnostic solution. No need for a non-linear iteration.
   Otherwise similar to ICEDIAGNOSTIC_CORE_NONLINEAR

   Usage:
      u_g=icediagnostic_core_linear(m,analysis_type,varargin);

   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function u_g=icediagnostic_core_linear(m,analysis_type,varargin);
0002 %ICEDIAGNOSTIC_CORE_LINEAR - core solution of linear problems
0003 %
0004 %   Core of the vertical diagnostic solution. No need for a non-linear iteration.
0005 %   Otherwise similar to ICEDIAGNOSTIC_CORE_NONLINEAR
0006 %
0007 %   Usage:
0008 %      u_g=icediagnostic_core_linear(m,analysis_type,varargin);
0009 %
0010 %   See also: ICEDIAGNOSTIC, ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR
0011 
0012 %global variables
0013 global cluster gridset
0014 
0015 if nargin==3,
0016     inputs=varargin{1};
0017 else
0018     inputs=struct();
0019 end
0020 
0021 %recover fem model fields
0022 elements=m.elements;
0023 grids=m.grids;
0024 materials=m.materials;
0025 loads=m.loads;
0026 ys=m.ys;
0027 gridset=m.gridset;
0028 G_mn=m.Gmn;
0029 params=m.params;
0030 
0031 
0032 %recover parameters
0033 sparsity=params.sparsity;
0034 solver_type=params.solver_type;
0035 debug=params.debug;
0036 
0037 disp(sprintf('%s','   solving'));
0038 
0039 % Generate system matrices (stiffness and load)
0040 kflag=1; pflag=1;
0041 
0042 %generate stiffness and loads
0043 [K_gg,p_g]=SystemMatrices(elements,grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type);
0044 [K_gg,p_g]=PenaltySystemMatrices(grids,loads,materials,kflag, pflag, sparsity,inputs,analysis_type,K_gg,p_g);
0045 
0046 if cluster, 
0047     K_gg=distributed(gplus(K_gg),'convert');
0048     p_g=gplus(p_g);
0049 end
0050 
0051 % Reduce stiffness matrix from g set to f set (effectively rooting out the single point constraints),
0052 % and compute modifications to loads from single point constraints.
0053 [K_ff K_fs]=IceReducematrixfromgtof(K_gg,G_mn); 
0054 
0055 % Reduce load from g set to f set
0056 p_f=IceReducerightside(p_g,G_mn,K_fs,ys);
0057 
0058 % Solve
0059 uf=Solver(K_ff,p_f,solver_type);
0060 if debug,
0061     disp(sprintf('%s%g','      condition number of stiffness matrix: ',condest(K_ff)));
0062 end
0063    
0064 
0065 % Add single point constraints back, ie increase f-set by s-set into the global g-set.
0066 u_g= full(Mergesolution_g(uf,G_mn,ys));

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