Home > Src > Elliptic_2d > patch_sp.m

patch_sp

PURPOSE ^

PATCH_SP Computes normal derivatives on the boundary of the spectral element

SYNOPSIS ^

function A=patch_sp(dx,jacx,dy,jacy);

DESCRIPTION ^

 PATCH_SP  Computes normal derivatives on the boundary of the spectral element

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function A=patch_sp(dx,jacx,dy,jacy);
0002 % PATCH_SP  Computes normal derivatives on the boundary of the spectral element
0003 %
0004 
0005 %   Written by Paola Gervasio
0006 %   $Date: 2007/04/01$
0007 
0008 npdx=length(dx);
0009 npdy=length(dy);
0010 
0011 nm=npdx*(npdy-1);
0012 mn=npdx*npdy;
0013 A=sparse(mn,mn);
0014 % side 1
0015 for i=1:npdx
0016 ki=i;
0017 for j=1:npdy
0018 kj=(j-1)*npdx+i;
0019 A(ki,kj)=-dy(1,j)/jacy;
0020 end
0021 end
0022 
0023 % side 2
0024 for j=1:npdy
0025 kj=j*npdx;
0026 for i=1:npdx
0027 ki=(j-1)*npdx+i;
0028 A(kj,ki)=A(kj,ki)+dx(npdx,i)/jacx;
0029 end
0030 end
0031 
0032 % side 3
0033 for i=1:npdx
0034 ki=nm+i;
0035 for j=1:npdy
0036 kj=(j-1)*npdx+i;
0037 A(ki,kj)=A(ki,kj)+dy(npdy,j)/jacy;
0038 end
0039 end
0040 
0041 % side 4
0042 for j=1:npdy
0043 kj=(j-1)*npdx+1;
0044 for i=1:npdx
0045 ki=(j-1)*npdx+i;
0046 A(kj,ki)=A(kj,ki)-dx(1,i)/jacx;
0047 end
0048 end
0049

Generated on Fri 21-Sep-2007 10:07:00 by m2html © 2003