mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Get rid of ancient tests that don't work.
This commit is contained in:
parent
fa92904436
commit
68698091b0
3 changed files with 0 additions and 127 deletions
|
|
@ -1,36 +0,0 @@
|
|||
source = $(wildcard *.f90)
|
||||
test_objects = $(source:.f90=.o)
|
||||
executables = $(basename $(source))
|
||||
|
||||
objects = ../search.o ../constants.o ../error.o ../global.o
|
||||
objects += ../mesh.o ../mesh_header.o ../particle_header.o
|
||||
|
||||
#===============================================================================
|
||||
# Compiler Options
|
||||
#===============================================================================
|
||||
|
||||
F90 = ifort
|
||||
F90FLAGS = -I.. -g -traceback
|
||||
LDFLAGS =
|
||||
|
||||
#===============================================================================
|
||||
# Targets
|
||||
#===============================================================================
|
||||
|
||||
all: $(executables)
|
||||
$(executables): $(test_objects)
|
||||
$(F90) $(LDFLAGS) $@.o $(objects) -o $@
|
||||
clean:
|
||||
@rm -f *.o *.mod $(executables)
|
||||
neat:
|
||||
@rm -f *.o *.mod
|
||||
|
||||
#===============================================================================
|
||||
# Rules
|
||||
#===============================================================================
|
||||
|
||||
.SUFFIXES: .f90 .o
|
||||
.PHONY: all clean neat
|
||||
|
||||
%.o: %.f90
|
||||
$(F90) $(F90FLAGS) -c $<
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
program test_binary_search
|
||||
|
||||
use search, only: binary_search
|
||||
|
||||
implicit none
|
||||
|
||||
integer :: i
|
||||
integer :: index
|
||||
integer, parameter :: n = 100
|
||||
real(8) :: array(n)
|
||||
real(8) :: lbound
|
||||
real(8) :: ubound
|
||||
real(8) :: val
|
||||
|
||||
array = (/ (log(real(i+2)), i = 1, n) /)
|
||||
|
||||
val = 4.134
|
||||
index = binary_search(array, n, val)
|
||||
|
||||
write(UNIT=*, FMT='(A,I2,A,ES11.4)') "array(", index, ") = ", array(index)
|
||||
write(UNIT=*, FMT='(A,ES11.4)') "value = ", val
|
||||
write(UNIT=*, FMT='(A,I2,A,ES11.4)') "array(", index + 1, ") = ", array(index + 1)
|
||||
|
||||
end program test_binary_search
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
program test_mesh
|
||||
|
||||
use mesh, only: mesh_indices_to_bin, bin_to_mesh_indices
|
||||
use mesh_header, only: StructuredMesh
|
||||
|
||||
implicit none
|
||||
|
||||
integer :: i, j, k
|
||||
integer :: x, y, z
|
||||
integer :: ijk(3), ijk_new(3)
|
||||
integer :: bin, bin_new
|
||||
integer, parameter :: n = 3
|
||||
real(8) :: xyz(3)
|
||||
logical :: passed
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
|
||||
x = 21
|
||||
y = 16
|
||||
z = 52
|
||||
|
||||
allocate(m)
|
||||
m % n_dimension = n
|
||||
allocate(m % dimension(n))
|
||||
m % dimension = (/ x, y, z /)
|
||||
|
||||
passed = .true.
|
||||
write(*,'(A)', ADVANCE='no') "Testing ijk --> bin:"
|
||||
do i = 1, x
|
||||
do j = 1, y
|
||||
do k = 1, z
|
||||
ijk = (/ i, j, k /)
|
||||
bin = mesh_indices_to_bin(m, ijk)
|
||||
call bin_to_mesh_indices(m, bin, ijk_new)
|
||||
|
||||
! Check to make sure new indices match old
|
||||
if (any(ijk /= ijk_new)) passed = .false.
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
call write_result(passed)
|
||||
|
||||
passed = .true.
|
||||
write(*,'(A)', ADVANCE='no') "Testing bin --> ijk:"
|
||||
do bin = 1, product(m % dimension)
|
||||
call bin_to_mesh_indices(m, bin, ijk)
|
||||
bin_new = mesh_indices_to_bin(m, ijk)
|
||||
|
||||
! Check to make sure new bin matches old
|
||||
if (bin_new /= bin) passed = .false.
|
||||
end do
|
||||
call write_result(passed)
|
||||
|
||||
contains
|
||||
|
||||
subroutine write_result(passed)
|
||||
|
||||
logical, intent(in) :: passed
|
||||
|
||||
if (passed) then
|
||||
write (*,'(5X,A)') char(27) // '[32mPASSED' // char(27) // '[30m'
|
||||
else
|
||||
write (*,'(5X,A)') char(27) // '[31mFAILED' // char(27) // '[30m'
|
||||
end if
|
||||
|
||||
end subroutine write_result
|
||||
|
||||
end program test_mesh
|
||||
Loading…
Add table
Add a link
Reference in a new issue