PLOT_SEM_1D plots SEM numerical solution of 1D boundary value problems [ha]=plot_sem_1d(fig,ne,x,wx,xx,jacx,xy,nov,un,param); Input: fig = figure number, set in the calling function by figure command ne = number of Spectral elements x = LGL nodes in [-1,1] wx= LGL weights in [-1,1] xx = 2-indexes array of size (2,ne): xx(1:2,ie)=[xa_ie;xb_ie] jacx= array (length(jacx)=ne); jacx(ie)= jacobian of of the map F_ie:[-1,1]---->[xa_ie,xb_ie] xy = column array with global mesh, length: noe=nov(npdx,ne) nov = local -global map, previously generated by cosnov1d un = numerical solution n_int = number of nodes in each element to interpolate numerical solution by Level_0/legendre_tr_eval.m (Discrete Legendre Transform)
0001 function [ha]=plot_sem_1d(fig,ne,x,wx,xx,jacx,xy,nov,un,n_int); 0002 % PLOT_SEM_1D plots SEM numerical solution of 1D boundary value problems 0003 % 0004 % [ha]=plot_sem_1d(fig,ne,x,wx,xx,jacx,xy,nov,un,param); 0005 % 0006 % Input: fig = figure number, set in the calling function by figure 0007 % command 0008 % ne = number of Spectral elements 0009 % x = LGL nodes in [-1,1] 0010 % wx= LGL weights in [-1,1] 0011 % xx = 2-indexes array of size (2,ne): xx(1:2,ie)=[xa_ie;xb_ie] 0012 % jacx= array (length(jacx)=ne); jacx(ie)= jacobian of 0013 % of the map F_ie:[-1,1]---->[xa_ie,xb_ie] 0014 % xy = column array with global mesh, length: noe=nov(npdx,ne) 0015 % nov = local -global map, previously generated by cosnov1d 0016 % un = numerical solution 0017 % n_int = number of nodes in each element to interpolate numerical 0018 % solution by Level_0/legendre_tr_eval.m (Discrete Legendre Transform) 0019 % 0020 0021 % Written by Paola Gervasio 0022 % $Date: 2007/04/01$ 0023 0024 npdx=length(x); 0025 u_int=zeros(n_int,ne); 0026 plot(xy,un,'kx'); hold 0027 % interpolation 0028 for ie=1:ne 0029 0030 x1=xwlgl(n_int); 0031 0032 uloc=un(nov(1:npdx,ie)); 0033 u_int(1:n_int,ie)=legendre_tr_eval(x,uloc,x1); 0034 0035 x1_jac=jacx(ie)*x1+0.5*(xx(2,ie)+xx(1,ie)); 0036 plot(x1_jac,u_int(1:n_int,ie)); 0037 end 0038 ha=gca(fig); 0039 hold off 0040 return