


REDUCEMATRIXFROMGTOF [K_ff, K_fs] = Reducematrixfromgtof( K_gg, G_mn, flag_u_s )
Reduces a matrix from g-size to f-size
Input:
K_gg Matrix in g-size
G_mn Reduction matrix
flag_u_s flag indicating whether K_fs is calculated or not
=0 K_fs is not calculated, an empty matrix is returned
=1 K_fs is calculated and returned
Output:
K_ff Reduced system tangent matrix f-size x f-size
K_fs Reduced sytem tangent matrix f-size x s-size
Input from global workspace:
uset uset.pv_* partitioning vector
uset.*size size
*=n,m etc., see Builduset
Called by sol101 (ms), Normalmodes (ms), Tangentmatrixheat (mf)
Calls Reducematrix (mf)
where ms= m-script, mf= m-function, mex= executable function (c-code)
The g-set is partitioned as follows
g = n + m
n = f + s
g all system degrees of freedom (dof)
m multi-point constraint dofs to be condensed out
n remaining dof after m-set is condensed from the g-set
s boundary condition dofs (single point constraints)
f remaining free dofs after s-set is eliminated from the n-set

0001 function [ K_ff, K_fs] = reducematrixfromgtof(K_gg, G_mn, flag_u_s,uset); 0002 % REDUCEMATRIXFROMGTOF [K_ff, K_fs] = Reducematrixfromgtof( K_gg, G_mn, flag_u_s ) 0003 % Reduces a matrix from g-size to f-size 0004 % 0005 % Input: 0006 % K_gg Matrix in g-size 0007 % G_mn Reduction matrix 0008 % flag_u_s flag indicating whether K_fs is calculated or not 0009 % =0 K_fs is not calculated, an empty matrix is returned 0010 % =1 K_fs is calculated and returned 0011 % Output: 0012 % K_ff Reduced system tangent matrix f-size x f-size 0013 % K_fs Reduced sytem tangent matrix f-size x s-size 0014 % 0015 % Input from global workspace: 0016 % 0017 % uset uset.pv_* partitioning vector 0018 % uset.*size size 0019 % *=n,m etc., see Builduset 0020 % 0021 % Called by sol101 (ms), Normalmodes (ms), Tangentmatrixheat (mf) 0022 % Calls Reducematrix (mf) 0023 % where ms= m-script, mf= m-function, mex= executable function (c-code) 0024 % 0025 % The g-set is partitioned as follows 0026 % g = n + m 0027 % n = f + s 0028 % g all system degrees of freedom (dof) 0029 % m multi-point constraint dofs to be condensed out 0030 % n remaining dof after m-set is condensed from the g-set 0031 % s boundary condition dofs (single point constraints) 0032 % f remaining free dofs after s-set is eliminated from the n-set 0033 % 0034 0035 % Reduce matrix from g-size to n-size 0036 0037 K_nn= Reducematrix( K_gg, G_mn, uset.pv_m, uset.pv_n, uset.msize, 2 ); 0038 0039 % Reduce matrix from n-size to f-size 0040 0041 if uset.ssize>0 0042 K_ff= K_nn(uset.pv_f, uset.pv_f); 0043 if flag_u_s 0044 K_fs= K_nn(uset.pv_f,uset.pv_s); 0045 else 0046 K_fs=[]; 0047 end 0048 else 0049 K_ff= K_nn; 0050 K_fs=[]; 0051 end