~fluidity-core/fluidity/sea-ice-branch

« back to all changes in this revision

Viewing changes to tests/mphase_mms_p2p1_stress_form/mphase_mms_p2p1_stress_form.xml

  • Committer: Simon Mouradian
  • Date: 2012-10-19 10:35:59 UTC
  • mfrom: (3520.32.371 fluidity)
  • Revision ID: simon.mouradian06@imperial.ac.uk-20121019103559-y36qa47phc69q8sc
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" ?>
 
2
 
 
3
<testproblem>
 
4
 
 
5
  <name>mphase_mms_p2p1_stress_form</name>
 
6
  <owner userid="ctj10"/>
 
7
  <tags>flml</tags>
 
8
  
 
9
  <problem_definition length="medium" nprocs="1">
 
10
    <command_line>make run</command_line>
 
11
  </problem_definition>
 
12
  
 
13
  <variables>
 
14
  
 
15
    <variable name="ab_convergence_vel" language="python">
 
16
from fluidity_tools import stat_parser as stat
 
17
from math import log
 
18
 
 
19
print "Calculating errors for Fluid1 Velocity in A-B convergence test"
 
20
a_error_x = stat("MMS_A.stat")["Fluid1"]["VelocityError%1"]["l2norm"][-1]
 
21
a_error_y = stat("MMS_A.stat")["Fluid1"]["VelocityError%2"]["l2norm"][-1]
 
22
b_error_x = stat("MMS_B.stat")["Fluid1"]["VelocityError%1"]["l2norm"][-1]
 
23
b_error_y = stat("MMS_B.stat")["Fluid1"]["VelocityError%2"]["l2norm"][-1]
 
24
 
 
25
print a_error_x
 
26
print a_error_y
 
27
print b_error_x
 
28
print b_error_y
 
29
 
 
30
ab_ratio_x = a_error_x / b_error_x
 
31
ab_ratio_y = a_error_y / b_error_y
 
32
ab_ratio_f1 = [log(ab_ratio_x, 2), log(ab_ratio_y, 2)]
 
33
 
 
34
print "Calculating errors for Fluid2 Velocity in A-B convergence test"
 
35
a_error_x = stat("MMS_A.stat")["Fluid2"]["VelocityError%1"]["l2norm"][-1]
 
36
a_error_y = stat("MMS_A.stat")["Fluid2"]["VelocityError%2"]["l2norm"][-1]
 
37
b_error_x = stat("MMS_B.stat")["Fluid2"]["VelocityError%1"]["l2norm"][-1]
 
38
b_error_y = stat("MMS_B.stat")["Fluid2"]["VelocityError%2"]["l2norm"][-1]
 
39
 
 
40
print a_error_x
 
41
print a_error_y
 
42
print b_error_x
 
43
print b_error_y
 
44
 
 
45
ab_ratio_x = a_error_x / b_error_x
 
46
ab_ratio_y = a_error_y / b_error_y
 
47
ab_ratio_f2 = [log(ab_ratio_x, 2), log(ab_ratio_y, 2)]
 
48
 
 
49
ab_convergence_vel = [ab_ratio_f1, ab_ratio_f2]
 
50
    </variable>
 
51
    
 
52
    <variable name="ab_convergence_p" language="python">
 
53
from fluidity_tools import stat_parser as stat
 
54
from math import log
 
55
 
 
56
print "Calculating errors for common Pressure in A-B convergence test"
 
57
a_error = stat("MMS_A.stat")["Fluid1"]["PressureError"]["l2norm"][-1]
 
58
b_error = stat("MMS_B.stat")["Fluid1"]["PressureError"]["l2norm"][-1]
 
59
 
 
60
print a_error
 
61
print b_error
 
62
 
 
63
ab_ratio = a_error / b_error
 
64
ab_convergence_p = log(ab_ratio, 2)
 
65
    </variable>
 
66
    
 
67
    <variable name="bc_convergence_vel" language="python">
 
68
from fluidity_tools import stat_parser as stat
 
69
from math import log
 
70
 
 
71
print "Calculating errors for Fluid1 Velocity in B-C convergence test"
 
72
b_error_x = stat("MMS_B.stat")["Fluid1"]["VelocityError%1"]["l2norm"][-1]
 
73
b_error_y = stat("MMS_B.stat")["Fluid1"]["VelocityError%2"]["l2norm"][-1]
 
74
c_error_x = stat("MMS_C.stat")["Fluid1"]["VelocityError%1"]["l2norm"][-1]
 
75
c_error_y = stat("MMS_C.stat")["Fluid1"]["VelocityError%2"]["l2norm"][-1]
 
76
 
 
77
print b_error_x
 
78
print b_error_y
 
79
print c_error_x
 
80
print c_error_y
 
81
 
 
82
bc_ratio_x = b_error_x / c_error_x
 
83
bc_ratio_y = b_error_y / c_error_y
 
84
bc_ratio_f1 = [log(bc_ratio_x, 2), log(bc_ratio_y, 2)]
 
85
 
 
86
print "Calculating errors for Fluid2 Velocity in B-C convergence test"
 
87
b_error_x = stat("MMS_B.stat")["Fluid2"]["VelocityError%1"]["l2norm"][-1]
 
88
b_error_y = stat("MMS_B.stat")["Fluid2"]["VelocityError%2"]["l2norm"][-1]
 
89
c_error_x = stat("MMS_C.stat")["Fluid2"]["VelocityError%1"]["l2norm"][-1]
 
90
c_error_y = stat("MMS_C.stat")["Fluid2"]["VelocityError%2"]["l2norm"][-1]
 
91
 
 
92
print b_error_x
 
93
print b_error_y
 
94
print c_error_x
 
95
print c_error_y
 
96
 
 
97
bc_ratio_x = b_error_x / c_error_x
 
98
bc_ratio_y = b_error_y / c_error_y
 
99
bc_ratio_f2 = [log(bc_ratio_x, 2), log(bc_ratio_y, 2)]
 
100
 
 
101
bc_convergence_vel = [bc_ratio_f1, bc_ratio_f2]
 
102
    </variable>
 
103
    
 
104
    <variable name="bc_convergence_p" language="python">
 
105
from fluidity_tools import stat_parser as stat
 
106
from math import log
 
107
 
 
108
print "Calculating errors for common Pressure in B-C convergence test"
 
109
b_error = stat("MMS_B.stat")["Fluid1"]["PressureError"]["l2norm"][-1]
 
110
c_error = stat("MMS_C.stat")["Fluid1"]["PressureError"]["l2norm"][-1]
 
111
 
 
112
print b_error
 
113
print c_error
 
114
 
 
115
bc_ratio = b_error / c_error
 
116
bc_convergence_p = log(bc_ratio, 2)
 
117
    </variable>
 
118
 
 
119
    <variable name="solvers_converged" language="python">
 
120
import os
 
121
files = os.listdir("./")
 
122
solvers_converged = not "matrixdump" in files and not "matrixdump.info" in files
 
123
    </variable>
 
124
  </variables>
 
125
  
 
126
  <pass_tests>
 
127
    <test name="ab_convergence_vel_x for Fluid1: L2 order > 2.8" language="python">
 
128
assert(ab_convergence_vel[0][0] &gt; 2.8)
 
129
    </test>
 
130
    <test name="ab_convergence_vel_y for Fluid1: L2 order > 2.8" language="python">
 
131
assert(ab_convergence_vel[0][1] &gt; 2.8)
 
132
    </test>
 
133
    
 
134
    <test name="ab_convergence_vel_x for Fluid2: L2 order > 2.8" language="python">
 
135
assert(ab_convergence_vel[1][0] &gt; 2.8)
 
136
    </test>
 
137
    <test name="ab_convergence_vel_y for Fluid2: L2 order > 2.8" language="python">
 
138
assert(ab_convergence_vel[1][1] &gt; 2.8)
 
139
    </test>
 
140
    
 
141
    <test name="ab_convergence_p: L2 order > 2.0" language="python">
 
142
assert(ab_convergence_p &gt; 2.0)
 
143
    </test>
 
144
    
 
145
    <test name="bc_convergence_vel_x for Fluid1: L2 order > 2.8" language="python">
 
146
assert(bc_convergence_vel[0][0] &gt; 2.8)
 
147
    </test>
 
148
    <test name="bc_convergence_vel_y for Fluid1: L2 order > 2.8" language="python">
 
149
assert(bc_convergence_vel[0][1] &gt; 2.8)
 
150
    </test>
 
151
    
 
152
    <test name="bc_convergence_vel_x for Fluid2: L2 order > 2.8" language="python">
 
153
assert(bc_convergence_vel[1][0] &gt; 2.8)
 
154
    </test>
 
155
    <test name="bc_convergence_vel_y for Fluid2: L2 order > 2.8" language="python">
 
156
assert(bc_convergence_vel[1][1] &gt; 2.8)
 
157
    </test>
 
158
    
 
159
    <test name="bc_convergence_p: L2 order > 2.0" language="python">
 
160
assert(bc_convergence_p &gt; 2.0)
 
161
    </test>
 
162
    
 
163
    <test name="Solvers converged" language="python">
 
164
assert(solvers_converged)
 
165
    </test>
 
166
    
 
167
  </pass_tests>
 
168
  
 
169
  <warn_tests>
 
170
  </warn_tests>
 
171
  
 
172
</testproblem>
 
173