aboutsummaryrefslogtreecommitdiff
path: root/m/McLachlan.sh
blob: d305eaae3012f689d83d6078e1d1cb1cf37ec80c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/bash

# Run this script in the "m" subdirectory.
# It re-generates the Cactus thorns trees and copies them if they have
# changed.

#MATHEMATICA="/Applications/Mathematica.app/Contents/MacOS/MathKernel"
MATHEMATICA="math"

# Remove old output
rm -rf ML_ADM ML_BSSN

# Run Mathematica to regenerate the code
< McLachlan.m "$MATHEMATICA" | tee McLachlan.out

if grep 'KrancError' McLachlan.out > /dev/null 2>&1; then
    echo
    echo "There was an error when running Kranc."
    echo "The file McLachlan.out contains details."
    echo
    echo "*** The Cactus thorns have NOT been updated. ***"
    echo
    exit 1
fi

# Copy the source trees
./copy-if-changed.sh ML_ADM ../ML_ADM
./copy-if-changed.sh ML_BSSN ../ML_BSSN

echo
echo "The Cactus thorns have been successfully regenerated."
echo