banner image

Data Local Iterative Methods For The Efficient Solution of Partial Differential Equations

logo
home
staff
coorperations
publications
talks
tutorials
software
results
contact

A cooperation
between
lss logo
and
lrr logo.

Funded by
dfg logo.

rb1.F Program Source Code

Fortran77 Source:



define(rel,$3=f($2,$1)+ce*u($2,$1)+no*u($2-1,$1)+
     &      so*u($2+1,$1)+ea*u($2,$1+1)+we*u($2,$1-1)
      u($2,$1)= $3
      ops= ops+1)
define(Crel,)
      program rb
      implicit none
      integer n,i,j,it,loops
      parameter (n=NMAX, loops=2**28/n**2)
      double precision u(0:n+3,0:n), f(0:n+3,0:n),
     &  no,we,so,ea,ce,
     &  r, omega,
     &  dnull
      integer null
      integer ops
C
      read *, null
      dnull= null
      no= 0.25d0+dnull
      we= 0.25d0+dnull*dnull
      ea= 0.25d0-dnull
      so= 0.25d0+dnull+dnull*dnull
      ce= dnull
      omega= 1.5d0
      do j=0,n
      do i=0,n
         u(i,j)= 0d0
         f(i,j)= 0d0
      enddo
      enddo
      do i=0,n
         u(i,n)= 1d0
      enddo

      do it=0,loops-1
         do j=1,n-1,2
            rel(1,j,r)
         enddo

         do i=2,n-1
            do j=1+mod(i+1,2),n-1,2
               rel(i,j,r)
            enddo
            do j=1+mod(i+1,2),n-1,2
               rel(i-1,j,r)
            enddo
         enddo

         do j=2,n-1,2
            rel(n-1,j,r)
         enddo

      enddo

      print *, u(n/2,n/2), ' SIZE', n, ' Operations=', ops
      end
   

cs10-dime@fau.de
Last Modified: 10 January 2008
Valid HTML 4.01! Powered by vim