1
<?xml version='1.0' encoding='utf-8'?>
4
<string_value lines="1">mms_adjoint_D</string_value>
8
<integer_value rank="0">1</integer_value>
10
<mesh name="CoordinateMesh">
11
<from_file file_name="mms_D">
12
<format name="triangle"/>
18
<mesh name="VelocityMesh">
20
<mesh name="CoordinateMesh"/>
28
<integer_value rank="0">4</integer_value>
33
<dump_format>vtk</dump_format>
34
<dump_period_in_timesteps>
36
<integer_value rank="0">1</integer_value>
38
</dump_period_in_timesteps>
39
<output_mesh name="VelocityMesh"/>
43
<real_value rank="0">0</real_value>
46
<real_value rank="0">0.125</real_value>
49
<real_value rank="0">1</real_value>
51
<nonlinear_iterations>
52
<integer_value rank="0">4</integer_value>
53
</nonlinear_iterations>
55
<material_phase name="Fluid">
56
<scalar_field name="Velocity" rank="0">
58
<mesh name="VelocityMesh"/>
59
<temporal_discretisation>
61
<real_value rank="0">0.5</real_value>
64
<real_value rank="0">0.5</real_value>
66
</temporal_discretisation>
68
<iterative_method name="preonly"/>
69
<preconditioner name="lu"/>
71
<real_value rank="0">1e-16</real_value>
74
<real_value rank="0">1e-12</real_value>
77
<integer_value rank="0">10000</integer_value>
79
<never_ignore_solver_failures/>
84
<initial_condition name="WholeMesh">
86
<string_value lines="20" type="python">def val(X, t):
87
from math import sin, cos
89
return sin(x) + cos(x)</string_value>
92
<boundary_conditions name="bc">
94
<integer_value shape="2" rank="1">1 2</integer_value>
96
<type name="dirichlet">
98
<string_value lines="20" type="python">def val(X, t):
99
from math import sin, cos
101
return sin(x) + cos(x)</string_value>
104
</boundary_conditions>
106
<real_value rank="0">1</real_value>
112
<scalar_field name="Source" rank="0">
114
<value name="WholeMesh">
116
<string_value lines="20" type="python">def val(X, t):
117
from math import sin, cos
120
return y</string_value>
127
<scalar_field name="AnalyticalSolution" rank="0">
129
<mesh name="VelocityMesh"/>
130
<value name="WholeMesh">
132
<string_value lines="20" type="python">def val(X, t):
133
from math import sin, cos
135
return sin(x) + cos(x)</string_value>
143
<scalar_field name="Error" rank="0">
145
<mesh name="VelocityMesh"/>
146
<algorithm name="scalar_python_diagnostic" material_phase_support="single">
147
<string_value lines="20" type="python">soln = state.scalar_fields["Velocity"]
148
exact = state.scalar_fields["AnalyticalSolution"]
150
for i in range(field.node_count):
151
field.set(i, abs(soln.node_val(i) - exact.node_val(i)))</string_value>
162
<max_memory_checkpoints>
163
<integer_value rank="0">3</integer_value>
164
</max_memory_checkpoints>
165
<max_disk_checkpoints>
166
<integer_value rank="0">0</integer_value>
167
</max_disk_checkpoints>
169
<functional name="time_integral_ad">
171
<algorithm name="functional_value">
172
<string_value lines="20" type="python">import numpy
176
if time < 1.0 <= time+dt:
177
coord = states[0]["Fluid"].vector_fields["Coordinate"]
178
u = states[n]["Fluid"].scalar_fields["Velocity"]
180
for ele in range(coord.element_count):
181
t = Transform(ele, coord)
182
shape = u.ele_shape(ele)
183
mass = t.shape_shape(shape, shape)
184
J = J + 0.5 * numpy.dot(u.ele_val(ele), numpy.dot(mass, u.ele_val(ele)))
185
# print "Got functional value: ", J
187
#if hasattr(J, "nominal_value"):
188
# print "u.val: ", u.val
189
# print "delJ/delu: ", [J.derivatives[x] for x in u.val]
190
# print "J.nominal_value: ", J.nominal_value</string_value>
196
<functional_dependencies>
197
<algorithm name="functional_dependencies">
198
<string_value lines="20" type="python">def dependencies(times, timestep):
199
if times[0] < 1.0 <= times[1]:
200
return {"Fluid::Coordinate": [0],
201
"Fluid::Velocity": [timestep]}
203
return {}</string_value>
205
</functional_dependencies>
208
<control name="InitialCondition">
209
<type field_name="Fluid::Velocity" name="initial_condition"/>
b'\\ No newline at end of file'