Mergesolvec

PURPOSE ^

MERGESOLVEC [u_g]= mergesolvec ( u_f, G_mn, y_s )

SYNOPSIS ^

function [u_g]= mergesolvec( u_f, G_mn, y_s ,uset);

DESCRIPTION ^

 MERGESOLVEC [u_g]= mergesolvec ( u_f, G_mn, y_s )
 Merges solution vectors (displacement/temperature) from f size to g size, 
 u_f to u_g,
 the solution vectors can be total in linear or incremental in nonlinear.

 g global dof g = m + n
 m dependent dof 
 n independent dof  n= s + f
 f free dof
 s single point constraint dof

 Input:  u_f         solution vectors (f size) 
                    in Matlab workspace
          G_mn      Reduction matrix from constraints (m x n)
                    in Matlab workspace
          y_s        vectors of enforced displacements y_s 
                    in Matlab workspace

 Output: u_g       solution vectors (g size)

 Input from global workspace:

         uset      uset.pv_*  partitioning vectors and sizes
                    uset.*size   *=n,m etc.

 Called by  sol101 (ms), Normalmodes (ms), sol159 (ms) (all solution sequences)
 Calls  none 
 where ms= m-script, mf= m-function, mex= executable function (c-code)

 m_set and n_set index vectors are with respect to (wrt) the g- set
 s_set and f_set index vectors are with respect to (wrt) the n- set

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [u_g]= mergesolvec( u_f, G_mn, y_s ,uset);
0002 % MERGESOLVEC [u_g]= mergesolvec ( u_f, G_mn, y_s )
0003 % Merges solution vectors (displacement/temperature) from f size to g size,
0004 % u_f to u_g,
0005 % the solution vectors can be total in linear or incremental in nonlinear.
0006 %
0007 % g global dof g = m + n
0008 % m dependent dof
0009 % n independent dof  n= s + f
0010 % f free dof
0011 % s single point constraint dof
0012 %
0013 % Input:  u_f         solution vectors (f size)
0014 %                    in Matlab workspace
0015 %          G_mn      Reduction matrix from constraints (m x n)
0016 %                    in Matlab workspace
0017 %          y_s        vectors of enforced displacements y_s
0018 %                    in Matlab workspace
0019 %
0020 % Output: u_g       solution vectors (g size)
0021 %
0022 % Input from global workspace:
0023 %
0024 %         uset      uset.pv_*  partitioning vectors and sizes
0025 %                    uset.*size   *=n,m etc.
0026 %
0027 % Called by  sol101 (ms), Normalmodes (ms), sol159 (ms) (all solution sequences)
0028 % Calls  none
0029 % where ms= m-script, mf= m-function, mex= executable function (c-code)
0030 %
0031 % m_set and n_set index vectors are with respect to (wrt) the g- set
0032 % s_set and f_set index vectors are with respect to (wrt) the n- set
0033 
0034 %Merge f_set and s_set to n_set
0035 
0036 ncol= size( u_f, 2);
0037 u_n= sparse(uset.nsize,ncol);
0038 u_n(uset.pv_f,:)= u_f;
0039 
0040 
0041 % Note: we assume u_f and y_s have the same no.of columns
0042 if ~isempty(y_s)
0043     u_n(uset.pv_s,:)= y_s;
0044 end
0045 
0046 %   Merge n_set and m_set to g_set
0047 
0048 u_g = sparse(uset.gsize,ncol);
0049 u_g(uset.pv_n,:)= u_n;
0050 
0051     
0052 if (uset.msize>0)
0053     u_m = G_mn * u_n;
0054     u_g(uset.pv_m,:)= u_m;
0055 end
0056 
0057 end

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