AD_1D_SE Assembles 1D global SEM matrix associated to ad operator -nu u'' + beta u' [A]=ad_1d_se(npdx,ne,nov,nu,beta,wx,dx,jacx); produces the matrix A_{ij}=(nu phi_j', phi'_i)_N +beta( phi_j' ,phi_i)_N of size (noe,noe) where noe=nov(npdx,ne) is the number of d.o.f. Input : npdx = polynomial degree in every element ne = number of spectral elements nov = local -global map, previously generated by cosnov1d nu = viscosity (constant>0) beta = coefficient of first order term (constant) wx = npdx LGL weigths in [-1,1], (produced by calling [x,w]=xwlgl(npdx)) (npdx = number of nodes, =n+1, if n=polynomial degree) dx = first derivative LGL matrix (produced by calling d=derlgl(x,npdx)) jacx = jacobian of the map F:[-1,1]---->[xa_ie,b_ie] Output: A = matrix (noe,noe) Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, "Spectral Methods. Fundamentals in Single Domains" Springer Verlag, Berlin Heidelberg New York, 2006.
0001 function [A]=ad_1d_se(npdx,ne,nov,nu,beta,wx,dx,jacx); 0002 % AD_1D_SE Assembles 1D global SEM matrix associated to ad operator -nu u'' + beta u' 0003 % 0004 % [A]=ad_1d_se(npdx,ne,nov,nu,beta,wx,dx,jacx); produces the matrix 0005 % 0006 % A_{ij}=(nu phi_j', phi'_i)_N +beta( phi_j' ,phi_i)_N of size 0007 % 0008 % (noe,noe) where noe=nov(npdx,ne) is the number of d.o.f. 0009 % 0010 % Input : npdx = polynomial degree in every element 0011 % ne = number of spectral elements 0012 % nov = local -global map, previously generated by cosnov1d 0013 % nu = viscosity (constant>0) 0014 % beta = coefficient of first order term (constant) 0015 % wx = npdx LGL weigths in [-1,1], 0016 % (produced by calling [x,w]=xwlgl(npdx)) 0017 % (npdx = number of nodes, =n+1, if n=polynomial degree) 0018 % dx = first derivative LGL matrix (produced by calling d=derlgl(x,npdx)) 0019 % jacx = jacobian of the map F:[-1,1]---->[xa_ie,b_ie] 0020 % 0021 % Output: A = matrix (noe,noe) 0022 % 0023 % 0024 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, 0025 % "Spectral Methods. Fundamentals in Single Domains" 0026 % Springer Verlag, Berlin Heidelberg New York, 2006. 0027 0028 % Written by Paola Gervasio 0029 % $Date: 2007/04/01$ 0030 0031 noe=nov(npdx,ne); 0032 A=sparse(noe,noe); 0033 for ie=1:ne 0034 Al=ad_1d_sp(nu,beta,wx,dx,jacx(ie)); 0035 A(nov(1:npdx,ie),nov(1:npdx,ie))=A(nov(1:npdx,ie),nov(1:npdx,ie))+Al; 0036 end 0037 0038