Mathematical Physics - Volume II - Numerical Methods

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

96

DO 60 i = 1 , num nbce = nbce + 1

n = n1 + (i-1)*inc nodbc(nbce) = n vbce(nbce) = v

60

CONTINUE

100 CONTINUE ENDIF c read natural boundary condition data READ (5,*) READ (5,*) nrec nbcn = 0 IF ( nrec.NE.0 ) THEN ir = ir + 1 DO 150 j = 1 , nrec

READ (5,*) n1 , num , inc , ns , p , v DO 120 i = 1 , num nbcn = nbcn + 1 n = n1 + (i-1)*inc

nelbc(nbcn) = n nside(nbcn) = ns vbcn(1,nbcn) = p vbcn(2,nbcn) = v

120

CONTINUE

150 CONTINUE ENDIF c print boundary condition data

IF ( ir.EQ.0 ) STOP ’no boundary value data’ IF ( npoint.NE.0 ) THEN WRITE (6,99001) WRITE (6,99002) (npt(i),vpt(i),i=1,npoint) ENDIF IF ( nbce.NE.0 ) THEN WRITE (6,99003) WRITE (6,99004) (nodbc(i),vbce(i),i=1,nbce) ENDIF IF ( nbcn.NE.0 ) THEN WRITE (6,99005) WRITE (6,99006) (nelbc(i),nside(i),vbcn(1,i),vbcn(2,i),i=1, & nbcn) ENDIF RETURN 99001 FORMAT (/’ node no point load’/) 99002 FORMAT (I5,10X,F15.4) 99003 FORMAT (/’ node no essent. value’/) 99004 FORMAT (I5,10X,F15.4) 99005 FORMAT (/’ element no side p gamma’/) 99006 FORMAT (I7,7X,I1,5X,2F10.4) END

Made with FlippingBook flipbook maker