Merge lp:~j-percival/fluidity/periodic-adaptivity-at-first-timestep into lp:fluidity
- periodic-adaptivity-at-first-timestep
- Merge into dev-trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~j-percival/fluidity/periodic-adaptivity-at-first-timestep |
Merge into: | lp:fluidity |
Diff against target: |
679 lines (+586/-9) 8 files modified
assemble/Adapt_State.F90 (+1/-3) preprocessor/Populate_State.F90 (+6/-6) tests/periodic_adaptivity_at_first_timestep/Makefile (+6/-0) tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.flml (+239/-0) tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.stat (+64/-0) tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.xml (+24/-0) tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep_periodised.flml (+234/-0) tests/periodic_adaptivity_at_first_timestep/src/MMS_B.geo (+12/-0) |
To merge this branch: | bzr merge lp:~j-percival/fluidity/periodic-adaptivity-at-first-timestep |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stephan Kramer | Pending | ||
Review via email: mp+94218@code.launchpad.net |
This proposal has been superseded by a proposal from 2013-06-25.
Commit message
Description of the change
This pulls out Cian's two fixes with regard to peroiodic adaptivity and adds a test (pretty much copied exactly from Patrick's to confirm that the functionality works. Note that while the test fails on an unfixed branch, it may need extending for more insidious failure modes
Stephan Kramer (s-kramer) wrote : | # |
James Robert Percival (j-percival) wrote : | # |
Thanks for the comments Stephan.
To address your questions:
I was slightly at a loss at what precisely to test for, so copied the basic structure of the periodic_adaptivity test, checking that the problem exited gracefully, produced output and that the maximum of the interpolated field was correct. Given my understanding of the code path, I suspect the second test is in fact redundant. However, I suspect there are ways the code could fail to produce a usable mesh while still producing output which passes the tests.
I would argue there is value in having a separate test problem for the adapt_at_
Unmerged revisions
Preview Diff
1 | === modified file 'assemble/Adapt_State.F90' |
2 | --- assemble/Adapt_State.F90 2011-09-28 13:38:45 +0000 |
3 | +++ assemble/Adapt_State.F90 2012-02-22 16:35:01 +0000 |
4 | @@ -880,7 +880,6 @@ |
5 | |
6 | character(len = *), parameter :: base_path = "/mesh_adaptivity/hr_adaptivity/adapt_at_first_timestep" |
7 | integer :: adapt_iterations, i |
8 | - type(mesh_type), pointer :: old_mesh |
9 | type(tensor_field) :: metric |
10 | type(vector_field), pointer :: output_positions |
11 | real :: dt |
12 | @@ -910,8 +909,7 @@ |
13 | end if |
14 | |
15 | ! Form the new metric |
16 | - old_mesh => extract_mesh(states(1), "CoordinateMesh") |
17 | - call allocate(metric, old_mesh, "ErrorMetric") |
18 | + call allocate(metric, extract_mesh(states(1), topology_mesh_name), "ErrorMetric") |
19 | call assemble_metric(states, metric) |
20 | |
21 | ! Adapt state, initialising fields from the options tree rather than |
22 | |
23 | === modified file 'preprocessor/Populate_State.F90' |
24 | --- preprocessor/Populate_State.F90 2012-01-30 15:36:17 +0000 |
25 | +++ preprocessor/Populate_State.F90 2012-02-22 16:35:01 +0000 |
26 | @@ -1911,12 +1911,12 @@ |
27 | adapt_path=trim(path)//"/adaptivity_options" |
28 | if(have_option(trim(adapt_path)//"/absolute_measure")) then |
29 | adapt_path=trim(adapt_path)//"/absolute_measure/scalar_field::InterpolationErrorBound" |
30 | - call allocate_and_insert_scalar_field(adapt_path, state, parent_mesh=mesh_name, & |
31 | + call allocate_and_insert_scalar_field(adapt_path, state, parent_mesh=topology_mesh_name, & |
32 | parent_name=lfield_name, & |
33 | dont_allocate_prognostic_value_spaces=dont_allocate_prognostic_value_spaces) |
34 | else if(have_option(trim(adapt_path)//"/relative_measure")) then |
35 | adapt_path=trim(adapt_path)//"/relative_measure/scalar_field::InterpolationErrorBound" |
36 | - call allocate_and_insert_scalar_field(adapt_path, state, parent_mesh=mesh_name, & |
37 | + call allocate_and_insert_scalar_field(adapt_path, state, parent_mesh=topology_mesh_name, & |
38 | parent_name=lfield_name, & |
39 | dont_allocate_prognostic_value_spaces=dont_allocate_prognostic_value_spaces) |
40 | end if |
41 | @@ -2044,11 +2044,11 @@ |
42 | adapt_path=trim(path)//"/adaptivity_options" |
43 | if(have_option(trim(adapt_path)//"/absolute_measure")) then |
44 | adapt_path=trim(adapt_path)//"/absolute_measure/vector_field::InterpolationErrorBound" |
45 | - call allocate_and_insert_vector_field(adapt_path, state, mesh_name, lfield_name, & |
46 | + call allocate_and_insert_vector_field(adapt_path, state, topology_mesh_name, lfield_name, & |
47 | dont_allocate_prognostic_value_spaces=dont_allocate_prognostic_value_spaces) |
48 | else if(have_option(trim(adapt_path)//"/relative_measure")) then |
49 | adapt_path=trim(adapt_path)//"/relative_measure/vector_field::InterpolationErrorBound" |
50 | - call allocate_and_insert_vector_field(adapt_path, state, mesh_name, lfield_name, & |
51 | + call allocate_and_insert_vector_field(adapt_path, state, topology_mesh_name, lfield_name, & |
52 | dont_allocate_prognostic_value_spaces=dont_allocate_prognostic_value_spaces) |
53 | end if |
54 | |
55 | @@ -2164,11 +2164,11 @@ |
56 | adapt_path=trim(path)//"/adaptivity_options" |
57 | if(have_option(trim(adapt_path)//"/absolute_measure")) then |
58 | adapt_path=trim(adapt_path)//"/absolute_measure/tensor_field::InterpolationErrorBound" |
59 | - call allocate_and_insert_tensor_field(adapt_path, state, mesh_name, field_name, & |
60 | + call allocate_and_insert_tensor_field(adapt_path, state, topology_mesh_name, field_name, & |
61 | dont_allocate_prognostic_value_spaces=dont_allocate_prognostic_value_spaces) |
62 | else if(have_option(trim(adapt_path)//"/relative_measure")) then |
63 | adapt_path=trim(adapt_path)//"/relative_measure/tensor_field::InterpolationErrorBound" |
64 | - call allocate_and_insert_tensor_field(adapt_path, state, mesh_name, field_name, & |
65 | + call allocate_and_insert_tensor_field(adapt_path, state, topology_mesh_name, field_name, & |
66 | dont_allocate_prognostic_value_spaces=dont_allocate_prognostic_value_spaces) |
67 | end if |
68 | |
69 | |
70 | === added directory 'tests/periodic_adaptivity_at_first_timestep' |
71 | === added file 'tests/periodic_adaptivity_at_first_timestep/Makefile' |
72 | --- tests/periodic_adaptivity_at_first_timestep/Makefile 1970-01-01 00:00:00 +0000 |
73 | +++ tests/periodic_adaptivity_at_first_timestep/Makefile 2012-02-22 16:35:01 +0000 |
74 | @@ -0,0 +1,6 @@ |
75 | +input: |
76 | + gmsh -2 src/MMS_B.geo -o MMS_B.msh |
77 | + ../../bin/gmsh2triangle --2d MMS_B.msh |
78 | + |
79 | +clean: |
80 | + rm -f *.vtu *.log-? *.err-? *.msh *.edge *.ele *.node periodic_adaptivity.stat periodic_adaptivity_periodised.flml |
81 | |
82 | === added file 'tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.flml' |
83 | --- tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.flml 1970-01-01 00:00:00 +0000 |
84 | +++ tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.flml 2012-02-22 16:35:01 +0000 |
85 | @@ -0,0 +1,239 @@ |
86 | +<?xml version='1.0' encoding='utf-8'?> |
87 | +<fluidity_options> |
88 | + <simulation_name> |
89 | + <string_value lines="1">periodic_adaptivity_at_first_timestep</string_value> |
90 | + </simulation_name> |
91 | + <problem_type> |
92 | + <string_value lines="1">fluids</string_value> |
93 | + </problem_type> |
94 | + <geometry> |
95 | + <dimension> |
96 | + <integer_value rank="0">2</integer_value> |
97 | + </dimension> |
98 | + <mesh name="CoordinateMesh"> |
99 | + <from_file file_name="MMS_B"> |
100 | + <format name="triangle"/> |
101 | + <stat> |
102 | + <include_in_stat/> |
103 | + </stat> |
104 | + </from_file> |
105 | + </mesh> |
106 | + <mesh name="VelocityMesh"> |
107 | + <from_mesh> |
108 | + <mesh name="PeriodicMesh"/> |
109 | + <stat> |
110 | + <exclude_from_stat/> |
111 | + </stat> |
112 | + </from_mesh> |
113 | + </mesh> |
114 | + <mesh name="PressureMesh"> |
115 | + <from_mesh> |
116 | + <mesh name="PeriodicMesh"/> |
117 | + <stat> |
118 | + <exclude_from_stat/> |
119 | + </stat> |
120 | + </from_mesh> |
121 | + </mesh> |
122 | + <mesh name="PeriodicMesh"> |
123 | + <from_mesh> |
124 | + <mesh name="CoordinateMesh"/> |
125 | + <periodic_boundary_conditions name="x"> |
126 | + <physical_boundary_ids> |
127 | + <integer_value shape="1" rank="1">10</integer_value> |
128 | + </physical_boundary_ids> |
129 | + <aliased_boundary_ids> |
130 | + <integer_value shape="1" rank="1">8</integer_value> |
131 | + </aliased_boundary_ids> |
132 | + <coordinate_map> |
133 | + <string_value lines="20" type="python">def val(X,t): |
134 | + from math import pi |
135 | + return(X[0]-1, X[1])</string_value> |
136 | + </coordinate_map> |
137 | + <inverse_coordinate_map> |
138 | + <string_value lines="20" type="python">def val(X,t): |
139 | + from math import pi |
140 | + return(X[0]+1, X[1])</string_value> |
141 | + </inverse_coordinate_map> |
142 | + </periodic_boundary_conditions> |
143 | + <stat> |
144 | + <exclude_from_stat/> |
145 | + </stat> |
146 | + </from_mesh> |
147 | + </mesh> |
148 | + <quadrature> |
149 | + <degree> |
150 | + <integer_value rank="0">4</integer_value> |
151 | + </degree> |
152 | + </quadrature> |
153 | + </geometry> |
154 | + <io> |
155 | + <dump_format> |
156 | + <string_value>vtk</string_value> |
157 | + </dump_format> |
158 | + <dump_period_in_timesteps> |
159 | + <constant> |
160 | + <integer_value rank="0">1</integer_value> |
161 | + </constant> |
162 | + </dump_period_in_timesteps> |
163 | + <output_mesh name="CoordinateMesh"/> |
164 | + <stat> |
165 | + <output_at_start/> |
166 | + <output_before_adapts/> |
167 | + <output_after_adapts/> |
168 | + </stat> |
169 | + </io> |
170 | + <timestepping> |
171 | + <current_time> |
172 | + <real_value rank="0">0.0</real_value> |
173 | + </current_time> |
174 | + <timestep> |
175 | + <real_value rank="0">1.0</real_value> |
176 | + </timestep> |
177 | + <finish_time> |
178 | + <real_value rank="0">0.0</real_value> |
179 | + </finish_time> |
180 | + </timestepping> |
181 | + <physical_parameters/> |
182 | + <material_phase name="Main"> |
183 | + <vector_field name="Velocity" rank="1"> |
184 | + <prescribed> |
185 | + <mesh name="VelocityMesh"/> |
186 | + <value name="WholeMesh"> |
187 | + <constant> |
188 | + <real_value shape="2" dim1="dim" rank="1">0.0 0.0</real_value> |
189 | + </constant> |
190 | + </value> |
191 | + <output/> |
192 | + <stat> |
193 | + <include_in_stat/> |
194 | + </stat> |
195 | + <detectors> |
196 | + <exclude_from_detectors/> |
197 | + </detectors> |
198 | + </prescribed> |
199 | + </vector_field> |
200 | + <scalar_field name="Unity" rank="0"> |
201 | + <prescribed> |
202 | + <mesh name="VelocityMesh"/> |
203 | + <value name="WholeMesh"> |
204 | + <python> |
205 | + <string_value lines="20" type="python">def val(X, t): |
206 | + #return (X[0]**2 - X[0])/-0.25 |
207 | + return 1.0</string_value> |
208 | + </python> |
209 | + </value> |
210 | + <output/> |
211 | + <stat/> |
212 | + <detectors> |
213 | + <exclude_from_detectors/> |
214 | + </detectors> |
215 | + <adaptivity_options> |
216 | + <absolute_measure> |
217 | + <scalar_field name="InterpolationErrorBound" rank="0"> |
218 | + <prescribed> |
219 | + <value name="WholeMesh"> |
220 | + <constant> |
221 | + <real_value rank="0">0.01</real_value> |
222 | + </constant> |
223 | + </value> |
224 | + <output/> |
225 | + <stat/> |
226 | + <detectors> |
227 | + <exclude_from_detectors/> |
228 | + </detectors> |
229 | + </prescribed> |
230 | + </scalar_field> |
231 | + </absolute_measure> |
232 | + </adaptivity_options> |
233 | + </prescribed> |
234 | + </scalar_field> |
235 | + <scalar_field name="PrognosticFieldConsistent" rank="0"> |
236 | + <prognostic> |
237 | + <mesh name="VelocityMesh"/> |
238 | + <equation name="AdvectionDiffusion"/> |
239 | + <spatial_discretisation> |
240 | + <continuous_galerkin> |
241 | + <stabilisation> |
242 | + <no_stabilisation/> |
243 | + </stabilisation> |
244 | + <advection_terms/> |
245 | + <mass_terms/> |
246 | + </continuous_galerkin> |
247 | + <conservative_advection> |
248 | + <real_value rank="0">1.0</real_value> |
249 | + </conservative_advection> |
250 | + </spatial_discretisation> |
251 | + <temporal_discretisation> |
252 | + <theta> |
253 | + <real_value rank="0">0.5</real_value> |
254 | + </theta> |
255 | + </temporal_discretisation> |
256 | + <solver> |
257 | + <iterative_method name="gmres"> |
258 | + <restart> |
259 | + <integer_value rank="0">30</integer_value> |
260 | + </restart> |
261 | + </iterative_method> |
262 | + <preconditioner name="sor"/> |
263 | + <relative_error> |
264 | + <real_value rank="0">1.0e-8</real_value> |
265 | + </relative_error> |
266 | + <max_iterations> |
267 | + <integer_value rank="0">10000</integer_value> |
268 | + </max_iterations> |
269 | + <never_ignore_solver_failures/> |
270 | + <diagnostics> |
271 | + <monitors/> |
272 | + </diagnostics> |
273 | + </solver> |
274 | + <initial_condition name="WholeMesh"> |
275 | + <constant> |
276 | + <real_value rank="0">1.0</real_value> |
277 | + </constant> |
278 | + </initial_condition> |
279 | + <output/> |
280 | + <stat/> |
281 | + <convergence> |
282 | + <include_in_convergence/> |
283 | + </convergence> |
284 | + <detectors> |
285 | + <include_in_detectors/> |
286 | + </detectors> |
287 | + <steady_state> |
288 | + <include_in_steady_state/> |
289 | + </steady_state> |
290 | + <consistent_interpolation/> |
291 | + </prognostic> |
292 | + </scalar_field> |
293 | + </material_phase> |
294 | + <mesh_adaptivity> |
295 | + <hr_adaptivity> |
296 | + <period> |
297 | + <real_value rank="0">2.0</real_value> |
298 | + </period> |
299 | + <maximum_number_of_nodes> |
300 | + <integer_value rank="0">10000</integer_value> |
301 | + </maximum_number_of_nodes> |
302 | + <disable_gradation/> |
303 | + <tensor_field name="MinimumEdgeLengths"> |
304 | + <anisotropic_symmetric> |
305 | + <constant> |
306 | + <real_value symmetric="true" dim2="dim" shape="2 2" dim1="dim" rank="2">0.01 0.0 0.0 0.01</real_value> |
307 | + </constant> |
308 | + </anisotropic_symmetric> |
309 | + </tensor_field> |
310 | + <tensor_field name="MaximumEdgeLengths"> |
311 | + <anisotropic_symmetric> |
312 | + <constant> |
313 | + <real_value symmetric="true" dim2="dim" shape="2 2" dim1="dim" rank="2">0.1 0.0 0.0 0.1</real_value> |
314 | + </constant> |
315 | + </anisotropic_symmetric> |
316 | + </tensor_field> |
317 | + <adapt_at_first_timestep> |
318 | + <number_of_adapts> |
319 | + <integer_value rank="0">2</integer_value> |
320 | + </number_of_adapts> |
321 | + </adapt_at_first_timestep> |
322 | + </hr_adaptivity> |
323 | + </mesh_adaptivity> |
324 | +</fluidity_options> |
325 | |
326 | === added file 'tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.stat' |
327 | --- tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.stat 1970-01-01 00:00:00 +0000 |
328 | +++ tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.stat 2012-02-22 16:35:01 +0000 |
329 | @@ -0,0 +1,64 @@ |
330 | +<header> |
331 | +<constant name="FluidityVersion" type="string" value="fluidity.3931" /> |
332 | +<constant name="CompileTime" type="string" value="Feb 22 2012 15:47:10" /> |
333 | +<constant name="StartTime" type="string" value="20120222 161555.083+0000" /> |
334 | +<constant name="HostName" type="string" value="Unknown" /> |
335 | +<constant name="format" type="string" value="plain_text" /> |
336 | +<field column="1" name="ElapsedTime" statistic="value"/> |
337 | +<field column="2" name="dt" statistic="value"/> |
338 | +<field column="3" name="ElapsedWallTime" statistic="value"/> |
339 | +<field column="4" name="PeriodicMesh" statistic="nodes"/> |
340 | +<field column="5" name="PeriodicMesh" statistic="elements"/> |
341 | +<field column="6" name="PeriodicMesh" statistic="surface_elements"/> |
342 | +<field column="7" name="CoordinateMesh" statistic="nodes"/> |
343 | +<field column="8" name="CoordinateMesh" statistic="elements"/> |
344 | +<field column="9" name="CoordinateMesh" statistic="surface_elements"/> |
345 | +<field column="10" name="TotalMemory" statistic="current" material_phase="Memory"/> |
346 | +<field column="11" name="TotalMemory" statistic="min" material_phase="Memory"/> |
347 | +<field column="12" name="TotalMemory" statistic="max" material_phase="Memory"/> |
348 | +<field column="13" name="MeshMemory" statistic="current" material_phase="Memory"/> |
349 | +<field column="14" name="MeshMemory" statistic="min" material_phase="Memory"/> |
350 | +<field column="15" name="MeshMemory" statistic="max" material_phase="Memory"/> |
351 | +<field column="16" name="ScalarFieldMemory" statistic="current" material_phase="Memory"/> |
352 | +<field column="17" name="ScalarFieldMemory" statistic="min" material_phase="Memory"/> |
353 | +<field column="18" name="ScalarFieldMemory" statistic="max" material_phase="Memory"/> |
354 | +<field column="19" name="VectorFieldMemory" statistic="current" material_phase="Memory"/> |
355 | +<field column="20" name="VectorFieldMemory" statistic="min" material_phase="Memory"/> |
356 | +<field column="21" name="VectorFieldMemory" statistic="max" material_phase="Memory"/> |
357 | +<field column="22" name="TensorFieldMemory" statistic="current" material_phase="Memory"/> |
358 | +<field column="23" name="TensorFieldMemory" statistic="min" material_phase="Memory"/> |
359 | +<field column="24" name="TensorFieldMemory" statistic="max" material_phase="Memory"/> |
360 | +<field column="25" name="MatrixSparsityMemory" statistic="current" material_phase="Memory"/> |
361 | +<field column="26" name="MatrixSparsityMemory" statistic="min" material_phase="Memory"/> |
362 | +<field column="27" name="MatrixSparsityMemory" statistic="max" material_phase="Memory"/> |
363 | +<field column="28" name="MatrixMemory" statistic="current" material_phase="Memory"/> |
364 | +<field column="29" name="MatrixMemory" statistic="min" material_phase="Memory"/> |
365 | +<field column="30" name="MatrixMemory" statistic="max" material_phase="Memory"/> |
366 | +<field column="31" name="TransformCacheMemory" statistic="current" material_phase="Memory"/> |
367 | +<field column="32" name="TransformCacheMemory" statistic="min" material_phase="Memory"/> |
368 | +<field column="33" name="TransformCacheMemory" statistic="max" material_phase="Memory"/> |
369 | +<field column="34" name="Unity" statistic="min" material_phase="Main"/> |
370 | +<field column="35" name="Unity" statistic="max" material_phase="Main"/> |
371 | +<field column="36" name="Unity" statistic="l2norm" material_phase="Main"/> |
372 | +<field column="37" name="Unity" statistic="integral" material_phase="Main"/> |
373 | +<field column="38" name="UnityInterpolationErrorBound" statistic="min" material_phase="Main"/> |
374 | +<field column="39" name="UnityInterpolationErrorBound" statistic="max" material_phase="Main"/> |
375 | +<field column="40" name="UnityInterpolationErrorBound" statistic="l2norm" material_phase="Main"/> |
376 | +<field column="41" name="UnityInterpolationErrorBound" statistic="integral" material_phase="Main"/> |
377 | +<field column="42" name="PrognosticFieldConsistent" statistic="min" material_phase="Main"/> |
378 | +<field column="43" name="PrognosticFieldConsistent" statistic="max" material_phase="Main"/> |
379 | +<field column="44" name="PrognosticFieldConsistent" statistic="l2norm" material_phase="Main"/> |
380 | +<field column="45" name="PrognosticFieldConsistent" statistic="integral" material_phase="Main"/> |
381 | +<field column="46" name="Velocity%magnitude" statistic="min" material_phase="Main"/> |
382 | +<field column="47" name="Velocity%magnitude" statistic="max" material_phase="Main"/> |
383 | +<field column="48" name="Velocity%magnitude" statistic="l2norm" material_phase="Main"/> |
384 | +<field column="49" name="Velocity%1" statistic="min" material_phase="Main"/> |
385 | +<field column="50" name="Velocity%1" statistic="max" material_phase="Main"/> |
386 | +<field column="51" name="Velocity%1" statistic="l2norm" material_phase="Main"/> |
387 | +<field column="52" name="Velocity%1" statistic="integral" material_phase="Main"/> |
388 | +<field column="53" name="Velocity%2" statistic="min" material_phase="Main"/> |
389 | +<field column="54" name="Velocity%2" statistic="max" material_phase="Main"/> |
390 | +<field column="55" name="Velocity%2" statistic="l2norm" material_phase="Main"/> |
391 | +<field column="56" name="Velocity%2" statistic="integral" material_phase="Main"/> |
392 | +</header> |
393 | + 0.00000000000000000E+000 0.10000000000000000E+001 0.61199999999999999E+000 78 144 24 85 144 24 0.50480000000000000E+005 0.00000000000000000E+000 0.92448000000000000E+005 0.14564000000000000E+005 0.00000000000000000E+000 0.36784000000000000E+005 0.18800000000000000E+004 0.00000000000000000E+000 0.24960000000000000E+004 0.26400000000000000E+004 0.00000000000000000E+000 0.66720000000000000E+004 0.25600000000000000E+004 0.00000000000000000E+000 0.10624000000000000E+005 0.78120000000000000E+004 0.00000000000000000E+000 0.21256000000000000E+005 0.34560000000000000E+004 0.00000000000000000E+000 0.86400000000000000E+004 0.17568000000000000E+005 0.00000000000000000E+000 0.17568000000000000E+005 0.10000000000000000E+001 0.10000000000000000E+001 0.99999999999999889E+000 0.99999999999999789E+000 0.10000000000000000E-001 0.10000000000000000E-001 0.99999999999999933E-002 0.10000000000000011E-001 0.10000000000000000E+001 0.10000000000000000E+001 0.99999999999999889E+000 0.99999999999999789E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 0.00000000000000000E+000 |
394 | |
395 | === added file 'tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.xml' |
396 | --- tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.xml 1970-01-01 00:00:00 +0000 |
397 | +++ tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep.xml 2012-02-22 16:35:01 +0000 |
398 | @@ -0,0 +1,24 @@ |
399 | +<?xml version='1.0' encoding='utf-8'?> |
400 | +<testproblem> |
401 | + <name>Periodic adaptivity at first timestep</name> |
402 | + <owner userid="jrper"/> |
403 | + <tags>flml</tags> |
404 | + <problem_definition length="short" nprocs="1"> |
405 | + <command_line>../../bin/periodise periodic_adaptivity_at_first_timestep.flml; fluidity -v2 -l periodic_adaptivity_at_first_timestep_periodised.flml</command_line> |
406 | + </problem_definition> |
407 | + <variables> |
408 | + <variable name="consistent_max" language="python"> |
409 | +import fluidity_tools |
410 | +s = fluidity_tools.stat_parser("periodic_adaptivity_at_first_timestep.stat") |
411 | +consistent_max = s['Main']['PrognosticFieldConsistent']['max'][-1] |
412 | + </variable> |
413 | + </variables> |
414 | + <pass_tests> |
415 | + <test name="references" language="python">assert "There are no references left" in open("fluidity.log-0").read()</test> |
416 | + <test name="consistent_max" language="python"> |
417 | +import fluidity_tools |
418 | +fluidity_tools.compare_variable(consistent_max, 1.0, 1.0e-10) |
419 | + </test> |
420 | + </pass_tests> |
421 | + <warn_tests/> |
422 | +</testproblem> |
423 | |
424 | === added file 'tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep_periodised.flml' |
425 | --- tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep_periodised.flml 1970-01-01 00:00:00 +0000 |
426 | +++ tests/periodic_adaptivity_at_first_timestep/periodic_adaptivity_at_first_timestep_periodised.flml 2012-02-22 16:35:01 +0000 |
427 | @@ -0,0 +1,234 @@ |
428 | +<?xml version="1.0" encoding="utf-8" ?> |
429 | +<fluidity_options> |
430 | + <simulation_name> |
431 | + <string_value lines="1">periodic_adaptivity_at_first_timestep</string_value> |
432 | + </simulation_name> |
433 | + <problem_type> |
434 | + <string_value lines="1">fluids</string_value> |
435 | + </problem_type> |
436 | + <geometry> |
437 | + <dimension> |
438 | + <integer_value rank="0">2</integer_value> |
439 | + </dimension> |
440 | + <mesh name="CoordinateMesh"> |
441 | + <from_mesh> |
442 | + <mesh name="PeriodicMesh"></mesh> |
443 | + <periodic_boundary_conditions name="x"> |
444 | + <remove_periodicity></remove_periodicity> |
445 | + <coordinate_map> |
446 | + <string_value lines="20" type="python">def val(X,t):
 from math import pi
 return(X[0]-1, X[1])</string_value> |
447 | + </coordinate_map> |
448 | + <inverse_coordinate_map> |
449 | + <string_value lines="20" type="python">def val(X,t):
 from math import pi
 return(X[0]+1, X[1])</string_value> |
450 | + </inverse_coordinate_map> |
451 | + <aliased_boundary_ids> |
452 | + <integer_value rank="1" shape="1">8</integer_value> |
453 | + </aliased_boundary_ids> |
454 | + <physical_boundary_ids> |
455 | + <integer_value rank="1" shape="1">10</integer_value> |
456 | + </physical_boundary_ids> |
457 | + </periodic_boundary_conditions> |
458 | + <stat> |
459 | + <include_in_stat></include_in_stat> |
460 | + </stat> |
461 | + </from_mesh> |
462 | + </mesh> |
463 | + <mesh name="VelocityMesh"> |
464 | + <from_mesh> |
465 | + <mesh name="PeriodicMesh"></mesh> |
466 | + <stat> |
467 | + <exclude_from_stat></exclude_from_stat> |
468 | + </stat> |
469 | + </from_mesh> |
470 | + </mesh> |
471 | + <mesh name="PressureMesh"> |
472 | + <from_mesh> |
473 | + <mesh name="PeriodicMesh"></mesh> |
474 | + <stat> |
475 | + <exclude_from_stat></exclude_from_stat> |
476 | + </stat> |
477 | + </from_mesh> |
478 | + </mesh> |
479 | + <mesh name="PeriodicMesh"> |
480 | + <from_file file_name="MMS_B_periodic"> |
481 | + <format name="triangle"></format> |
482 | + <stat> |
483 | + <include_in_stat></include_in_stat> |
484 | + </stat> |
485 | + </from_file> |
486 | + </mesh> |
487 | + <quadrature> |
488 | + <degree> |
489 | + <integer_value rank="0">4</integer_value> |
490 | + </degree> |
491 | + </quadrature> |
492 | + </geometry> |
493 | + <io> |
494 | + <dump_format> |
495 | + <string_value>vtk</string_value> |
496 | + </dump_format> |
497 | + <dump_period_in_timesteps> |
498 | + <constant> |
499 | + <integer_value rank="0">1</integer_value> |
500 | + </constant> |
501 | + </dump_period_in_timesteps> |
502 | + <output_mesh name="CoordinateMesh"></output_mesh> |
503 | + <stat> |
504 | + <output_at_start></output_at_start> |
505 | + <output_before_adapts></output_before_adapts> |
506 | + <output_after_adapts></output_after_adapts> |
507 | + </stat> |
508 | + </io> |
509 | + <timestepping> |
510 | + <current_time> |
511 | + <real_value rank="0">0</real_value> |
512 | + </current_time> |
513 | + <timestep> |
514 | + <real_value rank="0">1</real_value> |
515 | + </timestep> |
516 | + <finish_time> |
517 | + <real_value rank="0">0</real_value> |
518 | + </finish_time> |
519 | + </timestepping> |
520 | + <physical_parameters></physical_parameters> |
521 | + <material_phase name="Main"> |
522 | + <vector_field name="Velocity" rank="1"> |
523 | + <prescribed> |
524 | + <mesh name="VelocityMesh"></mesh> |
525 | + <value name="WholeMesh"> |
526 | + <constant> |
527 | + <real_value rank="1" shape="2" dim1="dim">0 0</real_value> |
528 | + </constant> |
529 | + </value> |
530 | + <output></output> |
531 | + <stat> |
532 | + <include_in_stat></include_in_stat> |
533 | + </stat> |
534 | + <detectors> |
535 | + <exclude_from_detectors></exclude_from_detectors> |
536 | + </detectors> |
537 | + </prescribed> |
538 | + </vector_field> |
539 | + <scalar_field name="Unity" rank="0"> |
540 | + <prescribed> |
541 | + <mesh name="VelocityMesh"></mesh> |
542 | + <value name="WholeMesh"> |
543 | + <python> |
544 | + <string_value lines="20" type="python">def val(X, t):
 #return (X[0]**2 - X[0])/-0.25
 return 1.0</string_value> |
545 | + </python> |
546 | + </value> |
547 | + <output></output> |
548 | + <stat></stat> |
549 | + <detectors> |
550 | + <exclude_from_detectors></exclude_from_detectors> |
551 | + </detectors> |
552 | + <adaptivity_options> |
553 | + <absolute_measure> |
554 | + <scalar_field name="InterpolationErrorBound" rank="0"> |
555 | + <prescribed> |
556 | + <value name="WholeMesh"> |
557 | + <constant> |
558 | + <real_value rank="0">0.01</real_value> |
559 | + </constant> |
560 | + </value> |
561 | + <output></output> |
562 | + <stat></stat> |
563 | + <detectors> |
564 | + <exclude_from_detectors></exclude_from_detectors> |
565 | + </detectors> |
566 | + </prescribed> |
567 | + </scalar_field> |
568 | + </absolute_measure> |
569 | + </adaptivity_options> |
570 | + </prescribed> |
571 | + </scalar_field> |
572 | + <scalar_field name="PrognosticFieldConsistent" rank="0"> |
573 | + <prognostic> |
574 | + <mesh name="VelocityMesh"></mesh> |
575 | + <equation name="AdvectionDiffusion"></equation> |
576 | + <spatial_discretisation> |
577 | + <continuous_galerkin> |
578 | + <stabilisation> |
579 | + <no_stabilisation></no_stabilisation> |
580 | + </stabilisation> |
581 | + <advection_terms></advection_terms> |
582 | + <mass_terms></mass_terms> |
583 | + </continuous_galerkin> |
584 | + <conservative_advection> |
585 | + <real_value rank="0">1</real_value> |
586 | + </conservative_advection> |
587 | + </spatial_discretisation> |
588 | + <temporal_discretisation> |
589 | + <theta> |
590 | + <real_value rank="0">0.5</real_value> |
591 | + </theta> |
592 | + </temporal_discretisation> |
593 | + <solver> |
594 | + <iterative_method name="gmres"> |
595 | + <restart> |
596 | + <integer_value rank="0">30</integer_value> |
597 | + </restart> |
598 | + </iterative_method> |
599 | + <preconditioner name="sor"></preconditioner> |
600 | + <relative_error> |
601 | + <real_value rank="0">1e-08</real_value> |
602 | + </relative_error> |
603 | + <max_iterations> |
604 | + <integer_value rank="0">10000</integer_value> |
605 | + </max_iterations> |
606 | + <never_ignore_solver_failures></never_ignore_solver_failures> |
607 | + <diagnostics> |
608 | + <monitors></monitors> |
609 | + </diagnostics> |
610 | + </solver> |
611 | + <initial_condition name="WholeMesh"> |
612 | + <constant> |
613 | + <real_value rank="0">1</real_value> |
614 | + </constant> |
615 | + </initial_condition> |
616 | + <output></output> |
617 | + <stat></stat> |
618 | + <convergence> |
619 | + <include_in_convergence></include_in_convergence> |
620 | + </convergence> |
621 | + <detectors> |
622 | + <include_in_detectors></include_in_detectors> |
623 | + </detectors> |
624 | + <steady_state> |
625 | + <include_in_steady_state></include_in_steady_state> |
626 | + </steady_state> |
627 | + <consistent_interpolation></consistent_interpolation> |
628 | + </prognostic> |
629 | + </scalar_field> |
630 | + </material_phase> |
631 | + <mesh_adaptivity> |
632 | + <hr_adaptivity> |
633 | + <period> |
634 | + <real_value rank="0">2</real_value> |
635 | + </period> |
636 | + <maximum_number_of_nodes> |
637 | + <integer_value rank="0">10000</integer_value> |
638 | + </maximum_number_of_nodes> |
639 | + <disable_gradation></disable_gradation> |
640 | + <tensor_field name="MinimumEdgeLengths"> |
641 | + <anisotropic_symmetric> |
642 | + <constant> |
643 | + <real_value rank="2" shape="2 2" symmetric="true" dim2="dim" dim1="dim">0.01 0 0 0.01</real_value> |
644 | + </constant> |
645 | + </anisotropic_symmetric> |
646 | + </tensor_field> |
647 | + <tensor_field name="MaximumEdgeLengths"> |
648 | + <anisotropic_symmetric> |
649 | + <constant> |
650 | + <real_value rank="2" shape="2 2" symmetric="true" dim2="dim" dim1="dim">0.1 0 0 0.1</real_value> |
651 | + </constant> |
652 | + </anisotropic_symmetric> |
653 | + </tensor_field> |
654 | + <adapt_at_first_timestep> |
655 | + <number_of_adapts> |
656 | + <integer_value rank="0">2</integer_value> |
657 | + </number_of_adapts> |
658 | + </adapt_at_first_timestep> |
659 | + </hr_adaptivity> |
660 | + </mesh_adaptivity> |
661 | +</fluidity_options> |
662 | |
663 | === added directory 'tests/periodic_adaptivity_at_first_timestep/src' |
664 | === added file 'tests/periodic_adaptivity_at_first_timestep/src/MMS_B.geo' |
665 | --- tests/periodic_adaptivity_at_first_timestep/src/MMS_B.geo 1970-01-01 00:00:00 +0000 |
666 | +++ tests/periodic_adaptivity_at_first_timestep/src/MMS_B.geo 2012-02-22 16:35:01 +0000 |
667 | @@ -0,0 +1,12 @@ |
668 | +Point(1) = {0,0,0,0.1}; |
669 | +Extrude {1,0,0} { |
670 | + Point{1}; Layers{3}; |
671 | +} |
672 | +Extrude {0,1,0} { |
673 | + Line{1}; Layers{3}; |
674 | +} |
675 | +Physical Line(7) = {1}; |
676 | +Physical Line(8) = {4}; |
677 | +Physical Line(9) = {2}; |
678 | +Physical Line(10) = {3}; |
679 | +Physical Surface(10) = {5}; |
Hey James, thanks for committing this.
Two questions: adaptivity_ at_first_ timestep" test indeed simply a copy of the existing 'periodic_ adaptivity' test with 'adapt_ at_first_ timestep' switched on? In this case, I'd much prefer to only have a single test (i.e. only switch on adapt_at_ first_timestep in the exisitng 'periodic_ adaptivity' test), as 'periodic_ adaptivity_ at_first_ timestep' would duplicate the test coverage of 'periodic_ adaptivity' .
- what exactly do you mean by: "it may need extending for more insidious failure modes"
- is the new "periodic_
The changes in the code look correct to me.