test27cells.sh.in 2.18 KB
Newer Older
1 2
#!/bin/bash

3 4 5 6 7
# List each test that should be run
declare -a TEST_LIST=(test27cells test27cells_subset)

# Run same test for each executable
for TEST in "${TEST_LIST[@]}"
8
do
9 10 11
  # Test for particles with the same smoothing length
  for v in {0..3}
  do
12
    echo ""
13

14 15
    rm -f brute_force_27_standard.dat swift_dopair_27_standard.dat

16 17
    echo "Running ./$TEST -n 6 -r 1 -d 0 -f standard -v $v"
    ./$TEST -n 6 -r 1 -d 0 -f standard -v $v
18 19 20

    if [ -e brute_force_27_standard.dat ]
    then
21 22 23 24 25 26 27
      if python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_normal.dat 6
      then
        echo "Accuracy test passed"
      else
        echo "Accuracy test failed"
        exit 1
      fi
28
    else
29 30
      echo "Error Missing test output file"
      exit 1
31 32 33 34
    fi

    echo "------------"

35 36 37 38 39
  done

  # Test for particles with random smoothing lengths
  for v in {0..3}
  do
40
    echo ""
41

42 43
    rm -f brute_force_27_standard.dat swift_dopair_27_standard.dat

44 45
    echo "Running ./$TEST -n 6 -r 1 -d 0 -f standard -v $v -p 1.1"
    ./$TEST -n 6 -r 1 -d 0 -f standard -v $v -p 1.1
46 47 48

    if [ -e brute_force_27_standard.dat ]
    then
49 50 51 52 53 54 55
      if python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_perturbed_h.dat 6
      then
        echo "Accuracy test passed"
      else
        echo "Accuracy test failed"
        exit 1
      fi
56
    else
57 58
      echo "Error Missing test output file"
      exit 1
59 60 61 62
    fi

    echo "------------"

63 64 65 66 67
  done

  # Test for particles with random smoothing lengths
  for v in {0..3}
  do
68
    echo ""
69

70 71
    rm -f brute_force_27_standard.dat swift_dopair_27_standard.dat

72 73
    echo "Running ./$TEST -n 6 -r 1 -d 0 -f standard -v $v -p 1.3"
    ./$TEST -n 6 -r 1 -d 0 -f standard -v $v -p 1.3
74 75 76

    if [ -e brute_force_27_standard.dat ]
    then
77 78 79 80 81 82 83
      if python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_perturbed_h2.dat 6
      then
        echo "Accuracy test passed"
      else
        echo "Accuracy test failed"
        exit 1
      fi
84
    else
85 86
      echo "Error Missing test output file"
      exit 1
87 88
    fi

89
    echo "------------"
90 91

  done
92
done
93 94

exit $?