run.sh 1.27 KB
Newer Older
lhausamm's avatar
lhausamm committed
1
2
#!/bin/bash

Loic Hausammann's avatar
Loic Hausammann committed
3
4
# This example is based on the AGORA disk article (DOI: 10.3847/1538-4357/833/2/202)

5
6
7
# currently only the low resolution is available
sim=low

Loic Hausammann's avatar
Gear    
Loic Hausammann committed
8
9
rm agora_disk_0*.hdf5

Loic Hausammann's avatar
Loic Hausammann committed
10
# make run.sh fail if a subcommand fails
11
12
set -e

lhausamm's avatar
lhausamm committed
13
# Generate the initial conditions if they are not present.
14
if [ ! -e $sim.hdf5 ]
lhausamm's avatar
lhausamm committed
15
16
then
    echo "Fetching initial glass file for the Sedov blast example..."
Loic Hausammann's avatar
Loic Hausammann committed
17
    ./getIC.sh $sim
lhausamm's avatar
lhausamm committed
18
19
fi

lhausamm's avatar
lhausamm committed
20
21
22
23
# Get the Grackle cooling table
if [ ! -e CloudyData_UVB=HM2012.h5 ]
then
    echo "Fetching the Cloudy tables required by Grackle..."
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
24
25
26
27
28
29
30
    ../../Cooling/getGrackleCoolingTable.sh
fi

if [ ! -e chemistry-AGB+OMgSFeZnSrYBaEu-16072013.h5 ]
then
    echo "Fetching the chemistry tables..."
    ../getChemistryTable.sh
lhausamm's avatar
lhausamm committed
31
32
fi

Loic Hausammann's avatar
Loic Hausammann committed
33
# copy the initial conditions
34
cp $sim.hdf5 agora_disk.hdf5
Loic Hausammann's avatar
Loic Hausammann committed
35
# Update the particle types
Loic Hausammann's avatar
Loic Hausammann committed
36
python3 changeType.py agora_disk.hdf5
lhausamm's avatar
lhausamm committed
37
38

# Run SWIFT
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
39
../../swift --sync --limiter --cooling --hydro --self-gravity --star-formation --feedback --stars --threads=8 agora_disk.yml 2>&1 | tee output.log
Loic Hausammann's avatar
Loic Hausammann committed
40

lhausamm's avatar
lhausamm committed
41

lhausamm's avatar
lhausamm committed
42
echo "Changing smoothing length to be Gadget compatible"
Loic Hausammann's avatar
Loic Hausammann committed
43
44
python3 cleanupSwift.py agora_disk_0000.hdf5 agora_disk_IC.hdf5
python3 cleanupSwift.py agora_disk_0050.hdf5 agora_disk_500Myr.hdf5
lhausamm's avatar
lhausamm committed
45

Loic Hausammann's avatar
Loic Hausammann committed
46
echo "Fetching GEAR solution..."
47
48
./getSolution.sh

lhausamm's avatar
lhausamm committed
49
50

echo "Plotting..."
51
python3 plotSolution.py