Папка для загрузок, и пропущенный баг с настройками визуализатора.
This commit is contained in:
2025-01-23 16:56:45 +03:00
parent 29176ebb4a
commit 6c0c103804
154 changed files with 61977 additions and 15 deletions

View File

@@ -0,0 +1,11 @@
! *** generated by SAPFOR with version 2236 and build date: Nov 7 2023 14:50:57
! *** Enabled options ***:
! *** consider DVMH directives
! *** save SPF directives
! *** generated by SAPFOR
double precision function calculate (value)
double precision :: value
calculate = value / 6
end

View File

@@ -0,0 +1,166 @@
! *** generated by SAPFOR with version 2236 and build date: Nov 7 2023 14:50:57
! *** Enabled options ***:
! *** consider DVMH directives
! *** save SPF directives
! *** generated by SAPFOR
program contains1
!
! integer ,parameter:: nxd = 32,nyd = 64,nzd = 32,itmaxd = 50
integer ,parameter:: nxd = 4,nyd = 4,nzd = 4,itmaxd = 2
double precision ,dimension(:,:,:):: a,b,a2,b2
allocatable:: a,b,a2,b2
! DVM$ ALIGN (I,J,K) WITH A(I,J,K):: B,A2,B2
! DVM$ DISTRIBUTE (BLOCK,BLOCK,BLOCK):: A
double precision :: relax2,eps1,eps2 ,calculate
character(len=9) :: tname='contains1'
!---------------------------------------------------------------------
! Read input file (if it exists), else take
! defaults from parameters
!---------------------------------------------------------------------
! open (unit=2,file='input.dat',status='old', iostat=istatus)
!
! if (istatus .eq. 0) then
! read (2,*) nx,ny,nz
! read (2,*) itmax
! close(2)
! else
nx = nxd
ny = nyd
nz = nzd
itmax = itmaxd
! endif
allocate(a(nx,ny,nz),b(nx,ny,nz))
allocate(a2(nx,ny,nz),b2(nx,ny,nz))
call init(a,nx,ny,nz)
call init(a2,nx,ny,nz)
! ITERATIONS
do it = 1,itmax
eps1 = relax1 ()
eps2 = relax2 (a2,b2,nx,ny,nz)
enddo
! END ITERATIONS
deallocate(a,b,a2,b2)
if (eps1 .eq. eps2) then
call ansyes(tname)
else
call ansno(tname)
endif
contains
!---------------------------------------------------------------------
!---------------------------------------------------------------------
double precision function relax1 ()
!---------------------------------------------------------------------
!---------------------------------------------------------------------
double precision :: eps,bt
double precision :: calculate
! DVM$ PARALLEL (K,J,I) ON B(I,J,K), SHADOW_RENEW (A)
do k = 2,nz - 1
do j = 2,ny - 1
do i = 2,nx - 1
b(i,j,k) = calculate((a(i - 1,j,k) + a(i + 1,j,k) + a(i,j - 1,k) +
&a(i,j + 1,k) + a(i,j,k - 1) + a(i,j,k + 1)))
enddo
enddo
enddo
! print *, b
eps = 0.d0
! DVM$ PARALLEL (K,J,I) ON A(I,J,K), REDUCTION (MAX(EPS))
do k = 2,nz - 1
do j = 2,ny - 1
do i = 2,nx - 1
bt = b(i,j,k)
eps = max (eps,abs (bt - a(i,j,k)))
a(i,j,k) = bt
enddo
enddo
enddo
relax1 = eps
end function
end
!---------------------------------------------------------------------
!---------------------------------------------------------------------
subroutine init (a, nx, ny, nz)
!---------------------------------------------------------------------
!---------------------------------------------------------------------
double precision :: a(nx,ny,nz),sol
! DVM$ INHERIT A
integer :: nx,ny,nz
! solution (i, j, k) = 10. * (i - 1) / (nx - 1) + 10. * (j - 1) / (n
! &y - 1) + 10. * (k - 1) / (nz - 1)
! DVM$ PARALLEL (K,J,I) ON A(I,J,K)
do k = 1,nz
do j = 1,ny
do i = 1,nx
if (k .eq. 1 .or. k .eq. nz .or. j .eq. 1 .or. j .eq. ny
&.or. i .eq. 1 .or. i .eq. nx) then
a(i,j,k) = sol(i,j,k,nx,ny,nz)
else
a(i,j,k) = 0.d0
endif
enddo
enddo
enddo
end
!---------------------------------------------------------------------
!---------------------------------------------------------------------
double precision function relax2 (a, b, nx, ny, nz)
!---------------------------------------------------------------------
!---------------------------------------------------------------------
double precision :: a(nx,ny,nz),b(nx,ny,nz),eps,bt
double precision :: calculate
! DVM$ INHERIT A,B
integer :: nx,ny,nz
! DVM$ PARALLEL (K,J,I) ON B(I,J,K), SHADOW_RENEW (A)
do k = 2,nz - 1
do j = 2,ny - 1
do i = 2,nx - 1
b(i,j,k) = calculate((a(i - 1,j,k) + a(i + 1,j,k) + a(i,j - 1,k) +
&a(i,j + 1,k) + a(i,j,k - 1) + a(i,j,k + 1)))
enddo
enddo
enddo
! print *,b
eps = 0.d0
! DVM$ PARALLEL (K,J,I) ON A(I,J,K), REDUCTION (MAX(EPS))
do k = 2,nz - 1
do j = 2,ny - 1
do i = 2,nx - 1
bt = b(i,j,k)
eps = max (eps,abs (bt - a(i,j,k)))
a(i,j,k) = bt
enddo
enddo
enddo
relax2 = eps
end
subroutine ansyes (name)
character(len=9) :: name
print *, name,' - complete'
end
subroutine ansno (name)
character(len=9) :: name
print *, name,' - ***error'
end

View File

@@ -0,0 +1,13 @@
double precision FUNCTION sol (ii,jj,kk,nx,ny,nz)
integer:: ii,jj,kk,nx,ny,nz
double precision val
sol = 10.*val(ii,jj,kk,nx,ny,nz)
END
double precision FUNCTION val (ii,jj,kk,nx,ny,nz)
integer:: ii,jj,kk,nx,ny,nz
val = (ii-1)/(nx-1) +(jj-1)/(ny-1)+
> (kk-1)/(nz-1)
END