LOCAL_SOLVER Solution of local problems after knowledge of u on the interface [un]=local_solver(Amm,AGm,Lmm,LGG,novi,nvli,nov,novg,lint,lgamma,ugamma,f,ub); Input: Amm = structure of local matrices (A_{m,m})^{-1} AGm = structure of local matrices A_{\Gamma_m,m} Lmm = structure containing maps from internal{\Omega_m to \Omega_m set in schur_local.m LGG = structure with maps from \Gamma_i to \Gamma set in schur_local.m novi = 2-indexes array of size (max(nvli),ne), computed in cosnovi nvli = column array. nvli(ie) is the number of nodes of \Omega_ie internal to Omega. nov = 2-index array of local to global map, size(nov)=[max(npdx*npdy),ne] novg = restriction map from (\cup_i \Omega_i) to \Gamma set in cosnovg.m lint = list of those nodes of Omega (close) which are internal to Omega. lgamma = list of internal nodes which are on the interface between spectral elements ugamma = u on the interface Gamma f = r.h.s. ub = solution on \partial\Omega Output: un = solution in Omega 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[un]=local_solver(Amm,AGm,Lmm,LGG,novi,nvli,nov,novg,lint,lgamma,ugamma,f,ub); 0002 % LOCAL_SOLVER Solution of local problems after knowledge of u on the interface 0003 % 0004 % [un]=local_solver(Amm,AGm,Lmm,LGG,novi,nvli,nov,novg,lint,lgamma,ugamma,f,ub); 0005 % 0006 % Input: Amm = structure of local matrices (A_{m,m})^{-1} 0007 % AGm = structure of local matrices A_{\Gamma_m,m} 0008 % Lmm = structure containing maps from internal{\Omega_m to \Omega_m 0009 % set in schur_local.m 0010 % LGG = structure with maps from \Gamma_i to \Gamma 0011 % set in schur_local.m 0012 % novi = 2-indexes array of size (max(nvli),ne), computed in cosnovi 0013 % nvli = column array. nvli(ie) is the number of nodes of \Omega_ie 0014 % internal to Omega. 0015 % nov = 2-index array of local to global map, 0016 % size(nov)=[max(npdx*npdy),ne] 0017 % novg = restriction map from (\cup_i \Omega_i) to \Gamma 0018 % set in cosnovg.m 0019 % lint = list of those nodes of Omega (close) which 0020 % are internal to Omega. 0021 % lgamma = list of internal nodes which are on the interface between 0022 % spectral elements 0023 % ugamma = u on the interface Gamma 0024 % f = r.h.s. 0025 % ub = solution on \partial\Omega 0026 % 0027 % Output: un = solution in Omega 0028 % 0029 % 0030 % References: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, 0031 % "Spectral Methods. Fundamentals in Single Domains" 0032 % Springer Verlag, Berlin Heidelberg New York, 2006. 0033 % CHQZ3 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, 0034 % "Spectral Methods. Evolution to Complex Geometries 0035 % and Applications to Fluid DynamicsSpectral Methods" 0036 % Springer Verlag, Berlin Heidelberg New York, 2007. 0037 0038 % Written by Paola Gervasio 0039 % $Date: 2007/04/01$ 0040 0041 0042 ne=length(nvli); 0043 noei=length(lint); 0044 un_i=zeros(noei,1); 0045 for ie=1:ne 0046 nn=novi(1:nvli(ie),ie); 0047 un_loc=zeros(nvli(ie),1); 0048 f_loc=f(nn); 0049 f_loc_i=f_loc(Lmm{ie})-(AGm{ie})'*ugamma(novg(LGG{ie},ie)); 0050 un_loc(Lmm{ie})=Amm{ie}*f_loc_i; 0051 un_i(nn)=un_i(nn)+un_loc; 0052 end 0053 un_i(lgamma)=ugamma; 0054 un=ub; 0055 un(lint)=un_i; 0056 return