Mergesolution_g

PURPOSE ^

MERGESOLUTION_G - plug spcs in the solution

SYNOPSIS ^

function u_g= Mergesolution_g(u_f,G_mn,y_s);

DESCRIPTION ^

MERGESOLUTION_G - plug spcs in the solution

   Usage:
      u_g= Mergesolution_g(u_f,G_mn,y_s)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function u_g= Mergesolution_g(u_f,G_mn,y_s);
0002 %MERGESOLUTION_G - plug spcs in the solution
0003 %
0004 %   Usage:
0005 %      u_g= Mergesolution_g(u_f,G_mn,y_s)
0006 
0007 global gridset
0008 
0009 
0010 %    Merge f_set and s_set to n_set
0011 
0012 u_n= sparse([],[],[],gridset.nsize,1);
0013 u_n(gridset.pv_f,:)= u_f;
0014 
0015 % Note: we assume u_f and y_s have the same no.of columns
0016 if ~isempty(y_s)
0017     u_n(gridset.pv_s,:)= y_s;
0018 end
0019 
0020 %   Merge n_set and m_set to g_set
0021 u_g = sparse([],[],[],gridset.gsize,1);
0022 u_g(gridset.pv_n,:)= u_n;
0023 
0024 if (gridset.msize>0)
0025     u_m = G_mn * u_n;
0026     u_g(gridset.pv_m,:)= u_m;
0027 end

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