Mathematical Physics - Volume II - Numerical Methods

Chapter 3. Comparison of finite element method and finite difference method

100

dpsi(2,1) = (2.*ski+1.)*eta2m/4. dpsi(2,2) = ski2p*(2.*eta-1.)/4. dpsi(3,1) = (2.*ski+1.)*eta2p/4. dpsi(3,2) = ski2p*(2.*eta+1.)/4. dpsi(4,1) = (2.*ski-1.)*eta2p/4. dpsi(4,2) = ski2m*(2.*eta+1.)/4. dpsi(5,1) = -ski*eta2m dpsi(5,2) = (1.-ski2)*(2.*eta-1.)/2. dpsi(6,1) = (2.*ski+1.)*(1.-eta2)/2.

dpsi(6,2) = -ski2p*eta dpsi(7,1) = -ski*eta2p

dpsi(7,2) = (1-ski2)*(2.*eta+1.)/2. dpsi(8,1) = (2.*ski-1.)*(1.-eta2)/2. dpsi(8,2) = -ski2m*eta

dpsi(9,1) = -2.*ski*(1.-eta2) dpsi(9,2) = -2.*(1.-ski2)*eta RETURN END

SUBROUTINE getmat(xk,xb,xf,mat) PARAMETER (maxn=400,maxe=100,maxm=5,maxbce=70,maxbcn=40,maxpt=10, & maxband=25) COMMON /cmatl / prop(3,maxm)

xk = prop(1,mat) xb = prop(2,mat) xf = prop(3,mat) RETURN END

SUBROUTINE assmb(ek,ef,n,node) PARAMETER (maxn=400,maxe=100,maxm=5,maxbce=70,maxbcn=40,maxpt=10, & maxband=25) COMMON /cmatrx/ gk(maxn,maxband) , gf(maxn) DIMENSION ek(n,n) , ef(n) , node(n) DO 100 i = 1 , n ig = node(i) c

assemble global vector gf gf(ig) = gf(ig) + ef(i) DO 50 j = 1 , n

c

assemble global stiffnes matrix gk jg = node(j) - ig + 1 IF ( jg.GT.0 ) gk(ig,jg) = gk(ig,jg) + ek(i,j)

50

CONTINUE

100 CONTINUE RETURN END

SUBROUTINE aplybc PARAMETER (maxn=400,maxe=100,maxm=5,maxbce=70,maxbcn=40,maxpt=10,

Made with FlippingBook flipbook maker