PARTITION Computes the diagonal weighting matrix D relative to interface unknowns [D]=partition(Rgamma) Computes the diagonal weighting matrix D relative to the interface unknowns: D_ii=1/n_i where n_i is the number of subdomains x_i belongs to. (see CHQZ3, pag. 397) Input : Rgamma = matrix contructed in cosrgam.m Output : D, column array of size ngamma (global number of interface nodes) References: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, "Spectral Methods. Fundamentals in Single Domains" Springer Verlag, Berlin Heidelberg New York, 2006. CHQZ3 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, "Spectral Methods. Evolution to Complex Geometries and Applications to Fluid DynamicsSpectral Methods" Springer Verlag, Berlin Heidelberg New York, 2007.
0001 function [D]=partition(Rgamma) 0002 % PARTITION Computes the diagonal weighting matrix D relative to interface unknowns 0003 % 0004 % [D]=partition(Rgamma) 0005 % 0006 % Computes the diagonal weighting matrix D relative to the interface 0007 % unknowns: 0008 % D_ii=1/n_i where n_i is the number of subdomains x_i belongs to. 0009 % (see CHQZ3, pag. 397) 0010 % 0011 % Input : Rgamma = matrix contructed in cosrgam.m 0012 % 0013 % Output : D, column array of size ngamma (global number of interface nodes) 0014 % 0015 % References: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, 0016 % "Spectral Methods. Fundamentals in Single Domains" 0017 % Springer Verlag, Berlin Heidelberg New York, 2006. 0018 % CHQZ3 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, 0019 % "Spectral Methods. Evolution to Complex Geometries 0020 % and Applications to Fluid DynamicsSpectral Methods" 0021 % Springer Verlag, Berlin Heidelberg New York, 2007. 0022 0023 % Written by Paola Gervasio 0024 % $Date: 2007/04/01$ 0025 0026 0027 0028 [ne,ngamma]=size(Rgamma); 0029 D=zeros(ngamma,1); 0030 for i=1:ngamma 0031 D(i)=max(Rgamma(:,i)); 0032 end