Mathematical Physics - Volume II - Numerical Methods

3.6 Program for solving of elliptical problems

93

WRITE (6,99001) title CALL rnode CALL relem CALL rmat CALL rbc RETURN

99001 FORMAT (A80) END

SUBROUTINE rnode PARAMETER (maxn=400,maxe=100,maxm=5,maxbce=70,maxbcn=40,maxpt=10, & maxband=25) COMMON /ccon / nnode , nelem , nmat , nbce , nbcn , npoint , & nband COMMON /cnode / x(2,maxn) , u(maxn) READ (5,*) READ (5,*) nrec IF ( nrec.LT.1 ) STOP ’number of node records less than 1’ nnode = 0 DO 100 irec = 1 , nrec READ (5,*) n1 , num , inc , x1 , y1 , xn , yn num1 = num - 1 xnum = float(num1)

x(1,n1) = x1 x(2,n1) = y1 nnode = nnode + 1 IF ( num.NE.1 ) THEN

dx = (xn-x1)/xnum dy = (yn-y1)/xnum DO 20 n = 1 , num1 xn = float(n) in = n1 + n*inc IF ( in.GT.maxn ) STOP ’number of nodes grater than maxn’

x(1,in) = x1 + xn*dx x(2,in) = y1 + xn*dy nnode = nnode + 1

20

CONTINUE

ENDIF 100 CONTINUE c print nodal point coordinates WRITE (6,99001) DO 200 n = 1 , nnode

WRITE (6,99002) n , x(1,n) , x(2,n)

200 CONTINUE RETURN 99001 FORMAT (’ node no x-coordinate y-coordinate ’/) 99002 FORMAT (I7,2F16.4) END

Made with FlippingBook flipbook maker