


ICEREDUCERIGHTSIDE - reduce load vector from g to f
Usage:
p_f= IceReducerightside( p_g, G_mn, K_fs, y_s)

0001 function p_f= IceReducerightside( p_g, G_mn, K_fs, y_s) 0002 %ICEREDUCERIGHTSIDE - reduce load vector from g to f 0003 % 0004 % Usage: 0005 % p_f= IceReducerightside( p_g, G_mn, K_fs, y_s) 0006 0007 global gridset 0008 0009 % Reduce p_g to p_f 0010 % Reduce p_g to p_n 0011 if ( gridset.msize > 0 ) 0012 p_n = p_g( gridset.pv_n, :); 0013 p_m = p_g( gridset.pv_m, :); 0014 p_n = p_n + G_mn' * p_m; 0015 else 0016 p_n = p_g; 0017 end 0018 0019 % Reduce p_n to p_f 0020 if ( gridset.ssize > 0 ) 0021 p_f = p_n( gridset.pv_f, :); 0022 else 0023 p_f = p_n; 0024 end 0025 0026 % for nonzero boundary conditions, subtract coupling forces, 0027 % this operation is only executed if flag_y_s > 0, 0028 % the flag is set in the calling script for linear analysis 0029 % and the first iteration step in nonlinear analysis 0030 if ~isempty(y_s) 0031 p_f = p_f - K_fs * y_s; 0032 end