~reducedmodelling/fluidity/ROM_Non-intrusive-ann

« back to all changes in this revision

Viewing changes to tests/burgers_mms_diffusion_time_integral/burgers_mms_diffusion_time_integral.xml

  • Committer: pef
  • Date: 2011-04-01 12:28:06 UTC
  • Revision ID: svn-v4:5bf5533e-7014-46e3-b1bb-cce4b9d03719:trunk:3428
Add another burgers equation MMS adjoint test.

This one tests something much harder to get right. The
functional is the spacetime integral of the velocity.
The simulation is engineered in such a way that the velocity
field is sin(x+t).

The first test is that the forward simulation is converging
at second-order in both space and time. (I don't know why
the group has this idea floating around that checking the temporal
order of convergence is hard; it's not.) The second test
is that the functional value is converging at second-order
to the true value.

The next test (to come) will check that the derivatives
computed with automatic differentiation give the same results
as those computed by hand.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" ?>
 
2
<!DOCTYPE testproblem SYSTEM "regressiontest.dtd">
 
3
<testproblem>
 
4
  <name>Burgers Equation MMS</name>
 
5
  <owner userid="pef"/>
 
6
  <tags>burgers</tags>
 
7
  <problem_definition length="medium" nprocs="1">
 
8
    <command_line>burgers_equation mms_A.bml; burgers_equation mms_B.bml; burgers_equation mms_C.bml; burgers_equation mms_D.bml; burgers_equation mms_E.bml</command_line>
 
9
  </problem_definition>
 
10
  <variables>
 
11
    <variable name="ab_error" language="python">
 
12
from fluidity_tools import stat_parser as stat
 
13
from math import log
 
14
 
 
15
a_error = stat("mms_diffusion_adjoint_A.stat")["Fluid"]["Error"]["l2norm"][-1]
 
16
b_error = stat("mms_diffusion_adjoint_B.stat")["Fluid"]["Error"]["l2norm"][-1]
 
17
 
 
18
a_error_inf = stat("mms_diffusion_adjoint_A.stat")["Fluid"]["Error"]["max"][-1]
 
19
b_error_inf = stat("mms_diffusion_adjoint_B.stat")["Fluid"]["Error"]["max"][-1]
 
20
 
 
21
ab_ratio = a_error / b_error
 
22
ab_ratio_inf = a_error_inf / b_error_inf
 
23
ab_error = [log(ab_ratio, 2)]
 
24
    </variable>
 
25
    <variable name="bc_error" language="python">
 
26
from fluidity_tools import stat_parser as stat
 
27
from math import log
 
28
 
 
29
b_error = stat("mms_diffusion_adjoint_B.stat")["Fluid"]["Error"]["l2norm"][-1]
 
30
c_error = stat("mms_diffusion_adjoint_C.stat")["Fluid"]["Error"]["l2norm"][-1]
 
31
 
 
32
b_error_inf = stat("mms_diffusion_adjoint_B.stat")["Fluid"]["Error"]["max"][-1]
 
33
c_error_inf = stat("mms_diffusion_adjoint_C.stat")["Fluid"]["Error"]["max"][-1]
 
34
 
 
35
bc_ratio = b_error / c_error
 
36
bc_ratio_inf = b_error_inf / c_error_inf
 
37
bc_error = [log(bc_ratio, 2)]
 
38
    </variable>
 
39
    <variable name="cd_error" language="python">
 
40
from fluidity_tools import stat_parser as stat
 
41
from math import log
 
42
 
 
43
c_error = stat("mms_diffusion_adjoint_C.stat")["Fluid"]["Error"]["l2norm"][-1]
 
44
d_error = stat("mms_diffusion_adjoint_D.stat")["Fluid"]["Error"]["l2norm"][-1]
 
45
 
 
46
c_error_inf = stat("mms_diffusion_adjoint_C.stat")["Fluid"]["Error"]["max"][-1]
 
47
d_error_inf = stat("mms_diffusion_adjoint_D.stat")["Fluid"]["Error"]["max"][-1]
 
48
 
 
49
cd_ratio = c_error / d_error
 
50
cd_ratio_inf = c_error_inf / d_error_inf
 
51
cd_error = [log(cd_ratio, 2)]
 
52
    </variable>
 
53
    <variable name="de_error" language="python">
 
54
from fluidity_tools import stat_parser as stat
 
55
from math import log
 
56
 
 
57
d_error = stat("mms_diffusion_adjoint_D.stat")["Fluid"]["Error"]["l2norm"][-1]
 
58
e_error = stat("mms_diffusion_adjoint_E.stat")["Fluid"]["Error"]["l2norm"][-1]
 
59
 
 
60
d_error_inf = stat("mms_diffusion_adjoint_D.stat")["Fluid"]["Error"]["max"][-1]
 
61
e_error_inf = stat("mms_diffusion_adjoint_E.stat")["Fluid"]["Error"]["max"][-1]
 
62
 
 
63
de_ratio = d_error / e_error
 
64
de_ratio_inf = d_error_inf / e_error_inf
 
65
de_error = [log(de_ratio, 2)]
 
66
    </variable>
 
67
    <variable name="ab_func_error" language="python">
 
68
truth = -2.00098747251
 
69
from fluidity_tools import stat_parser as stat
 
70
from math import log
 
71
 
 
72
a_func = stat("mms_diffusion_adjoint_A_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
73
b_func = stat("mms_diffusion_adjoint_B_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
74
 
 
75
a_error = abs(truth - a_func)
 
76
b_error = abs(truth - b_func)
 
77
 
 
78
ab_func_error = log(a_error/b_error, 2)
 
79
    </variable>
 
80
    <variable name="bc_func_error" language="python">
 
81
truth = -2.00098747251
 
82
from fluidity_tools import stat_parser as stat
 
83
from math import log
 
84
 
 
85
b_func = stat("mms_diffusion_adjoint_B_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
86
c_func = stat("mms_diffusion_adjoint_C_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
87
 
 
88
b_error = abs(truth - b_func)
 
89
c_error = abs(truth - c_func)
 
90
 
 
91
bc_func_error = log(b_error/c_error, 2)
 
92
    </variable>
 
93
    <variable name="cd_func_error" language="python">
 
94
truth = -2.00098747251
 
95
from fluidity_tools import stat_parser as stat
 
96
from math import log
 
97
 
 
98
c_func = stat("mms_diffusion_adjoint_C_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
99
d_func = stat("mms_diffusion_adjoint_D_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
100
 
 
101
c_error = abs(truth - c_func)
 
102
d_error = abs(truth - d_func)
 
103
 
 
104
cd_func_error = log(c_error/d_error, 2)
 
105
    </variable>
 
106
    <variable name="de_func_error" language="python">
 
107
truth = -2.00098747251
 
108
from fluidity_tools import stat_parser as stat
 
109
from math import log
 
110
 
 
111
d_func = stat("mms_diffusion_adjoint_D_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
112
e_func = stat("mms_diffusion_adjoint_E_adjoint_time_integral_ad.stat")["time_integral_ad"]["value"][-1]
 
113
 
 
114
d_error = abs(truth - d_func)
 
115
e_error = abs(truth - e_func)
 
116
 
 
117
de_func_error = log(d_error/e_error, 2)
 
118
    </variable>
 
119
  </variables>
 
120
  <pass_tests>
 
121
    <test name="ab_convergence_stat: L2 order > 1.8" language="python">
 
122
assert 1.8 &lt; ab_error[0]
 
123
    </test>
 
124
    <test name="bc_convergence_stat: L2 order > 1.8" language="python">
 
125
assert 1.8 &lt; bc_error[0]
 
126
    </test>
 
127
    <test name="cd_convergence_stat: L2 order > 1.8" language="python">
 
128
assert 1.8 &lt; cd_error[0]
 
129
    </test>
 
130
    <test name="de_convergence_stat: L2 order > 1.8" language="python">
 
131
assert 1.8 &lt; de_error[0]
 
132
    </test>
 
133
    <test name="ab_func_error: order in [1.8,2.2]" language="python">
 
134
assert(abs(ab_func_error-2.0) &lt; 0.2)
 
135
    </test>
 
136
    <test name="bc_func_error: order in [1.8,2.2]" language="python">
 
137
assert(abs(bc_func_error-2.0) &lt; 0.2)
 
138
    </test>
 
139
    <test name="cd_func_error: order in [1.8,2.2]" language="python">
 
140
assert(abs(cd_func_error-2.0) &lt; 0.2)
 
141
    </test>
 
142
    <test name="de_func_error: order in [1.8,2.2]" language="python">
 
143
assert(abs(de_func_error-2.0) &lt; 0.2)
 
144
    </test>
 
145
  </pass_tests>
 
146
  <warn_tests>
 
147
  </warn_tests>
 
148
</testproblem>
 
149