forked from farhaddaei/BATSRUS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestSuite.pl
executable file
·134 lines (105 loc) · 4.59 KB
/
TestSuite.pl
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/bin/perl -s
# Copyright (C) 2002 Regents of the University of Michigan,
# portions used with permission
# For more information, see http://csem.engin.umich.edu/tools/swmf
my $DefaultExe = "BATSRUS.exe";
my $Help = $h;
my $Verbose= $v+0;
my $RunDir = ($d or "run");
my $Norun = $norun+0;
my $Execute= ($x or $DefaultExe);
my $Run = ($r or $Run="mpirun -np 2");
my $Flags = $f;
my $Sleep = $s+0;
&print_help if $Help;
# Figure out directory for TestBatsrus.pl
my $Dir = $0; $Dir =~ s/TestSuite\.pl//; $Dir = './' unless $Dir;
my $testbatsrus = "$Dir"."TestBatsrus.pl ".
"-v=$Verbose -norun=$Norun -d=$RunDir -r='$Run' -x=$Execute -f='$Flags' ".
"-s=$Sleep";
# Parameters for "empty" test
my $Empty = "-Planet=earth_simple -Grid=earth_211 -Res=1.0".
" -Length=tiny_simple".
" -B0source=empty -Cfl=empty -Conservative=r6".
" -Corotation=empty -Divb=empty -Reschange=empty -Implicit=empty".
" -Inner=ionosphere -Message=empty -Outer=inflowsidesfixed".
" -Stage=empty -Time=empty -Timestep=empty -Upstream=empty";
&execute($testbatsrus,"-beta -rusanov -idltecamr");
&execute($testbatsrus,"-beta -linde");
&execute($testbatsrus,"-beta -sokolov -idltecamr");
&execute($testbatsrus,"-mc -roe -Reschange=tvd");
&execute($testbatsrus,"-Conservative=r6 -rusanov");
&execute($testbatsrus,"-Conservative=adapt -linde");
&execute($testbatsrus,"-Conservative=r6 -sokolov");
&execute($testbatsrus,"-Conservative=r6 -roeold");
&execute($testbatsrus,"-borisfull -rusanov");
&execute($testbatsrus,"-borisfull -linde");
&execute($testbatsrus,"-borisfull -sokolov");
&execute($testbatsrus,"-borissimple -rusanov");
&execute($testbatsrus,"-borissimple -linde");
&execute($testbatsrus,"-ta -hlld -Conservative=r6 -idltecamr");
&execute($testbatsrus,"-ta -Conservative=r6 -borisfull");
&execute($testbatsrus,"-ta -Conservative=r6 -borissimple");
&execute($testbatsrus,"-Inner=float");
&execute($testbatsrus,"-Inner=reflect");
&execute($testbatsrus,"-Limiter=mc -Resist=hall");
&execute($testbatsrus,"-Limiter=mc3 -hlld");
&execute($testbatsrus,"-ta -Stage=2 -partimpl05 -Limiter=mc3",
"-hall -logsatmove -Reschange=accurate -Length=tiny_ta");
&execute($testbatsrus,"-ta -Stage=2 -constrain",
"-Grid=earth_uniform -Res=2.0 -Length=tiny_ta_noamr");
&execute($testbatsrus,"-ta -Stage=2 -project -Length=tiny_ta");
&execute($testbatsrus,"-ta -Stage=2 -diffuse -Length=tiny_ta");
&execute($testbatsrus,"-ta -Stage=2 -partimpl05 -Length=tiny_ta");
&execute($testbatsrus,"-Limiter=mc3 -hlld",
"-Restart=saveone -Length=restartsave");
&execute($testbatsrus,"-Limiter=mc3 -hlld",
"-Restart=read -Length=restartread");
&execute($testbatsrus,"-ta -Conservative=r6 -hlld",
"-Restart=save -Length=restartsave");
&execute($testbatsrus,"-ta -Conservative=r6 -hlld",
"-Restart=read -Length=restartread");
&execute($testbatsrus,"-ta -Corotation=ideal,updateb0 -Length=tiny_ta");
&execute($testbatsrus,"-Plottype=ray -Logtype=ray -nsturning_1nT_tilt");
&execute($testbatsrus,"-Plottype=sph -Logtype=logpntflx");
&execute($testbatsrus,"-Plottype=los");
&execute($testbatsrus, $Empty);
&execute($testbatsrus,"-Plottype=raynew -Logtype=ray -nsturning_1nT_tilt");
exit 0;
##############################################################################
sub execute{
$command = join(' ',@_);
print "$command\n" if $Verbose;
$result = `$command`;
print $result;
}
##############################################################################
#!REVISION HISTORY:
# 01/28/02 G.Toth and A.Ridley - initial version developed for BATSRUS
# 07/10/03 G.Toth - adapted to SWMF
# 03/11/04 G.Toth - moved back into BATSRUS but
# it can be used in SWMF as well
# 03/05/22 G.Toth - now it is striclty for test_func in BATSRUS
sub print_help{
print "
Script to run the BATSRUS functionality tests test_func
TestSuite.pl [-h] [-v] [-norun] [-d=DIR] [-s=SLEEP]
[-r=RUNCOMMAND] [-x=EXECUTABLE] [-f=FLAGS]
-h print this help message
-v verbose
-norun do not run $DefaultExe, just create test directories and parameter files
-s=SLEEP
sleep SLEEP seconds between tests, e.g. use -s=10 for 10 seconds.
-d=DIR
define the run directory. The default is -d=run.
-r=RUNCOMMAND
define the runcommand to be executed. The default runcommand is
-r='mpirun -np 2'. You can specify a machinefile,
or run on a different number of processors.
-x=COMMAND
executable. The default is $DefaultExe
-f=FLAGS
command line flags for the executable. The default is no flags.
"."\n\n";
exit;
}