~grm08/fluidity/hilbert-for-pyop2

« back to all changes in this revision

Viewing changes to schemas/simple_shallow_water_options.rng

  • Committer: tmb1
  • Date: 2010-10-27 12:18:35 UTC
  • Revision ID: svn-v4:5bf5533e-7014-46e3-b1bb-cce4b9d03719:trunk:2279
Adding a new schemas/ directory following discussion at the dev meeting and
moving all *.rn[c|g] files into it. I'm no schema expert so this may well
require various changes elsewhere to maintain consistency; please could those
who know what they're doing make these changes!

Patrick in particular - please update spud accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
 
3
  <include href="spud_base.rng"/>
 
4
  <include href="adaptivity_options.rng"/>
 
5
  <include href="diagnostic_algorithms.rng"/>
 
6
  <include href="input_output.rng"/>
 
7
  <include href="mesh_options.rng"/>
 
8
  <include href="physical_parameters.rng"/>
 
9
  <include href="prescribed_field_options.rng"/>
 
10
  <include href="prognostic_field_options.rng"/>
 
11
  <include href="solvers.rng"/>
 
12
  <include href="spatial_discretisation.rng"/>
 
13
  <include href="stabilisation.rng"/>
 
14
  <include href="temporal_discretisation.rng"/>
 
15
  <start>
 
16
    <element name="shallow_water_options">
 
17
      <a:documentation>The root node of the options dictionary.</a:documentation>
 
18
      <ref name="comment"/>
 
19
      <element name="model">
 
20
        <a:documentation>The model type</a:documentation>
 
21
        <element name="string_value">
 
22
          <value>simple_shallow_water</value>
 
23
        </element>
 
24
        <ref name="comment"/>
 
25
      </element>
 
26
      <element name="simulation_name">
 
27
        <a:documentation>Model output files are named according to the simulation
 
28
name, e.g. [simulation_name]_0.vtu. Non-standard
 
29
characters in the simulation name should be avoided.</a:documentation>
 
30
        <ref name="anystring"/>
 
31
      </element>
 
32
      <element name="problem_type">
 
33
        <a:documentation>Option problem_type does not change the tree.  It is just used for options checking.</a:documentation>
 
34
        <element name="string_value">
 
35
          <value>fluids</value>
 
36
        </element>
 
37
        <ref name="comment"/>
 
38
      </element>
 
39
      <ref name="geometry"/>
 
40
      <element name="io">
 
41
        <a:documentation>Input/output options</a:documentation>
 
42
        <element name="dump_format">
 
43
          <a:documentation>Format for dump files. Only vtk for now.</a:documentation>
 
44
          <element name="string_value">
 
45
            <value>vtk</value>
 
46
          </element>
 
47
        </element>
 
48
        <choice>
 
49
          <element name="dump_period">
 
50
            <a:documentation>Period between dumps in time units.
 
51
 
 
52
Specifies the period between each dump of the solution to disk.
 
53
A value of 0.0 indicates that there would be a dump at every timestep.</a:documentation>
 
54
            <choice>
 
55
              <element name="constant">
 
56
                <attribute name="replaces">
 
57
                  <value>TIMDUM</value>
 
58
                </attribute>
 
59
                <ref name="real"/>
 
60
              </element>
 
61
              <element name="python">
 
62
                <a:documentation>Python function prescribing real input. Functions should be of the form:
 
63
 
 
64
 def val(t):
 
65
    # Function code
 
66
    return # Return value
 
67
 
 
68
</a:documentation>
 
69
                <attribute name="replaces">
 
70
                  <value>TIMDUM</value>
 
71
                </attribute>
 
72
                <ref name="python_code"/>
 
73
              </element>
 
74
            </choice>
 
75
          </element>
 
76
          <element name="dump_period_in_timesteps">
 
77
            <a:documentation>Dump period, in timesteps.
 
78
 
 
79
Specifies the number of timesteps between each dump of the solution to disk.
 
80
A value of 0 indicates a dump at every timestep.</a:documentation>
 
81
            <choice>
 
82
              <element name="constant">
 
83
                <ref name="integer"/>
 
84
              </element>
 
85
              <element name="python">
 
86
                <a:documentation>Python function prescribing integer input. Functions should be of the form:
 
87
 
 
88
 def val(t):
 
89
    # Function code
 
90
    return # Return value
 
91
 
 
92
</a:documentation>
 
93
                <ref name="python_code"/>
 
94
              </element>
 
95
            </choice>
 
96
          </element>
 
97
        </choice>
 
98
        <optional>
 
99
          <!-- every CPUDUM seconds write results to disc. -->
 
100
          <element name="cpu_dump_period">
 
101
            <a:documentation>This is usually disabled.</a:documentation>
 
102
            <attribute name="replaces">
 
103
              <value>CPUDUM</value>
 
104
            </attribute>
 
105
            <ref name="real"/>
 
106
          </element>
 
107
        </optional>
 
108
        <optional>
 
109
          <element name="wall_time_dump_period">
 
110
            <a:documentation>The period between dumps in walltime seconds. This is usually disabled.</a:documentation>
 
111
            <attribute name="replaces">
 
112
              <value>WTIDUM</value>
 
113
            </attribute>
 
114
            <ref name="real"/>
 
115
          </element>
 
116
        </optional>
 
117
        <choice>
 
118
          <element name="output_mesh">
 
119
            <a:documentation>The mesh on to which all the fields will be
 
120
interpolated for VTK output.</a:documentation>
 
121
            <attribute name="name">
 
122
              <value>VelocityMesh</value>
 
123
            </attribute>
 
124
          </element>
 
125
          <element name="output_mesh">
 
126
            <a:documentation>The mesh on to which all the fields will be
 
127
interpolated for VTK output.</a:documentation>
 
128
            <attribute name="name">
 
129
              <value>PressureMesh</value>
 
130
            </attribute>
 
131
          </element>
 
132
          <element name="output_mesh">
 
133
            <a:documentation>The mesh on to which all the fields will be
 
134
interpolated for VTK output.</a:documentation>
 
135
            <attribute name="name">
 
136
              <value>CoordinateMesh</value>
 
137
            </attribute>
 
138
          </element>
 
139
          <element name="output_mesh">
 
140
            <a:documentation>The mesh on to which all the fields will be
 
141
interpolated for VTK output.</a:documentation>
 
142
            <attribute name="name">
 
143
              <data type="string"/>
 
144
            </attribute>
 
145
          </element>
 
146
        </choice>
 
147
        <optional>
 
148
          <element name="checkpointing">
 
149
            <a:documentation>Whether to enable dumping of checkpointing output.
 
150
 
 
151
See http://amcg.ese.ic.ac.uk/index.php?title=Local:Checkpointing_from_new_options</a:documentation>
 
152
            <element name="checkpoint_period_in_dumps">
 
153
              <a:documentation>Checkpointing period, in dumps. Non-negative value
 
154
required. A value of zero indicates that checkpoints
 
155
should be created at every dump. If
 
156
/io/max_dumpfile_count is exceeded then earlier
 
157
checkpoints may be overwritten.</a:documentation>
 
158
              <ref name="integer"/>
 
159
            </element>
 
160
            <optional>
 
161
              <element name="checkpoint_at_end">
 
162
                <a:documentation>Enable to force a checkpoint at simulation end.</a:documentation>
 
163
                <ref name="comment"/>
 
164
              </element>
 
165
            </optional>
 
166
            <ref name="comment"/>
 
167
          </element>
 
168
        </optional>
 
169
        <optional>
 
170
          <element name="detectors">
 
171
            <a:documentation>Specification of detectors. Note that when running in parallel the detector output is in binary format even if binary_output is not enabled.</a:documentation>
 
172
            <zeroOrMore>
 
173
              <choice>
 
174
                <element name="static_detector">
 
175
                  <a:documentation>A single static detector</a:documentation>
 
176
                  <attribute name="name">
 
177
                    <data type="string"/>
 
178
                  </attribute>
 
179
                  <choice>
 
180
                    <element name="location">
 
181
                      <ref name="real_dim_vector"/>
 
182
                    </element>
 
183
                    <element name="from_checkpoint_file">
 
184
                      <a:documentation>File containing the detectors positions in binary form</a:documentation>
 
185
                      <attribute name="file_name">
 
186
                        <data type="string"/>
 
187
                      </attribute>
 
188
                      <element name="format">
 
189
                        <a:documentation>The format of the input file containing field data.</a:documentation>
 
190
                        <element name="string_value">
 
191
                          <value>binary</value>
 
192
                        </element>
 
193
                      </element>
 
194
                    </element>
 
195
                  </choice>
 
196
                </element>
 
197
                <element name="lagrangian_detector">
 
198
                  <a:documentation>A single lagrangian detector</a:documentation>
 
199
                  <attribute name="name">
 
200
                    <data type="string"/>
 
201
                  </attribute>
 
202
                  <choice>
 
203
                    <element name="location">
 
204
                      <a:documentation>This is the initial location of a detector that moves with the fluid velocity.</a:documentation>
 
205
                      <ref name="real_dim_vector"/>
 
206
                    </element>
 
207
                    <element name="from_checkpoint_file">
 
208
                      <a:documentation>File containing the detectors positions in binary form</a:documentation>
 
209
                      <attribute name="file_name">
 
210
                        <data type="string"/>
 
211
                      </attribute>
 
212
                      <element name="format">
 
213
                        <a:documentation>The format of the input file containing field data.</a:documentation>
 
214
                        <element name="string_value">
 
215
                          <value>binary</value>
 
216
                        </element>
 
217
                      </element>
 
218
                    </element>
 
219
                  </choice>
 
220
                </element>
 
221
                <element name="detector_array">
 
222
                  <a:documentation>Detectors with their locations specified via a python function or from a file. Allows detector arrays to be added.</a:documentation>
 
223
                  <attribute name="name">
 
224
                    <data type="string"/>
 
225
                  </attribute>
 
226
                  <element name="number_of_detectors">
 
227
                    <a:documentation>The number of detectors prescribed by the python function.</a:documentation>
 
228
                    <ref name="integer"/>
 
229
                  </element>
 
230
                  <choice>
 
231
                    <element name="static">
 
232
                      <a:documentation>Create fixed detectors.</a:documentation>
 
233
                      <empty/>
 
234
                    </element>
 
235
                    <element name="lagrangian">
 
236
                      <a:documentation>Create detectors which move with the fluid velocity.</a:documentation>
 
237
                      <empty/>
 
238
                    </element>
 
239
                  </choice>
 
240
                  <choice>
 
241
                    <element name="python">
 
242
                      <a:documentation>Python function prescribing dimensional vector input. Functions should be of the form:
 
243
 
 
244
 def val(t):
 
245
    # Function code
 
246
    return # Return value
 
247
 
 
248
The return value must have length number_of_detectors.
 
249
 
 
250
*** IMPORTANT NOTE ***
 
251
 
 
252
The t argument is for future use only - currently detector locations are only set at simulation start.</a:documentation>
 
253
                      <ref name="python_code"/>
 
254
                    </element>
 
255
                    <element name="from_file">
 
256
                      <a:documentation>File containing the detectors positions in binary form</a:documentation>
 
257
                      <attribute name="file_name">
 
258
                        <data type="string"/>
 
259
                      </attribute>
 
260
                      <element name="format">
 
261
                        <a:documentation>The format of the input file containing field data.</a:documentation>
 
262
                        <element name="string_value">
 
263
                          <value>binary</value>
 
264
                        </element>
 
265
                      </element>
 
266
                    </element>
 
267
                    <element name="from_checkpoint_file">
 
268
                      <a:documentation>File containing the detectors positions in binary form</a:documentation>
 
269
                      <attribute name="file_name">
 
270
                        <data type="string"/>
 
271
                      </attribute>
 
272
                      <element name="format">
 
273
                        <a:documentation>The format of the input file containing field data.</a:documentation>
 
274
                        <element name="string_value">
 
275
                          <value>binary</value>
 
276
                        </element>
 
277
                      </element>
 
278
                    </element>
 
279
                  </choice>
 
280
                </element>
 
281
              </choice>
 
282
            </zeroOrMore>
 
283
            <optional>
 
284
              <element name="binary_output">
 
285
                <a:documentation>Enable to write detector output in binary format</a:documentation>
 
286
                <ref name="comment"/>
 
287
              </element>
 
288
            </optional>
 
289
          </element>
 
290
        </optional>
 
291
        <optional>
 
292
          <element name="log_output">
 
293
            <a:documentation>Options to create even more output in the logs:
 
294
 
 
295
Note that the main option to control the log output is given on the command line:
 
296
 
 
297
-v0  only output error and warnings
 
298
 
 
299
-v1  also give "navigational information", to indicate where in the code we currently are
 
300
 
 
301
-v2  also give any additional information (mins and maxes of fields, etc.)
 
302
</a:documentation>
 
303
            <optional>
 
304
              <element name="memory_diagnostics">
 
305
                <a:documentation>Log all allocates and deallocates done for meshes, fields, sparsities and matrices.
 
306
 
 
307
NOTE: Requires -v2</a:documentation>
 
308
                <empty/>
 
309
              </element>
 
310
            </optional>
 
311
          </element>
 
312
        </optional>
 
313
      </element>
 
314
      <element name="timestepping">
 
315
        <a:documentation>Options dealing with time discretisation</a:documentation>
 
316
        <element name="current_time">
 
317
          <a:documentation>Current simulation time. At the start of the simulation this
 
318
is the start time.</a:documentation>
 
319
          <attribute name="replaces">
 
320
            <value>ACCTIM</value>
 
321
          </attribute>
 
322
          <ref name="real"/>
 
323
        </element>
 
324
        <element name="timestep">
 
325
          <a:documentation>The time step size. If adaptive time stepping is used
 
326
then this is the initial time step size.</a:documentation>
 
327
          <attribute name="replaces">
 
328
            <value>DT</value>
 
329
          </attribute>
 
330
          <ref name="real"/>
 
331
        </element>
 
332
        <element name="finish_time">
 
333
          <a:documentation>Simulation time at which the simulation should end.</a:documentation>
 
334
          <attribute name="replaces">
 
335
            <value>LTIME</value>
 
336
          </attribute>
 
337
          <ref name="real"/>
 
338
        </element>
 
339
        <optional>
 
340
          <element name="final_timestep">
 
341
            <a:documentation>Timestep after which the simulation should end.</a:documentation>
 
342
            <ref name="integer"/>
 
343
          </element>
 
344
        </optional>
 
345
        <optional>
 
346
          <element name="cpu_time_limit">
 
347
            <a:documentation>Maximum CPU time (in seconds) before the simulation terminates</a:documentation>
 
348
            <attribute name="replaces">
 
349
              <value>CPULIM</value>
 
350
            </attribute>
 
351
            <ref name="real"/>
 
352
          </element>
 
353
        </optional>
 
354
        <optional>
 
355
          <element name="wall_time_limit">
 
356
            <a:documentation>Maximum wall time (secs) taken up before
 
357
simulation terminates writing results to disc.
 
358
 
 
359
This is usually disabled.</a:documentation>
 
360
            <attribute name="replaces">
 
361
              <value>WATIME</value>
 
362
            </attribute>
 
363
            <ref name="real"/>
 
364
          </element>
 
365
        </optional>
 
366
        <element name="nonlinear_iterations">
 
367
          <a:documentation>maximum number of non-linear iterations.
 
368
 
 
369
Manual suggests 2</a:documentation>
 
370
          <attribute name="replaces">
 
371
            <value>ITINOI</value>
 
372
          </attribute>
 
373
          <ref name="integer"/>
 
374
        </element>
 
375
      </element>
 
376
      <ref name="simple_physical_parameter_options"/>
 
377
      <element name="material_phase">
 
378
        <a:documentation>The material or phase options</a:documentation>
 
379
        <attribute name="name">
 
380
          <value>Fluid</value>
 
381
        </attribute>
 
382
        <group>
 
383
          <element name="vector_field">
 
384
            <a:documentation>Velocity vector and momentum options</a:documentation>
 
385
            <attribute name="rank">
 
386
              <value>1</value>
 
387
            </attribute>
 
388
            <attribute name="name">
 
389
              <value>Velocity</value>
 
390
            </attribute>
 
391
            <group>
 
392
              <a:documentation>Field type</a:documentation>
 
393
              <element name="prognostic">
 
394
                <ref name="velocity_mesh_choice"/>
 
395
                <ref name="simple_prognostic_velocity_field"/>
 
396
              </element>
 
397
            </group>
 
398
          </element>
 
399
          <element name="scalar_field">
 
400
            <a:documentation>Free surface elevation</a:documentation>
 
401
            <attribute name="rank">
 
402
              <value>0</value>
 
403
            </attribute>
 
404
            <attribute name="name">
 
405
              <value>LayerThickness</value>
 
406
            </attribute>
 
407
            <element name="prognostic">
 
408
              <ref name="pressure_mesh_choice"/>
 
409
              <ref name="prognostic_layerthickness_field"/>
 
410
            </element>
 
411
          </element>
 
412
          <zeroOrMore>
 
413
            <ref name="scalar_field_choice"/>
 
414
          </zeroOrMore>
 
415
          <zeroOrMore>
 
416
            <ref name="vector_field_choice"/>
 
417
          </zeroOrMore>
 
418
          <zeroOrMore>
 
419
            <ref name="tensor_field_choice"/>
 
420
          </zeroOrMore>
 
421
        </group>
 
422
      </element>
 
423
      <optional>
 
424
        <element name="mesh_adaptivity">
 
425
          <ref name="prescribed_adaptivity"/>
 
426
        </element>
 
427
      </optional>
 
428
    </element>
 
429
  </start>
 
430
  <!-- Default child of diagnostic scalar field -->
 
431
  <define name="diagnostic_scalar_field">
 
432
    <ref name="diagnostic_output_options"/>
 
433
    <ref name="diagnostic_scalar_stat_options"/>
 
434
    <ref name="diagnostic_detector_options"/>
 
435
    <optional>
 
436
      <ref name="recalculation_options"/>
 
437
    </optional>
 
438
    <optional>
 
439
      <ref name="interpolation_algorithm_scalar"/>
 
440
    </optional>
 
441
  </define>
 
442
  <!-- Default child of diagnostic scalar field without adaptivity options -->
 
443
  <define name="diagnostic_scalar_field_no_adapt">
 
444
    <ref name="diagnostic_output_options"/>
 
445
    <ref name="diagnostic_scalar_stat_options"/>
 
446
    <ref name="diagnostic_detector_options"/>
 
447
  </define>
 
448
  <!--
 
449
    Default child of diagnostic vector field
 
450
    Currently, this is empty, but in future this might include
 
451
    options that are general to all diagnostic vector fields
 
452
  -->
 
453
  <define name="diagnostic_vector_field">
 
454
    <ref name="diagnostic_output_options"/>
 
455
    <ref name="diagnostic_vector_stat_options"/>
 
456
    <ref name="diagnostic_detector_options"/>
 
457
    <optional>
 
458
      <ref name="recalculation_options"/>
 
459
    </optional>
 
460
  </define>
 
461
  <!--
 
462
    Default child of diagnostic tensor field
 
463
    Currently, this is empty, but in future this might include
 
464
    options that are general to all diagnostic tensor fields
 
465
  -->
 
466
  <define name="diagnostic_tensor_field">
 
467
    <ref name="diagnostic_output_options"/>
 
468
  </define>
 
469
  <define name="velocity_components_choice">
 
470
    <choice>
 
471
      <element name="align_bc_with_surface">
 
472
        <optional>
 
473
          <element name="normal_component">
 
474
            <ref name="input_choice_real"/>
 
475
          </element>
 
476
        </optional>
 
477
        <optional>
 
478
          <element name="tangent_component_1">
 
479
            <ref name="input_choice_real"/>
 
480
          </element>
 
481
        </optional>
 
482
        <optional>
 
483
          <element name="tangent_component_2">
 
484
            <ref name="input_choice_real"/>
 
485
          </element>
 
486
        </optional>
 
487
        <ref name="rotation_matrix_components"/>
 
488
        <optional>
 
489
          <element name="debugging_mode">
 
490
            <a:documentation>this will calculate the determinant of the
 
491
rotation matrix for every boundary node
 
492
and dump a vtu with the node 
 
493
normals and tangenials 1/2</a:documentation>
 
494
            <empty/>
 
495
          </element>
 
496
        </optional>
 
497
      </element>
 
498
      <element name="align_bc_with_cartesian">
 
499
        <optional>
 
500
          <element name="x_component">
 
501
            <ref name="input_choice_real_bc_component"/>
 
502
          </element>
 
503
        </optional>
 
504
        <optional>
 
505
          <element name="y_component">
 
506
            <ref name="input_choice_real_bc_component"/>
 
507
          </element>
 
508
        </optional>
 
509
        <optional>
 
510
          <element name="z_component">
 
511
            <ref name="input_choice_real_bc_component"/>
 
512
          </element>
 
513
        </optional>
 
514
      </element>
 
515
    </choice>
 
516
  </define>
 
517
  <!-- and again for robin b.c.s -->
 
518
  <define name="robin_velocity_components_choice">
 
519
    <!--
 
520
              element align_bc_with_surface {
 
521
                 element normal_component {
 
522
                    element order_zero_coefficient {
 
523
                       input_choice_real
 
524
                    },
 
525
                    element order_one_coefficient {
 
526
                       input_choice_real
 
527
                    }
 
528
                 }?,
 
529
                 element tangent_component_1 {
 
530
                    element order_zero_coefficient {
 
531
                       input_choice_real
 
532
                    },
 
533
                    element order_one_coefficient {
 
534
                       input_choice_real
 
535
                    }
 
536
                 }?,
 
537
                 element tangent_component_2 {
 
538
                    element order_zero_coefficient {
 
539
                       input_choice_real
 
540
                    },
 
541
                    element order_one_coefficient {
 
542
                       input_choice_real
 
543
                    }
 
544
                 }?,
 
545
                 rotation_matrix_components
 
546
              }|
 
547
    -->
 
548
    <element name="align_bc_with_cartesian">
 
549
      <optional>
 
550
        <element name="x_component">
 
551
          <element name="order_zero_coefficient">
 
552
            <ref name="input_choice_real"/>
 
553
          </element>
 
554
          <element name="order_one_coefficient">
 
555
            <ref name="input_choice_real"/>
 
556
          </element>
 
557
        </element>
 
558
      </optional>
 
559
      <optional>
 
560
        <element name="y_component">
 
561
          <element name="order_zero_coefficient">
 
562
            <ref name="input_choice_real"/>
 
563
          </element>
 
564
          <element name="order_one_coefficient">
 
565
            <ref name="input_choice_real"/>
 
566
          </element>
 
567
        </element>
 
568
      </optional>
 
569
      <optional>
 
570
        <element name="z_component">
 
571
          <element name="order_zero_coefficient">
 
572
            <ref name="input_choice_real"/>
 
573
          </element>
 
574
          <element name="order_one_coefficient">
 
575
            <ref name="input_choice_real"/>
 
576
          </element>
 
577
        </element>
 
578
      </optional>
 
579
    </element>
 
580
  </define>
 
581
  <define name="velocity_boundary_conditions">
 
582
    <element name="type">
 
583
      <a:documentation>A weak no normal flow boundary condition.</a:documentation>
 
584
      <attribute name="name">
 
585
        <value>no_normal_flow</value>
 
586
      </attribute>
 
587
      <empty/>
 
588
    </element>
 
589
  </define>
 
590
  <!-- Output options for prognostic fields -->
 
591
  <define name="prognostic_scalar_output_options">
 
592
    <element name="output">
 
593
      <a:documentation>Specify what is written to vtu dump files.</a:documentation>
 
594
      <optional>
 
595
        <element name="exclude_from_vtu">
 
596
          <a:documentation>Exclude this field from dump files.</a:documentation>
 
597
          <empty/>
 
598
        </element>
 
599
      </optional>
 
600
      <optional>
 
601
        <element name="include_previous_time_step">
 
602
          <a:documentation>Select this option to also write the values of this field
 
603
on the previous timestep.
 
604
(included under the name: Old&lt;field_name&gt; )</a:documentation>
 
605
          <empty/>
 
606
        </element>
 
607
      </optional>
 
608
    </element>
 
609
  </define>
 
610
  <!-- Output options for prognostic fields -->
 
611
  <define name="prognostic_vector_output_options">
 
612
    <element name="output">
 
613
      <a:documentation>Specify what is written to dump files.</a:documentation>
 
614
      <optional>
 
615
        <element name="exclude_from_vtu">
 
616
          <a:documentation>Exclude this field from dump files.</a:documentation>
 
617
          <empty/>
 
618
        </element>
 
619
      </optional>
 
620
      <optional>
 
621
        <element name="include_previous_time_step">
 
622
          <a:documentation>Select this option to also write the values of this field
 
623
on the previous timestep.
 
624
(included under the name: Old&lt;field_name&gt; )</a:documentation>
 
625
          <empty/>
 
626
        </element>
 
627
      </optional>
 
628
    </element>
 
629
  </define>
 
630
  <!-- Field output options for all other fields -->
 
631
  <define name="field_output_options">
 
632
    <element name="output">
 
633
      <a:documentation>Specify what is written to dump files.</a:documentation>
 
634
      <optional>
 
635
        <element name="exclude_from_vtu">
 
636
          <a:documentation>Exclude this field from dump files.</a:documentation>
 
637
          <ref name="comment"/>
 
638
        </element>
 
639
      </optional>
 
640
    </element>
 
641
  </define>
 
642
  <define name="field_output_options_disabled">
 
643
    <element name="output">
 
644
      <a:documentation>Specify what is written to vtu dump files.</a:documentation>
 
645
      <choice>
 
646
        <element name="exclude_from_vtu">
 
647
          <a:documentation>Exclude this field from dump files.</a:documentation>
 
648
          <ref name="comment"/>
 
649
        </element>
 
650
        <element name="include_in_vtu">
 
651
          <a:documentation>Include this field in dump files.</a:documentation>
 
652
          <ref name="comment"/>
 
653
        </element>
 
654
      </choice>
 
655
    </element>
 
656
  </define>
 
657
  <define name="diagnostic_output_options">
 
658
    <ref name="field_output_options"/>
 
659
  </define>
 
660
  <define name="prescribed_output_options">
 
661
    <ref name="field_output_options"/>
 
662
  </define>
 
663
  <!--
 
664
    Options for inclusion/exclusion of standard field statistics from the .stat
 
665
    file
 
666
  -->
 
667
  <define name="include_stat">
 
668
    <element name="include_in_stat">
 
669
      <a:documentation>Include this field in the .stat file (magnitude and components)</a:documentation>
 
670
      <ref name="comment"/>
 
671
    </element>
 
672
  </define>
 
673
  <define name="exclude_components_from_stat">
 
674
    <element name="exclude_components_from_stat">
 
675
      <a:documentation>Include just the magnitude of this field in the .stat file
 
676
(excluding the components)</a:documentation>
 
677
      <ref name="comment"/>
 
678
    </element>
 
679
  </define>
 
680
  <define name="exclude_stat">
 
681
    <element name="exclude_from_stat">
 
682
      <a:documentation>Exclude this field from the .stat file.</a:documentation>
 
683
      <ref name="comment"/>
 
684
    </element>
 
685
  </define>
 
686
  <!-- Diagnostic statistics options for prognostic scalar fields -->
 
687
  <define name="prognostic_scalar_stat_options">
 
688
    <element name="stat">
 
689
      <a:documentation>Specify what is added to .stat files</a:documentation>
 
690
      <ref name="prognostic_scalar_stat_options.stat"/>
 
691
    </element>
 
692
  </define>
 
693
  <!-- Diagnostic statistics for all other scalar fields -->
 
694
  <define name="prognostic_scalar_stat_options">
 
695
    <element name="stat">
 
696
      <a:documentation>Specify what is added to .stat files</a:documentation>
 
697
      <optional>
 
698
        <ref name="exclude_stat"/>
 
699
      </optional>
 
700
      <optional>
 
701
        <ref name="cv_stats"/>
 
702
      </optional>
 
703
      <zeroOrMore>
 
704
        <ref name="surface_integral_stats_scalar"/>
 
705
      </zeroOrMore>
 
706
      <zeroOrMore>
 
707
        <ref name="mixing_stats"/>
 
708
      </zeroOrMore>
 
709
    </element>
 
710
  </define>
 
711
  <define name="diagnostic_scalar_stat_options">
 
712
    <ref name="prognostic_scalar_stat_options"/>
 
713
  </define>
 
714
  <define name="prescribed_scalar_stat_options">
 
715
    <ref name="prognostic_scalar_stat_options"/>
 
716
  </define>
 
717
  <!-- Diagnostic statistics options for vector fields, with enabled by default -->
 
718
  <define name="vector_field_stat_options_enabled_default">
 
719
    <ref name="include_stat"/>
 
720
  </define>
 
721
  <define name="vector_field_stat_options_enabled_default" combine="choice">
 
722
    <ref name="exclude_components_from_stat"/>
 
723
  </define>
 
724
  <define name="vector_field_stat_options_enabled_default" combine="choice">
 
725
    <ref name="exclude_stat"/>
 
726
  </define>
 
727
  <!-- Diagnostic statistics options for vector fields, with enabled by default -->
 
728
  <define name="vector_field_stat_options_disabled_default">
 
729
    <ref name="exclude_stat"/>
 
730
  </define>
 
731
  <define name="vector_field_stat_options_disabled_default" combine="choice">
 
732
    <ref name="exclude_components_from_stat"/>
 
733
  </define>
 
734
  <define name="vector_field_stat_options_disabled_default" combine="choice">
 
735
    <ref name="include_stat"/>
 
736
  </define>
 
737
  <!-- Diagnostic statistics for prognostic vector fields -->
 
738
  <define name="prognostic_velocity_stat_options">
 
739
    <element name="stat">
 
740
      <a:documentation>Specify what is added to .stat files</a:documentation>
 
741
      <ref name="prognostic_velocity_stat_options.stat"/>
 
742
    </element>
 
743
  </define>
 
744
  <!-- Diagnostic statistics for all other vector fields -->
 
745
  <define name="prognostic_vector_stat_options">
 
746
    <element name="stat">
 
747
      <a:documentation>Specify what is added to .stat files</a:documentation>
 
748
      <ref name="vector_field_stat_options_enabled_default"/>
 
749
      <zeroOrMore>
 
750
        <ref name="surface_integral_stats_vector"/>
 
751
      </zeroOrMore>
 
752
    </element>
 
753
  </define>
 
754
  <define name="diagnostic_vector_stat_options">
 
755
    <ref name="prognostic_vector_stat_options"/>
 
756
  </define>
 
757
  <define name="prescribed_vector_stat_options">
 
758
    <ref name="prognostic_vector_stat_options"/>
 
759
  </define>
 
760
  <!-- Combining of stat elements for vector fields -->
 
761
  <define name="prognostic_velocity_stat_options.stat">
 
762
    <ref name="vector_field_stat_options_enabled_default"/>
 
763
    <zeroOrMore>
 
764
      <ref name="surface_integral_stats_vector"/>
 
765
    </zeroOrMore>
 
766
    <optional>
 
767
      <element name="compute_body_forces_on_surfaces">
 
768
        <a:documentation>What surface IDs do you want to do the calculation over?</a:documentation>
 
769
        <optional>
 
770
          <element name="output_terms">
 
771
            <a:documentation>Enable to output the pressure and viscous terms separately (as well
 
772
as the total force)</a:documentation>
 
773
            <ref name="comment"/>
 
774
          </element>
 
775
        </optional>
 
776
        <ref name="integer_vector"/>
 
777
      </element>
 
778
    </optional>
 
779
    <optional>
 
780
      <element name="divergence_stats">
 
781
        <a:documentation>Compute the divergence of this field at the Gauss points
 
782
and return its stats.  This is a direct measure of the
 
783
divergence at the gauss points rather than a discrete measure
 
784
at the nodes (provided by several other diagnostic fields).</a:documentation>
 
785
        <empty/>
 
786
      </element>
 
787
    </optional>
 
788
    <optional>
 
789
      <element name="calculate_momentum_conservation_error">
 
790
        <a:documentation>Calculate the error in the conservation of momentum
 
791
IN PROGRESS - Does not include all terms!</a:documentation>
 
792
        <empty/>
 
793
      </element>
 
794
    </optional>
 
795
  </define>
 
796
  <!-- Convergence options for prognostic scalar fields -->
 
797
  <define name="scalar_convergence_options">
 
798
    <empty/>
 
799
  </define>
 
800
  <!-- Convergence statistics options for prognostic vector fields (velocity) -->
 
801
  <define name="vector_convergence_options">
 
802
    <empty/>
 
803
  </define>
 
804
  <!-- Steady state options for prognostic scalar fields -->
 
805
  <define name="scalar_steady_state_options">
 
806
    <empty/>
 
807
  </define>
 
808
  <!-- Steady state statistics options for prognostic vector fields (velocity) -->
 
809
  <define name="vector_steady_state_options">
 
810
    <empty/>
 
811
  </define>
 
812
  <!-- Options for whether a field is to be included in detector output. -->
 
813
  <define name="detector_options_enabled_default">
 
814
    <element name="detectors">
 
815
      <a:documentation>Specify what is added to detector files</a:documentation>
 
816
      <choice>
 
817
        <element name="include_in_detectors">
 
818
          <a:documentation>This field is output at each detector location.</a:documentation>
 
819
          <ref name="comment"/>
 
820
        </element>
 
821
        <element name="exclude_from_detectors">
 
822
          <a:documentation>This field is not output at detector locations.</a:documentation>
 
823
          <ref name="comment"/>
 
824
        </element>
 
825
      </choice>
 
826
    </element>
 
827
  </define>
 
828
  <!-- Options for whether a field is to be included in detector output. -->
 
829
  <define name="detector_options_disabled_default">
 
830
    <element name="detectors">
 
831
      <a:documentation>Specify what is added to detector files</a:documentation>
 
832
      <choice>
 
833
        <element name="exclude_from_detectors">
 
834
          <a:documentation>This field is not output at detector locations.</a:documentation>
 
835
          <ref name="comment"/>
 
836
        </element>
 
837
        <element name="include_in_detectors">
 
838
          <a:documentation>This field is output at each detector location.</a:documentation>
 
839
          <ref name="comment"/>
 
840
        </element>
 
841
      </choice>
 
842
    </element>
 
843
  </define>
 
844
  <!--
 
845
    Detector output defaults on for prognostic and diagnostic fields, 
 
846
    off for prescribed.
 
847
  -->
 
848
  <define name="prognostic_detector_options">
 
849
    <ref name="detector_options_enabled_default"/>
 
850
  </define>
 
851
  <define name="diagnostic_detector_options">
 
852
    <ref name="detector_options_enabled_default"/>
 
853
  </define>
 
854
  <define name="prescribed_detector_options">
 
855
    <ref name="detector_options_disabled_default"/>
 
856
  </define>
 
857
  <!-- Most common mesh choices -->
 
858
  <define name="mesh_choice">
 
859
    <choice>
 
860
      <element name="mesh">
 
861
        <attribute name="name">
 
862
          <data type="string"/>
 
863
        </attribute>
 
864
      </element>
 
865
      <element name="mesh">
 
866
        <attribute name="name">
 
867
          <value>CoordinateMesh</value>
 
868
        </attribute>
 
869
      </element>
 
870
      <element name="mesh">
 
871
        <attribute name="name">
 
872
          <value>VelocityMesh</value>
 
873
        </attribute>
 
874
      </element>
 
875
      <element name="mesh">
 
876
        <attribute name="name">
 
877
          <value>PressureMesh</value>
 
878
        </attribute>
 
879
      </element>
 
880
    </choice>
 
881
  </define>
 
882
  <!-- Same choices, but with VelocityMesh offered first -->
 
883
  <define name="velocity_mesh_choice">
 
884
    <choice>
 
885
      <element name="mesh">
 
886
        <attribute name="name">
 
887
          <value>VelocityMesh</value>
 
888
        </attribute>
 
889
      </element>
 
890
      <element name="mesh">
 
891
        <attribute name="name">
 
892
          <value>PressureMesh</value>
 
893
        </attribute>
 
894
      </element>
 
895
      <element name="mesh">
 
896
        <attribute name="name">
 
897
          <value>CoordinateMesh</value>
 
898
        </attribute>
 
899
      </element>
 
900
      <element name="mesh">
 
901
        <attribute name="name">
 
902
          <data type="string" datatypeLibrary=""/>
 
903
        </attribute>
 
904
      </element>
 
905
    </choice>
 
906
  </define>
 
907
  <!-- Same choices, but with PressureMesh offered first -->
 
908
  <define name="pressure_mesh_choice">
 
909
    <choice>
 
910
      <element name="mesh">
 
911
        <attribute name="name">
 
912
          <value>PressureMesh</value>
 
913
        </attribute>
 
914
      </element>
 
915
      <element name="mesh">
 
916
        <attribute name="name">
 
917
          <value>VelocityMesh</value>
 
918
        </attribute>
 
919
      </element>
 
920
      <element name="mesh">
 
921
        <attribute name="name">
 
922
          <value>CoordinateMesh</value>
 
923
        </attribute>
 
924
      </element>
 
925
      <element name="mesh">
 
926
        <attribute name="name">
 
927
          <data type="string" datatypeLibrary=""/>
 
928
        </attribute>
 
929
      </element>
 
930
    </choice>
 
931
  </define>
 
932
  <!-- Same choices, but with CoordinateMesh offered first -->
 
933
  <define name="coordinate_mesh_choice">
 
934
    <choice>
 
935
      <element name="mesh">
 
936
        <attribute name="name">
 
937
          <value>CoordinateMesh</value>
 
938
        </attribute>
 
939
      </element>
 
940
      <element name="mesh">
 
941
        <attribute name="name">
 
942
          <value>VelocityMesh</value>
 
943
        </attribute>
 
944
      </element>
 
945
      <element name="mesh">
 
946
        <attribute name="name">
 
947
          <value>PressureMesh</value>
 
948
        </attribute>
 
949
      </element>
 
950
      <element name="mesh">
 
951
        <attribute name="name">
 
952
          <data type="string" datatypeLibrary=""/>
 
953
        </attribute>
 
954
      </element>
 
955
    </choice>
 
956
  </define>
 
957
  <!-- This is the choice of additional scalar field to be solved for -->
 
958
  <define name="scalar_field_choice">
 
959
    <!--
 
960
      The first is a generic field, which may be used for any user-defined field
 
961
      that FLUIDITY knows nothing about, or a generic diagnostic
 
962
    -->
 
963
    <choice>
 
964
      <element name="scalar_field">
 
965
        <attribute name="rank">
 
966
          <value>0</value>
 
967
        </attribute>
 
968
        <attribute name="name">
 
969
          <data type="string"/>
 
970
        </attribute>
 
971
        <choice>
 
972
          <a:documentation>Field type</a:documentation>
 
973
          <element name="prognostic">
 
974
            <ref name="velocity_mesh_choice"/>
 
975
            <ref name="prognostic_scalar_field"/>
 
976
          </element>
 
977
          <element name="prescribed">
 
978
            <ref name="velocity_mesh_choice"/>
 
979
            <ref name="prescribed_scalar_field"/>
 
980
          </element>
 
981
          <element name="diagnostic">
 
982
            <ref name="scalar_diagnostic_algorithms"/>
 
983
            <ref name="velocity_mesh_choice"/>
 
984
            <ref name="diagnostic_scalar_field"/>
 
985
          </element>
 
986
        </choice>
 
987
      </element>
 
988
      <element name="___Prognostic_Fields_Below___">
 
989
        <a:documentation>Prognostic scalar fields below this</a:documentation>
 
990
        <empty/>
 
991
      </element>
 
992
      <!--
 
993
        This is the long list of fields that FLUIDITY knows about
 
994
        - - First is a list of fields that are primarily prognostic,
 
995
           but can be set to prescribed..
 
996
        - - The list is in order of most frequently used.
 
997
      -->
 
998
      <element name="scalar_field">
 
999
        <a:documentation>Calculate the stream function of 2D incompressible flow. Note 
 
1000
that this *only* makes sense for proper 2D (not pseudo-2D) simulations.
 
1001
Requires a continuous mesh.</a:documentation>
 
1002
        <attribute name="rank">
 
1003
          <value>0</value>
 
1004
        </attribute>
 
1005
        <attribute name="name">
 
1006
          <value>StreamFunction</value>
 
1007
        </attribute>
 
1008
        <element name="prognostic">
 
1009
          <ref name="mesh_choice"/>
 
1010
          <ref name="prognostic_stream_function_field"/>
 
1011
        </element>
 
1012
      </element>
 
1013
      <!--
 
1014
        Insert new prognostic scalar fields here using the template:
 
1015
               element scalar_field {
 
1016
                   attribute rank { "0" },
 
1017
                   attribute name { "NewFieldName" },
 
1018
                   (
 
1019
                      element prognostic {
 
1020
                         velocity_mesh_choice,
 
1021
                         prognostic_scalar_field
 
1022
                      }|
 
1023
                      element prescribed {
 
1024
                         velocity_mesh_choice,
 
1025
                         prescribed_scalar_field
 
1026
                      }
 
1027
                   )
 
1028
               }
 
1029
      -->
 
1030
      <!--
 
1031
        - - Second is a list of fields that are primarily prescribed.
 
1032
        - - The list is in order of most frequently used.
 
1033
      -->
 
1034
      <element name="___Prescribed_fields_below___">
 
1035
        <a:documentation>Prescribed scalar fields below this</a:documentation>
 
1036
        <empty/>
 
1037
      </element>
 
1038
      <!--
 
1039
        
 
1040
        Insert new prescribed scalar fields here using the template:
 
1041
               element scalar_field {
 
1042
                   attribute rank { "0" },
 
1043
                   attribute name { "NewFieldName" },
 
1044
                   (
 
1045
                      element prescribed {
 
1046
                         velocity_mesh_choice,
 
1047
                         prescribed_scalar_field
 
1048
                      }
 
1049
                   )
 
1050
               }
 
1051
        
 
1052
        - - Last is a list of fields that are primarily diagnostic.
 
1053
        - - The list is in order of most frequently used.
 
1054
        
 
1055
      -->
 
1056
      <element name="___Diagnostic_Fields_Below___">
 
1057
        <a:documentation>Diagnostic scalar fields below this</a:documentation>
 
1058
        <empty/>
 
1059
      </element>
 
1060
      <element name="scalar_field">
 
1061
        <a:documentation>ControlVolumeDivergence:
 
1062
 
 
1063
div field
 
1064
 
 
1065
Divergence of the velocity field where
 
1066
the divergence operator is defined using
 
1067
the control volume C^T matrix.
 
1068
This assumes that the test space is discontinuous
 
1069
control volumes.</a:documentation>
 
1070
        <attribute name="rank">
 
1071
          <value>0</value>
 
1072
        </attribute>
 
1073
        <attribute name="name">
 
1074
          <value>ControlVolumeDivergence</value>
 
1075
        </attribute>
 
1076
        <element name="diagnostic">
 
1077
          <ref name="internal_algorithm"/>
 
1078
          <attribute name="field_name">
 
1079
            <data type="string" datatypeLibrary=""/>
 
1080
          </attribute>
 
1081
          <ref name="velocity_mesh_choice"/>
 
1082
          <ref name="diagnostic_cv_divergence_scalar_field"/>
 
1083
        </element>
 
1084
      </element>
 
1085
      <element name="scalar_field">
 
1086
        <a:documentation>CFLNumber
 
1087
 
 
1088
See http://amcg.ese.ic.ac.uk/index.php?title=Local:Diagnostics#CFL_Number
 
1089
 
 
1090
Adapting to this field is not recommended</a:documentation>
 
1091
        <attribute name="rank">
 
1092
          <value>0</value>
 
1093
        </attribute>
 
1094
        <attribute name="name">
 
1095
          <value>CFLNumber</value>
 
1096
        </attribute>
 
1097
        <attribute name="replaces">
 
1098
          <value>IDENT = -601</value>
 
1099
        </attribute>
 
1100
        <element name="diagnostic">
 
1101
          <ref name="internal_algorithm"/>
 
1102
          <ref name="velocity_mesh_choice"/>
 
1103
          <ref name="diagnostic_scalar_field"/>
 
1104
        </element>
 
1105
      </element>
 
1106
      <element name="scalar_field">
 
1107
        <a:documentation>ControlVolumeCFLNumber
 
1108
 
 
1109
Courant Number as defined on a control volume mesh
 
1110
 
 
1111
Adapting to this field is not recommended</a:documentation>
 
1112
        <attribute name="rank">
 
1113
          <value>0</value>
 
1114
        </attribute>
 
1115
        <attribute name="name">
 
1116
          <value>ControlVolumeCFLNumber</value>
 
1117
        </attribute>
 
1118
        <element name="diagnostic">
 
1119
          <ref name="internal_algorithm"/>
 
1120
          <ref name="velocity_mesh_choice"/>
 
1121
          <ref name="diagnostic_scalar_field"/>
 
1122
        </element>
 
1123
      </element>
 
1124
      <element name="scalar_field">
 
1125
        <a:documentation>DG_CourantNumber
 
1126
 
 
1127
Courant Number as defined on a DG mesh
 
1128
 
 
1129
Adapting to this field is not recommended</a:documentation>
 
1130
        <attribute name="rank">
 
1131
          <value>0</value>
 
1132
        </attribute>
 
1133
        <attribute name="name">
 
1134
          <value>DG_CourantNumber</value>
 
1135
        </attribute>
 
1136
        <element name="diagnostic">
 
1137
          <ref name="internal_algorithm"/>
 
1138
          <ref name="velocity_mesh_choice"/>
 
1139
          <ref name="diagnostic_scalar_field"/>
 
1140
        </element>
 
1141
      </element>
 
1142
      <element name="scalar_field">
 
1143
        <a:documentation>Velocity divergence:
 
1144
 
 
1145
div velocity
 
1146
</a:documentation>
 
1147
        <attribute name="rank">
 
1148
          <value>0</value>
 
1149
        </attribute>
 
1150
        <attribute name="name">
 
1151
          <value>VelocityDivergence</value>
 
1152
        </attribute>
 
1153
        <element name="diagnostic">
 
1154
          <ref name="internal_algorithm"/>
 
1155
          <ref name="velocity_mesh_choice"/>
 
1156
          <ref name="diagnostic_scalar_field"/>
 
1157
        </element>
 
1158
      </element>
 
1159
      <element name="scalar_field">
 
1160
        <a:documentation>Vorticity for a 2D field:
 
1161
 
 
1162
 du   dv
 
1163
 -- - --
 
1164
 dy   dx</a:documentation>
 
1165
        <attribute name="rank">
 
1166
          <value>0</value>
 
1167
        </attribute>
 
1168
        <attribute name="name">
 
1169
          <value>Vorticity2D</value>
 
1170
        </attribute>
 
1171
        <element name="diagnostic">
 
1172
          <ref name="internal_algorithm"/>
 
1173
          <ref name="mesh_choice"/>
 
1174
          <ref name="diagnostic_scalar_field"/>
 
1175
        </element>
 
1176
      </element>
 
1177
      <element name="scalar_field">
 
1178
        <a:documentation>Kinetic energy density:
 
1179
 
 
1180
 1/2 rho_0*|u|^2
 
1181
 
 
1182
where rho_0 is the (reference) density 
 
1183
 
 
1184
Limitations:
 
1185
 - The Density, PerturbationDensity, KineticEnergyDensity and Velocity fields must be on the same mesh.</a:documentation>
 
1186
        <attribute name="rank">
 
1187
          <value>0</value>
 
1188
        </attribute>
 
1189
        <attribute name="name">
 
1190
          <value>KineticEnergyDensity</value>
 
1191
        </attribute>
 
1192
        <element name="diagnostic">
 
1193
          <ref name="internal_algorithm"/>
 
1194
          <ref name="velocity_mesh_choice"/>
 
1195
          <ref name="diagnostic_scalar_field"/>
 
1196
        </element>
 
1197
      </element>
 
1198
      <element name="scalar_field">
 
1199
        <a:documentation>Local average mesh edge lengths</a:documentation>
 
1200
        <attribute name="rank">
 
1201
          <value>0</value>
 
1202
        </attribute>
 
1203
        <attribute name="name">
 
1204
          <value>MeshEdgeLengths</value>
 
1205
        </attribute>
 
1206
        <element name="diagnostic">
 
1207
          <ref name="internal_algorithm"/>
 
1208
          <element name="mesh">
 
1209
            <attribute name="name">
 
1210
              <value>CoordinateMesh</value>
 
1211
            </attribute>
 
1212
          </element>
 
1213
          <ref name="diagnostic_scalar_field"/>
 
1214
        </element>
 
1215
      </element>
 
1216
      <element name="scalar_field">
 
1217
        <a:documentation>Speed:
 
1218
 
 
1219
 |u|
 
1220
 
 
1221
Limitations:
 
1222
 - The Speed and Velocity fields must be on the same mesh.</a:documentation>
 
1223
        <attribute name="rank">
 
1224
          <value>0</value>
 
1225
        </attribute>
 
1226
        <attribute name="name">
 
1227
          <value>Speed</value>
 
1228
        </attribute>
 
1229
        <element name="diagnostic">
 
1230
          <ref name="internal_algorithm"/>
 
1231
          <ref name="velocity_mesh_choice"/>
 
1232
          <ref name="diagnostic_scalar_field"/>
 
1233
        </element>
 
1234
      </element>
 
1235
      <element name="scalar_field">
 
1236
        <a:documentation>Absolute Difference between two scalar fields.
 
1237
 
 
1238
Both fields must be in this material_phase.
 
1239
Assumes both fields are on the same mesh as the AbsoluteDifference field.</a:documentation>
 
1240
        <attribute name="rank">
 
1241
          <value>0</value>
 
1242
        </attribute>
 
1243
        <attribute name="name">
 
1244
          <value>AbsoluteDifference</value>
 
1245
        </attribute>
 
1246
        <element name="diagnostic">
 
1247
          <ref name="internal_algorithm"/>
 
1248
          <attribute name="field_name_a">
 
1249
            <data type="string" datatypeLibrary=""/>
 
1250
          </attribute>
 
1251
          <attribute name="field_name_b">
 
1252
            <data type="string" datatypeLibrary=""/>
 
1253
          </attribute>
 
1254
          <ref name="mesh_choice"/>
 
1255
          <ref name="diagnostic_scalar_field"/>
 
1256
          <optional>
 
1257
            <element name="relative_to_average">
 
1258
              <a:documentation>Evaluate the absolute difference once the average difference has been removed?</a:documentation>
 
1259
              <empty/>
 
1260
            </element>
 
1261
          </optional>
 
1262
          <optional>
 
1263
            <element name="ignore_boundaries">
 
1264
              <a:documentation>Ignore boundary nodes (i.e. zero them when calculating the difference)</a:documentation>
 
1265
              <empty/>
 
1266
            </element>
 
1267
          </optional>
 
1268
        </element>
 
1269
      </element>
 
1270
      <element name="scalar_field">
 
1271
        <a:documentation>Absolute Difference between two scalar fields.
 
1272
 
 
1273
Both fields must be in this material_phase.
 
1274
Assumes both fields are on the same mesh as the AbsoluteDifference field.</a:documentation>
 
1275
        <attribute name="rank">
 
1276
          <value>0</value>
 
1277
        </attribute>
 
1278
        <attribute name="name">
 
1279
          <value>ScalarAbsoluteDifference</value>
 
1280
        </attribute>
 
1281
        <element name="diagnostic">
 
1282
          <ref name="internal_algorithm"/>
 
1283
          <attribute name="field_name_a">
 
1284
            <data type="string" datatypeLibrary=""/>
 
1285
          </attribute>
 
1286
          <attribute name="field_name_b">
 
1287
            <data type="string" datatypeLibrary=""/>
 
1288
          </attribute>
 
1289
          <ref name="mesh_choice"/>
 
1290
          <ref name="diagnostic_scalar_field"/>
 
1291
          <optional>
 
1292
            <element name="relative_to_average">
 
1293
              <a:documentation>Evaluate the absolute difference once the average difference has been removed?</a:documentation>
 
1294
              <empty/>
 
1295
            </element>
 
1296
          </optional>
 
1297
          <optional>
 
1298
            <element name="ignore_boundaries">
 
1299
              <a:documentation>Ignore boundary nodes (i.e. zero them when calculating the difference)</a:documentation>
 
1300
              <empty/>
 
1301
            </element>
 
1302
          </optional>
 
1303
        </element>
 
1304
      </element>
 
1305
    </choice>
 
1306
    <!--
 
1307
      Insert new diagnostic scalar fields here using the template:
 
1308
             element scalar_field {
 
1309
                 attribute rank { "0" },
 
1310
                 attribute name { "NewFieldName" },
 
1311
                 (
 
1312
                    element diagnostic {
 
1313
                       internal_algorithm,
 
1314
                       velocity_mesh_choice,
 
1315
                       diagnostic_scalar_field
 
1316
                    }
 
1317
                 )
 
1318
             }
 
1319
    -->
 
1320
  </define>
 
1321
  <!-- This is the choice of additional vector field to be solved for -->
 
1322
  <define name="vector_field_choice">
 
1323
    <!--
 
1324
      The first is a generic field, which may be used for any user-defined field
 
1325
      that FLUIDITY knows nothing about, or a generic diagnostic
 
1326
      Prognostic vector fields are not possible (other than velocity and those known fields below).
 
1327
    -->
 
1328
    <choice>
 
1329
      <element name="vector_field">
 
1330
        <a:documentation>Generic field variable (vector)</a:documentation>
 
1331
        <attribute name="rank">
 
1332
          <value>1</value>
 
1333
        </attribute>
 
1334
        <attribute name="name">
 
1335
          <data type="string"/>
 
1336
        </attribute>
 
1337
        <choice>
 
1338
          <a:documentation>Field type</a:documentation>
 
1339
          <element name="prescribed">
 
1340
            <ref name="mesh_choice"/>
 
1341
            <ref name="prescribed_vector_field"/>
 
1342
          </element>
 
1343
          <element name="diagnostic">
 
1344
            <ref name="vector_diagnostic_algorithms"/>
 
1345
            <ref name="velocity_mesh_choice"/>
 
1346
            <ref name="diagnostic_vector_field"/>
 
1347
          </element>
 
1348
        </choice>
 
1349
      </element>
 
1350
      <!--
 
1351
        
 
1352
        - - List of fields that are primarily prognostic.
 
1353
        - - The list is in order of most frequently used.
 
1354
        
 
1355
      -->
 
1356
      <element name="___Prognostic_fields_below___">
 
1357
        <a:documentation>Prescribed vector fields below this</a:documentation>
 
1358
        <empty/>
 
1359
      </element>
 
1360
      <!--
 
1361
        
 
1362
        - - List of fields that are primarily prescribed.
 
1363
        - - The list is in order of most frequently used.
 
1364
        
 
1365
      -->
 
1366
      <element name="___Prescribed_fields_below___">
 
1367
        <a:documentation>Prescribed vector fields below this</a:documentation>
 
1368
        <empty/>
 
1369
      </element>
 
1370
      <!--
 
1371
        
 
1372
        Insert new prescribed vector fields here using the template:
 
1373
               element vector_field {
 
1374
                   attribute rank { "1" },
 
1375
                   attribute name { "NewFieldName" },
 
1376
                   (
 
1377
                      element prescribed {
 
1378
                         mesh_choice,
 
1379
                         prescribed_vector_field
 
1380
                      }
 
1381
                   )
 
1382
               }
 
1383
        
 
1384
        - - Last is a list of fields that are primarily diagnostic.
 
1385
        - - The list is in order of most frequently used.
 
1386
        
 
1387
      -->
 
1388
      <element name="___Diagnostic_Fields_Below___">
 
1389
        <a:documentation>Diagnostic vector fields below this</a:documentation>
 
1390
        <empty/>
 
1391
      </element>
 
1392
      <element name="vector_field">
 
1393
        <a:documentation>Gradient of a scalar field evaluated using the C gradient
 
1394
matrix constructed using finite elements.
 
1395
Field must be in this material_phase.</a:documentation>
 
1396
        <attribute name="rank">
 
1397
          <value>1</value>
 
1398
        </attribute>
 
1399
        <attribute name="name">
 
1400
          <value>FiniteElementGradient</value>
 
1401
        </attribute>
 
1402
        <element name="diagnostic">
 
1403
          <ref name="internal_algorithm"/>
 
1404
          <attribute name="field_name">
 
1405
            <data type="string" datatypeLibrary=""/>
 
1406
          </attribute>
 
1407
          <ref name="mesh_choice"/>
 
1408
          <optional>
 
1409
            <element name="integrate_gradient_by_parts">
 
1410
              <empty/>
 
1411
            </element>
 
1412
          </optional>
 
1413
          <ref name="diagnostic_gradient_vector_field"/>
 
1414
        </element>
 
1415
      </element>
 
1416
      <element name="vector_field">
 
1417
        <a:documentation>Relative vorticity field - curl of the velocity field</a:documentation>
 
1418
        <attribute name="rank">
 
1419
          <value>1</value>
 
1420
        </attribute>
 
1421
        <attribute name="name">
 
1422
          <value>Vorticity</value>
 
1423
        </attribute>
 
1424
        <element name="diagnostic">
 
1425
          <ref name="vorticity_algorithm"/>
 
1426
          <ref name="velocity_mesh_choice"/>
 
1427
          <ref name="diagnostic_vector_field"/>
 
1428
        </element>
 
1429
      </element>
 
1430
      <element name="vector_field">
 
1431
        <a:documentation>Planetary vorticity
 
1432
 
 
1433
Limitations:
 
1434
 - Requires geometry dimension of 3.</a:documentation>
 
1435
        <attribute name="rank">
 
1436
          <value>1</value>
 
1437
        </attribute>
 
1438
        <attribute name="name">
 
1439
          <value>PlanetaryVorticity</value>
 
1440
        </attribute>
 
1441
        <element name="diagnostic">
 
1442
          <ref name="internal_algorithm"/>
 
1443
          <ref name="velocity_mesh_choice"/>
 
1444
          <ref name="diagnostic_vector_field"/>
 
1445
        </element>
 
1446
      </element>
 
1447
      <element name="vector_field">
 
1448
        <a:documentation>Absolute vorticity:
 
1449
 
 
1450
  f + curl u
 
1451
 
 
1452
Limitations:
 
1453
 - Requires a geometry dimension of 3.</a:documentation>
 
1454
        <attribute name="rank">
 
1455
          <value>1</value>
 
1456
        </attribute>
 
1457
        <attribute name="name">
 
1458
          <value>AbsoluteVorticity</value>
 
1459
        </attribute>
 
1460
        <attribute name="depends">
 
1461
          <value>Velocity</value>
 
1462
        </attribute>
 
1463
        <element name="diagnostic">
 
1464
          <ref name="internal_algorithm"/>
 
1465
          <ref name="velocity_mesh_choice"/>
 
1466
          <ref name="diagnostic_vector_field"/>
 
1467
        </element>
 
1468
      </element>
 
1469
      <element name="vector_field">
 
1470
        <a:documentation>Gradient of a scalar field evaluated using the transpose
 
1471
of the C^T matrix constructed using control volumes.
 
1472
Field must be in this material_phase.</a:documentation>
 
1473
        <attribute name="rank">
 
1474
          <value>1</value>
 
1475
        </attribute>
 
1476
        <attribute name="name">
 
1477
          <value>ControlVolumeDivergenceTransposed</value>
 
1478
        </attribute>
 
1479
        <element name="diagnostic">
 
1480
          <ref name="internal_algorithm"/>
 
1481
          <attribute name="field_name">
 
1482
            <data type="string" datatypeLibrary=""/>
 
1483
          </attribute>
 
1484
          <ref name="velocity_mesh_choice"/>
 
1485
          <ref name="diagnostic_cv_gradient_vector_field"/>
 
1486
        </element>
 
1487
      </element>
 
1488
      <element name="vector_field">
 
1489
        <a:documentation>Calculate the control volume auxiliary gradient for a particular field.
 
1490
The related field must be a scalar field in this material_phase.</a:documentation>
 
1491
        <attribute name="rank">
 
1492
          <value>0</value>
 
1493
        </attribute>
 
1494
        <attribute name="name">
 
1495
          <value>ControlVolumeAuxiliaryGradient</value>
 
1496
        </attribute>
 
1497
        <element name="diagnostic">
 
1498
          <ref name="internal_algorithm"/>
 
1499
          <ref name="velocity_mesh_choice"/>
 
1500
          <attribute name="gradient_of_field">
 
1501
            <data type="string" datatypeLibrary=""/>
 
1502
          </attribute>
 
1503
          <ref name="diagnostic_vector_field"/>
 
1504
        </element>
 
1505
      </element>
 
1506
      <element name="vector_field">
 
1507
        <a:documentation>Calculate the dg (Bassi Rebay) auxiliary gradient for a particular field.
 
1508
The related field must be a scalar field in this material_phase.</a:documentation>
 
1509
        <attribute name="rank">
 
1510
          <value>0</value>
 
1511
        </attribute>
 
1512
        <attribute name="name">
 
1513
          <value>DGAuxiliaryGradient</value>
 
1514
        </attribute>
 
1515
        <element name="diagnostic">
 
1516
          <ref name="internal_algorithm"/>
 
1517
          <ref name="velocity_mesh_choice"/>
 
1518
          <attribute name="gradient_of_field">
 
1519
            <data type="string" datatypeLibrary=""/>
 
1520
          </attribute>
 
1521
          <ref name="diagnostic_vector_field"/>
 
1522
        </element>
 
1523
      </element>
 
1524
      <element name="vector_field">
 
1525
        <a:documentation>Absolute Difference between two vector fields.
 
1526
 
 
1527
Both fields must be in this material_phase.
 
1528
Assumes both fields are on the same mesh as the AbsoluteDifference field.</a:documentation>
 
1529
        <attribute name="rank">
 
1530
          <value>1</value>
 
1531
        </attribute>
 
1532
        <attribute name="name">
 
1533
          <value>AbsoluteDifference</value>
 
1534
        </attribute>
 
1535
        <element name="diagnostic">
 
1536
          <ref name="internal_algorithm"/>
 
1537
          <attribute name="field_name_a">
 
1538
            <data type="string" datatypeLibrary=""/>
 
1539
          </attribute>
 
1540
          <attribute name="field_name_b">
 
1541
            <data type="string" datatypeLibrary=""/>
 
1542
          </attribute>
 
1543
          <ref name="mesh_choice"/>
 
1544
          <ref name="diagnostic_vector_field"/>
 
1545
          <optional>
 
1546
            <element name="relative_to_average">
 
1547
              <a:documentation>Evaluate the absolute difference once the average difference has been removed?</a:documentation>
 
1548
              <empty/>
 
1549
            </element>
 
1550
          </optional>
 
1551
        </element>
 
1552
      </element>
 
1553
      <element name="vector_field">
 
1554
        <a:documentation>Absolute Difference between two vector fields.
 
1555
 
 
1556
Both fields must be in this material_phase.
 
1557
Assumes both fields are on the same mesh as the AbsoluteDifference field.</a:documentation>
 
1558
        <attribute name="rank">
 
1559
          <value>1</value>
 
1560
        </attribute>
 
1561
        <attribute name="name">
 
1562
          <value>VectorAbsoluteDifference</value>
 
1563
        </attribute>
 
1564
        <element name="diagnostic">
 
1565
          <ref name="internal_algorithm"/>
 
1566
          <attribute name="field_name_a">
 
1567
            <data type="string" datatypeLibrary=""/>
 
1568
          </attribute>
 
1569
          <attribute name="field_name_b">
 
1570
            <data type="string" datatypeLibrary=""/>
 
1571
          </attribute>
 
1572
          <ref name="mesh_choice"/>
 
1573
          <ref name="diagnostic_vector_field"/>
 
1574
          <optional>
 
1575
            <element name="relative_to_average">
 
1576
              <a:documentation>Evaluate the absolute difference once the average difference has been removed?</a:documentation>
 
1577
              <empty/>
 
1578
            </element>
 
1579
          </optional>
 
1580
        </element>
 
1581
      </element>
 
1582
      <element name="vector_field">
 
1583
        <a:documentation>Coordinate field remapped to the mesh of your choice.</a:documentation>
 
1584
        <attribute name="rank">
 
1585
          <value>1</value>
 
1586
        </attribute>
 
1587
        <attribute name="name">
 
1588
          <value>DiagnosticCoordinate</value>
 
1589
        </attribute>
 
1590
        <element name="diagnostic">
 
1591
          <ref name="internal_algorithm"/>
 
1592
          <ref name="mesh_choice"/>
 
1593
          <ref name="diagnostic_vector_field"/>
 
1594
        </element>
 
1595
      </element>
 
1596
      <element name="vector_field">
 
1597
        <a:documentation>Displacement</a:documentation>
 
1598
        <attribute name="rank">
 
1599
          <value>1</value>
 
1600
        </attribute>
 
1601
        <attribute name="name">
 
1602
          <value>Displacement</value>
 
1603
        </attribute>
 
1604
        <element name="diagnostic">
 
1605
          <ref name="internal_algorithm"/>
 
1606
          <ref name="velocity_mesh_choice"/>
 
1607
          <ref name="diagnostic_vector_field"/>
 
1608
        </element>
 
1609
      </element>
 
1610
      <element name="vector_field">
 
1611
        <a:documentation>Projects the Coriolis term onto the mesh of this diagnostic field.
 
1612
Note that multiple projection methods are available (under the
 
1613
algorithm option).</a:documentation>
 
1614
        <attribute name="rank">
 
1615
          <value>1</value>
 
1616
        </attribute>
 
1617
        <attribute name="name">
 
1618
          <value>Coriolis</value>
 
1619
        </attribute>
 
1620
        <element name="diagnostic">
 
1621
          <ref name="coriolis_algorithm"/>
 
1622
          <ref name="velocity_mesh_choice"/>
 
1623
          <ref name="diagnostic_vector_field"/>
 
1624
        </element>
 
1625
      </element>
 
1626
    </choice>
 
1627
    <!--
 
1628
      Insert new diagnostic vector field here using the template:
 
1629
             element vector_field {
 
1630
                 attribute rank { "1" },
 
1631
                 attribute name { "NewFieldName" },
 
1632
                 (
 
1633
                    element diagnostic {
 
1634
                       internal_algorithm,
 
1635
                       mesh_choice,
 
1636
                       diagnostic_vector_field
 
1637
                    }
 
1638
                 )
 
1639
             }
 
1640
    -->
 
1641
  </define>
 
1642
  <!-- This is the choice of additional tensor fields -->
 
1643
  <define name="tensor_field_choice">
 
1644
    <!--
 
1645
      The first is a generic field, which may be used for any user-defined field
 
1646
      that FLUIDITY knows nothing about, or a generic diagnostic
 
1647
      Prognostic tensor fields are not possible.
 
1648
    -->
 
1649
    <choice>
 
1650
      <element name="tensor_field">
 
1651
        <a:documentation>Generic field variable (tensor)</a:documentation>
 
1652
        <attribute name="rank">
 
1653
          <value>2</value>
 
1654
        </attribute>
 
1655
        <attribute name="name">
 
1656
          <data type="string"/>
 
1657
        </attribute>
 
1658
        <choice>
 
1659
          <a:documentation>Field type</a:documentation>
 
1660
          <element name="prescribed">
 
1661
            <ref name="mesh_choice"/>
 
1662
            <ref name="prescribed_tensor_field"/>
 
1663
          </element>
 
1664
          <element name="diagnostic">
 
1665
            <ref name="tensor_diagnostic_algorithms"/>
 
1666
            <ref name="velocity_mesh_choice"/>
 
1667
            <ref name="diagnostic_tensor_field"/>
 
1668
          </element>
 
1669
        </choice>
 
1670
      </element>
 
1671
      <!--
 
1672
        
 
1673
        - - Second is a list of tensor fields that are primarily prescribed.
 
1674
        - - The list is in order of most frequently used.
 
1675
        
 
1676
      -->
 
1677
      <element name="___Prescribed_fields_below___">
 
1678
        <a:documentation>Prescribed scalar fields below this</a:documentation>
 
1679
        <empty/>
 
1680
      </element>
 
1681
      <!--
 
1682
        
 
1683
        Insert new prescribed tensor fields here using the template:
 
1684
               element tensor_field {
 
1685
                   attribute rank { "2" },
 
1686
                   attribute name { "NewFieldName" },
 
1687
                   (
 
1688
                      element prescribed {
 
1689
                         mesh_choice,
 
1690
                         prescribed_tensor_field
 
1691
                      }
 
1692
                   )
 
1693
               }|
 
1694
        
 
1695
        - - Last is a list of fields that are primarily diagnostic.
 
1696
        - - The list is in order of most frequently used.
 
1697
        
 
1698
      -->
 
1699
      <element name="___Diagnostic_Fields_Below___">
 
1700
        <a:documentation>Diagnostic tensor fields below this</a:documentation>
 
1701
        <empty/>
 
1702
      </element>
 
1703
    </choice>
 
1704
    <!--
 
1705
      Insert new diagnostic tensor field here using the template:
 
1706
             element tensor_field {
 
1707
                 attribute name { "NewFieldName" },
 
1708
                 (
 
1709
                    element diagnostic {
 
1710
                       internal_algorithm,
 
1711
                       mesh_choice,
 
1712
                       diagnostic_tensor_field
 
1713
                    }
 
1714
                 )
 
1715
             }
 
1716
    -->
 
1717
  </define>
 
1718
  <define name="mixing_stats">
 
1719
    <element name="include_mixing_stats">
 
1720
      <a:documentation>Enable to include in the .stat file the fractions of the
 
1721
scalar field contained in
 
1722
bins specified by the user. This allows mixing of the field to be quantified.
 
1723
Replaces and expands upon the old heaviside.dat file</a:documentation>
 
1724
      <attribute name="name">
 
1725
        <data type="string"/>
 
1726
      </attribute>
 
1727
      <attribute name="replaces">
 
1728
        <value>heaviside.dat file</value>
 
1729
      </attribute>
 
1730
      <choice>
 
1731
        <element name="continuous_galerkin">
 
1732
          <a:documentation>Select whether to evaluate the volume fraction over the finite element
 
1733
(continuous galerkin) or within the control volume (control_volumes).
 
1734
 
 
1735
NOTE: continuous_galerkin only works with linear tets
 
1736
 
 
1737
NOTE: continuous_galerkin is not fully validated yet</a:documentation>
 
1738
          <optional>
 
1739
            <element name="normalise">
 
1740
              <a:documentation>if select normalise the volume fractions will be
 
1741
divided by the total volume of the domain</a:documentation>
 
1742
              <empty/>
 
1743
            </element>
 
1744
          </optional>
 
1745
        </element>
 
1746
        <element name="control_volumes">
 
1747
          <a:documentation>Select whether to evaluate the volume fraction over the finite element
 
1748
(continuous galerkin) or within the control volume (control_volumes).</a:documentation>
 
1749
          <optional>
 
1750
            <element name="normalise">
 
1751
              <a:documentation>if select normalise the volume fractions will be divided by the total volume of the domain  </a:documentation>
 
1752
              <empty/>
 
1753
            </element>
 
1754
          </optional>
 
1755
        </element>
 
1756
      </choice>
 
1757
      <element name="mixing_bin_bounds">
 
1758
        <a:documentation>The values of the bounds of the bins 
 
1759
e.g. the values -1.5 0.0 1.5 2.0 will return 4 bins 
 
1760
and the fraction of the field in each bin with,
 
1761
-1.5&lt;=field&lt;0.0, 0.0&lt;=field&lt;1.5, 1.5&lt;=field&lt;2.0, 2.0&lt;=field, 
 
1762
will be calculated.  </a:documentation>
 
1763
        <choice>
 
1764
          <element name="constant">
 
1765
            <a:documentation>list of bin bounds</a:documentation>
 
1766
            <ref name="real_vector"/>
 
1767
          </element>
 
1768
          <element name="python">
 
1769
            <a:documentation>Python function prescribing bin bounds. Functions should be of the form:
 
1770
 
 
1771
 def val(t):
 
1772
    # Function code
 
1773
    return # Return value that should be an array of reals
 
1774
 
 
1775
</a:documentation>
 
1776
            <ref name="python_code"/>
 
1777
          </element>
 
1778
        </choice>
 
1779
      </element>
 
1780
      <optional>
 
1781
        <element name="tolerance">
 
1782
          <a:documentation>Define the tolerance beneath the specified bins that should be included.
 
1783
Defaults to zero at machine tolerance (epsilon(0.0)) if not selected.</a:documentation>
 
1784
          <ref name="real"/>
 
1785
        </element>
 
1786
      </optional>
 
1787
    </element>
 
1788
  </define>
 
1789
  <define name="cv_stats">
 
1790
    <element name="include_cv_stats">
 
1791
      <a:documentation>Include statistics evaluated on the control volume mesh.</a:documentation>
 
1792
      <empty/>
 
1793
    </element>
 
1794
  </define>
 
1795
  <!-- Options for inclusion of calculations of surface integrals in the .stat file   -->
 
1796
  <define name="surface_integral_stats_base.surface_integral">
 
1797
    <attribute name="name">
 
1798
      <data type="string"/>
 
1799
    </attribute>
 
1800
    <optional>
 
1801
      <element name="surface_ids">
 
1802
        <a:documentation>Surface IDs defining the surface over which to integrate. If disabled, integrates over the whole surface.</a:documentation>
 
1803
        <ref name="integer_vector"/>
 
1804
      </element>
 
1805
    </optional>
 
1806
    <optional>
 
1807
      <element name="normalise">
 
1808
        <a:documentation>Enable to normalise the integral by dividing by the surface area</a:documentation>
 
1809
        <ref name="comment"/>
 
1810
      </element>
 
1811
    </optional>
 
1812
  </define>
 
1813
  <define name="surface_integral_stats_scalar">
 
1814
    <element name="surface_integral">
 
1815
      <a:documentation>Surface integral calculations. The following integral types are available:
 
1816
 value: Integrates the field
 
1817
 gradient_normal: Integrates the normal component of the gradient of the field</a:documentation>
 
1818
      <ref name="surface_integral_stats_scalar.surface_integral"/>
 
1819
    </element>
 
1820
  </define>
 
1821
  <define name="surface_integral_stats_scalar.surface_integral">
 
1822
    <ref name="surface_integral_stats_base.surface_integral"/>
 
1823
  </define>
 
1824
  <define name="surface_integral_stats_scalar.surface_integral" combine="interleave">
 
1825
    <attribute name="type">
 
1826
      <choice>
 
1827
        <value>value</value>
 
1828
        <value>gradient_normal</value>
 
1829
      </choice>
 
1830
    </attribute>
 
1831
  </define>
 
1832
  <define name="surface_integral_stats_vector">
 
1833
    <element name="surface_integral">
 
1834
      <a:documentation>Surface integral calculations. The following integral types are available:
 
1835
 normal: Integrates the normal component of the field</a:documentation>
 
1836
      <ref name="surface_integral_stats_vector.surface_integral"/>
 
1837
    </element>
 
1838
  </define>
 
1839
  <define name="surface_integral_stats_vector.surface_integral">
 
1840
    <ref name="surface_integral_stats_base.surface_integral"/>
 
1841
  </define>
 
1842
  <define name="surface_integral_stats_vector.surface_integral" combine="interleave">
 
1843
    <attribute name="type">
 
1844
      <value>normal</value>
 
1845
    </attribute>
 
1846
  </define>
 
1847
  <define name="recalculation_options">
 
1848
    <element name="do_not_recalculate">
 
1849
      <a:documentation>Prevent this field from being recalculated at every timestep.
 
1850
This is cheaper especially if you are enforcing discrete properties on the field.</a:documentation>
 
1851
      <empty/>
 
1852
    </element>
 
1853
  </define>
 
1854
  <define name="discrete_properties_algorithm_scalar">
 
1855
    <empty/>
 
1856
  </define>
 
1857
  <define name="discrete_properties_algorithm_vector">
 
1858
    <empty/>
 
1859
  </define>
 
1860
  <define name="represcribe_before_interpolation">
 
1861
    <element name="represcribe_before_interpolation">
 
1862
      <a:documentation>Represcribe the field before interpolation.
 
1863
 
 
1864
This means the interpolation will not be conservative from the previous mesh so be careful what you're trying to achieve!</a:documentation>
 
1865
      <empty/>
 
1866
    </element>
 
1867
  </define>
 
1868
  <define name="geometry">
 
1869
    <element name="geometry">
 
1870
      <a:documentation>Options dealing with the specification of geometry</a:documentation>
 
1871
      <element name="dimension">
 
1872
        <a:documentation>Dimension of the problem.
 
1873
&lt;b&gt;This can only be set once&lt;/b&gt;</a:documentation>
 
1874
        <attribute name="replaces">
 
1875
          <value>NDIM</value>
 
1876
        </attribute>
 
1877
        <element name="integer_value">
 
1878
          <attribute name="rank">
 
1879
            <value>0</value>
 
1880
          </attribute>
 
1881
          <value>2</value>
 
1882
        </element>
 
1883
      </element>
 
1884
      <element name="mesh">
 
1885
        <a:documentation>The position mesh</a:documentation>
 
1886
        <attribute name="name">
 
1887
          <value>CoordinateMesh</value>
 
1888
        </attribute>
 
1889
        <ref name="mesh_info"/>
 
1890
      </element>
 
1891
      <optional>
 
1892
        <element name="mesh">
 
1893
          <a:documentation>The velocity mesh</a:documentation>
 
1894
          <attribute name="name">
 
1895
            <value>VelocityMesh</value>
 
1896
          </attribute>
 
1897
          <ref name="mesh_info"/>
 
1898
        </element>
 
1899
      </optional>
 
1900
      <optional>
 
1901
        <element name="mesh">
 
1902
          <a:documentation>The pressure mesh</a:documentation>
 
1903
          <attribute name="name">
 
1904
            <value>PressureMesh</value>
 
1905
          </attribute>
 
1906
          <ref name="mesh_info"/>
 
1907
        </element>
 
1908
      </optional>
 
1909
      <zeroOrMore>
 
1910
        <element name="mesh">
 
1911
          <attribute name="name">
 
1912
            <data type="string"/>
 
1913
          </attribute>
 
1914
          <ref name="mesh_info"/>
 
1915
          <optional>
 
1916
            <element name="exclude_from_mesh_adaptivity">
 
1917
              <empty/>
 
1918
            </element>
 
1919
          </optional>
 
1920
        </element>
 
1921
      </zeroOrMore>
 
1922
      <element name="quadrature">
 
1923
        <a:documentation>Quadrature</a:documentation>
 
1924
        <element name="degree">
 
1925
          <a:documentation>Quadrature degree
 
1926
 
 
1927
note: this specifies the degree of quadrature,
 
1928
not the number of gauss points</a:documentation>
 
1929
          <attribute name="replaces">
 
1930
            <value>NGI</value>
 
1931
          </attribute>
 
1932
          <ref name="integer"/>
 
1933
        </element>
 
1934
        <optional>
 
1935
          <element name="surface_degree">
 
1936
            <a:documentation>Surface quadrature degree
 
1937
 
 
1938
note: this specifies the degree of surface
 
1939
quadrature not the number of surface gauss points</a:documentation>
 
1940
            <attribute name="replaces">
 
1941
              <value>SNGI</value>
 
1942
            </attribute>
 
1943
            <ref name="integer"/>
 
1944
          </element>
 
1945
        </optional>
 
1946
        <optional>
 
1947
          <element name="quadrature_family">
 
1948
            <a:documentation>Select which family of quadrature rules to use.
 
1949
The default is family_cools.
 
1950
family_wandzura allows for degree up to 30
 
1951
on triangular meshes.
 
1952
family_grundmann_moeller allows for degree up to
 
1953
29 on simplicial meshes in arbitrary dimension.</a:documentation>
 
1954
            <element name="string_value">
 
1955
              <choice>
 
1956
                <value>family_cools</value>
 
1957
                <value>family_grundmann_moeller</value>
 
1958
                <value>family_wandzura</value>
 
1959
              </choice>
 
1960
            </element>
 
1961
          </element>
 
1962
        </optional>
 
1963
      </element>
 
1964
      <optional>
 
1965
        <element name="disable_geometric_data_cache">
 
1966
          <a:documentation>This causes the change of variables associated with each element in 
 
1967
the mesh to be stored rather than calculated every time it is used. 
 
1968
This should speed up computations at a cost of some memory. 
 
1969
 
 
1970
The cache is automatically regenerated after mesh movement or 
 
1971
adaptivity and is automatically disabled for non-linear positions fields.</a:documentation>
 
1972
          <empty/>
 
1973
        </element>
 
1974
      </optional>
 
1975
    </element>
 
1976
  </define>
 
1977
  <define name="simple_physical_parameter_options">
 
1978
    <element name="physical_parameters">
 
1979
      <ref name="simple_gravity_options"/>
 
1980
      <ref name="coriolis_options"/>
 
1981
    </element>
 
1982
  </define>
 
1983
  <define name="simple_gravity_options">
 
1984
    <element name="gravity">
 
1985
      <a:documentation>Set a gravity to be included in the buoyancy term.</a:documentation>
 
1986
      <element name="magnitude">
 
1987
        <a:documentation>Acceleration due to gravity. 9.8 m/s^2 on earth.</a:documentation>
 
1988
        <ref name="real"/>
 
1989
      </element>
 
1990
    </element>
 
1991
  </define>
 
1992
  <define name="simple_prognostic_velocity_field">
 
1993
    <element name="spatial_discretisation">
 
1994
      <a:documentation>Spatial discretisation options</a:documentation>
 
1995
      <choice>
 
1996
        <element name="continuous_galerkin">
 
1997
          <a:documentation>Discontinuous galerkin formulation</a:documentation>
 
1998
          <optional>
 
1999
            <element name="mass_terms">
 
2000
              <a:documentation>Discretisation options for the mass terms in the velocity equation.</a:documentation>
 
2001
              <optional>
 
2002
                <element name="lump_mass_matrix">
 
2003
                  <a:documentation>Lump the mass matrix</a:documentation>
 
2004
                  <optional>
 
2005
                    <element name="use_submesh">
 
2006
                      <a:documentation>Lump on the submesh.
 
2007
This only works for simplex meshes and is only
 
2008
strictly valid on 2d meshes.</a:documentation>
 
2009
                      <empty/>
 
2010
                    </element>
 
2011
                  </optional>
 
2012
                  <empty/>
 
2013
                </element>
 
2014
              </optional>
 
2015
            </element>
 
2016
          </optional>
 
2017
          <optional>
 
2018
            <element name="coriolis_terms">
 
2019
              <a:documentation>Discretisation options for the Coriolis terms in the velocity equation.</a:documentation>
 
2020
              <optional>
 
2021
                <!-- Lump the mass matrix. -->
 
2022
                <element name="lump_mass_matrix">
 
2023
                  <ref name="comment"/>
 
2024
                </element>
 
2025
              </optional>
 
2026
            </element>
 
2027
          </optional>
 
2028
          <element name="advection_terms">
 
2029
            <a:documentation>Discretisation options for the advection terms.</a:documentation>
 
2030
            <element name="exclude_advection_terms">
 
2031
              <a:documentation>Remove the advection terms from the equation.</a:documentation>
 
2032
              <ref name="comment"/>
 
2033
            </element>
 
2034
          </element>
 
2035
        </element>
 
2036
        <element name="discontinuous_galerkin">
 
2037
          <a:documentation>Discontinuous galerkin formulation</a:documentation>
 
2038
          <attribute name="replaces">
 
2039
            <value>DISOPT</value>
 
2040
          </attribute>
 
2041
          <optional>
 
2042
            <element name="mass_terms">
 
2043
              <a:documentation>Discretisation options for the mass terms in the velocity equation.</a:documentation>
 
2044
              <optional>
 
2045
                <element name="lump_mass_matrix">
 
2046
                  <a:documentation>Lump the mass matrix</a:documentation>
 
2047
                  <optional>
 
2048
                    <element name="use_submesh">
 
2049
                      <a:documentation>Lump on the submesh.
 
2050
This only works for simplex meshes and is only
 
2051
strictly valid on 2d meshes.</a:documentation>
 
2052
                      <empty/>
 
2053
                    </element>
 
2054
                  </optional>
 
2055
                  <empty/>
 
2056
                </element>
 
2057
              </optional>
 
2058
            </element>
 
2059
          </optional>
 
2060
          <optional>
 
2061
            <element name="coriolis_terms">
 
2062
              <a:documentation>Discretisation options for the Coriolis terms in the velocity equation.</a:documentation>
 
2063
              <optional>
 
2064
                <!-- Lump the mass matrix. -->
 
2065
                <element name="lump_mass_matrix">
 
2066
                  <ref name="comment"/>
 
2067
                </element>
 
2068
              </optional>
 
2069
            </element>
 
2070
          </optional>
 
2071
          <element name="advection_scheme">
 
2072
            <choice>
 
2073
              <element name="none">
 
2074
                <a:documentation>Disable advection</a:documentation>
 
2075
                <empty/>
 
2076
              </element>
 
2077
              <element name="upwind">
 
2078
                <a:documentation>Straightforward upwinding of the nonlinear velocity.</a:documentation>
 
2079
                <empty/>
 
2080
              </element>
 
2081
            </choice>
 
2082
          </element>
 
2083
        </element>
 
2084
      </choice>
 
2085
      <optional>
 
2086
        <element name="conservative_advection">
 
2087
          <a:documentation>Conservative discretisation of momentum equations
 
2088
 BETA=1. -- conservative (divergence form)
 
2089
 BETA=0. -- non-conservative
 
2090
 0. &lt; BETA &lt; 1.
 
2091
 
 
2092
Defaults to 1.0 if not supplied.</a:documentation>
 
2093
          <attribute name="replaces">
 
2094
            <value>BETA</value>
 
2095
          </attribute>
 
2096
          <ref name="real"/>
 
2097
        </element>
 
2098
      </optional>
 
2099
    </element>
 
2100
    <element name="temporal_discretisation">
 
2101
      <a:documentation>Temporal discretisation options</a:documentation>
 
2102
      <optional>
 
2103
        <element name="relaxation">
 
2104
          <a:documentation>Non-linear relaxation term
 
2105
 =0.  -- previous timestep velocity solution used in non-linear terms of momentum equations
 
2106
 =1.  -- previous iteration velocity solution used in non-linear terms of momentum equations
 
2107
 0. &lt; ITHETA &lt; 1.
 
2108
 
 
2109
Defaults to 0.5 if not supplied.</a:documentation>
 
2110
          <attribute name="replaces">
 
2111
            <value>ITHETA</value>
 
2112
          </attribute>
 
2113
          <ref name="real"/>
 
2114
        </element>
 
2115
      </optional>
 
2116
    </element>
 
2117
    <oneOrMore>
 
2118
      <choice>
 
2119
        <element name="initial_condition">
 
2120
          <a:documentation>Initial condition for WholeMesh
 
2121
 
 
2122
Only specify one condition if not using mesh regions.
 
2123
Otherwise select other initial_condition option, specify region_ids
 
2124
and distinct names.  Then add extra intial conditions for other regions.</a:documentation>
 
2125
          <attribute name="name">
 
2126
            <value>WholeMesh</value>
 
2127
          </attribute>
 
2128
          <ref name="simple_input_choice_initial_condition_vector"/>
 
2129
        </element>
 
2130
        <element name="initial_condition">
 
2131
          <a:documentation>Multiple initial_conditions are allowed if specifying
 
2132
different values in different
 
2133
regions of the mesh (defined by region_ids).  In this case
 
2134
each initial_condition
 
2135
requires a distinct name for the options dictionary.</a:documentation>
 
2136
          <attribute name="name">
 
2137
            <data type="string" datatypeLibrary=""/>
 
2138
          </attribute>
 
2139
          <ref name="region_ids"/>
 
2140
          <ref name="simple_input_choice_initial_condition_vector"/>
 
2141
        </element>
 
2142
      </choice>
 
2143
    </oneOrMore>
 
2144
    <element name="boundary_conditions">
 
2145
      <a:documentation>Boundary conditions</a:documentation>
 
2146
      <attribute name="replaces">
 
2147
        <value>boundary, TMPER1 TMPER2 TMPERI</value>
 
2148
      </attribute>
 
2149
      <attribute name="name">
 
2150
        <value>FreeSlip</value>
 
2151
      </attribute>
 
2152
      <element name="surface_ids">
 
2153
        <a:documentation>Enter all external surface IDs here</a:documentation>
 
2154
        <ref name="integer_vector"/>
 
2155
      </element>
 
2156
      <ref name="velocity_boundary_conditions"/>
 
2157
    </element>
 
2158
    <ref name="prognostic_vector_output_options"/>
 
2159
    <ref name="prognostic_velocity_stat_options"/>
 
2160
    <ref name="prognostic_detector_options"/>
 
2161
    <ref name="interpolation_algorithm_vector"/>
 
2162
  </define>
 
2163
  <define name="prognostic_layerthickness_field">
 
2164
    <element name="spatial_discretisation">
 
2165
      <a:documentation>Spatial discretisation options</a:documentation>
 
2166
      <element name="continuous_galerkin">
 
2167
        <a:documentation>Continuous Galerkin formulation</a:documentation>
 
2168
        <optional>
 
2169
          <element name="mass_terms">
 
2170
            <a:documentation>Discretisation options for the mass term in the layer thickness equation.</a:documentation>
 
2171
            <optional>
 
2172
              <element name="lump_mass_matrix">
 
2173
                <a:documentation>Lump the mass matrix</a:documentation>
 
2174
                <optional>
 
2175
                  <element name="use_submesh">
 
2176
                    <a:documentation>Lump on the submesh.
 
2177
This only works for simplex meshes and is only
 
2178
strictly valid on 2d meshes.</a:documentation>
 
2179
                    <empty/>
 
2180
                  </element>
 
2181
                </optional>
 
2182
                <empty/>
 
2183
              </element>
 
2184
            </optional>
 
2185
          </element>
 
2186
        </optional>
 
2187
        <element name="advection_terms">
 
2188
          <a:documentation>Discretisation options for the advection terms.</a:documentation>
 
2189
          <element name="exclude_advection_terms">
 
2190
            <a:documentation>Remove the advection terms from the equation.</a:documentation>
 
2191
            <ref name="comment"/>
 
2192
          </element>
 
2193
        </element>
 
2194
        <ref name="comment"/>
 
2195
      </element>
 
2196
    </element>
 
2197
    <element name="temporal_discretisation">
 
2198
      <a:documentation>Temporal discretisation options</a:documentation>
 
2199
      <element name="theta">
 
2200
        <a:documentation>Implicit/explicit control (THETA)
 
2201
 =0.  -- explicit
 
2202
 =0.5 -- Crank-Nicolson
 
2203
 =1.  -- implicit</a:documentation>
 
2204
        <attribute name="replaces">
 
2205
          <value>THETA</value>
 
2206
        </attribute>
 
2207
        <ref name="real"/>
 
2208
      </element>
 
2209
      <optional>
 
2210
        <element name="relaxation">
 
2211
          <a:documentation>Non-linear relaxation term
 
2212
 =0.  -- previous timestep velocity solution used in non-linear terms of momentum equations
 
2213
 =1.  -- previous iteration velocity solution used in non-linear terms of momentum equations
 
2214
 0. &lt; ITHETA &lt; 1.
 
2215
 
 
2216
Defaults to 0.5 if not supplied.</a:documentation>
 
2217
          <attribute name="replaces">
 
2218
            <value>ITHETA</value>
 
2219
          </attribute>
 
2220
          <ref name="real"/>
 
2221
        </element>
 
2222
      </optional>
 
2223
    </element>
 
2224
    <element name="solver">
 
2225
      <a:documentation>Solver</a:documentation>
 
2226
      <ref name="linear_solver_options_asym"/>
 
2227
    </element>
 
2228
    <choice>
 
2229
      <element name="initial_condition">
 
2230
        <a:documentation>Initial condition for WholeMesh
 
2231
 
 
2232
Only specify one condition if not using mesh regions.
 
2233
Otherwise select other initial_condition option, specify region_ids
 
2234
and distinct names.  Then add extra intial conditions for other regions.</a:documentation>
 
2235
        <attribute name="name">
 
2236
          <value>WholeMesh</value>
 
2237
        </attribute>
 
2238
        <ref name="input_choice_initial_condition_real"/>
 
2239
      </element>
 
2240
      <element name="initial_condition">
 
2241
        <a:documentation>Multiple initial_conditions are allowed if specifying
 
2242
different values in different
 
2243
regions of the mesh (defined by region_ids).  In this case
 
2244
each initial_condition
 
2245
requires a distinct name for the options dictionary.</a:documentation>
 
2246
        <attribute name="name">
 
2247
          <data type="string" datatypeLibrary=""/>
 
2248
        </attribute>
 
2249
        <ref name="region_ids"/>
 
2250
        <ref name="input_choice_initial_condition_real"/>
 
2251
      </element>
 
2252
    </choice>
 
2253
    <element name="mean_layer_thickness">
 
2254
      <a:documentation>Mean value of thickness to use in wave equation solver
 
2255
Will be replaced by a field in due course</a:documentation>
 
2256
      <ref name="real"/>
 
2257
    </element>
 
2258
    <ref name="prognostic_scalar_output_options"/>
 
2259
    <ref name="prognostic_scalar_stat_options"/>
 
2260
    <ref name="interpolation_algorithm_scalar"/>
 
2261
  </define>
 
2262
  <!--
 
2263
    Choice of input method for initial conditions
 
2264
    Note: combine = "choice" should be used here to combine with input_choice_real, but Diamond doesn't support it
 
2265
  -->
 
2266
  <define name="simple_input_choice_initial_condition_vector">
 
2267
    <choice>
 
2268
      <element name="constant">
 
2269
        <a:documentation>Constant value</a:documentation>
 
2270
        <ref name="real_dim_vector"/>
 
2271
      </element>
 
2272
      <element name="python">
 
2273
        <a:documentation>Python function prescribing dimensional vector input. Functions should be of the form:
 
2274
 
 
2275
 def val(X, t):
 
2276
    # Function code
 
2277
    return # Return value
 
2278
 
 
2279
where X and the return value are tuples of length geometry dimension.</a:documentation>
 
2280
        <ref name="python_code"/>
 
2281
      </element>
 
2282
      <element name="from_file">
 
2283
        <a:documentation>Initialise the field from an existing file (indended primarily for use in checkpointing). The file mesh must match the mesh of this field (except for piecewise constant fields which will be remapped back from the discontinuous nodal values).</a:documentation>
 
2284
        <attribute name="file_name">
 
2285
          <data type="string"/>
 
2286
        </attribute>
 
2287
        <ref name="vtu_input_format"/>
 
2288
        <ref name="comment"/>
 
2289
      </element>
 
2290
      <element name="NEMO_data">
 
2291
        <a:documentation>Initialize the field from NEMO data. Note that a file path
 
2292
under '/ocean_forcing/external_data_boundary_conditions' must
 
2293
be set to use this option.</a:documentation>
 
2294
        <element name="format">
 
2295
          <a:documentation>Currently, only the velocity vector field may be initialised in this manner.</a:documentation>
 
2296
          <element name="string_value">
 
2297
            <value>Velocity</value>
 
2298
          </element>
 
2299
        </element>
 
2300
      </element>
 
2301
      <element name="balanced">
 
2302
        <a:documentation>Set balanced velocity from height field</a:documentation>
 
2303
        <empty/>
 
2304
      </element>
 
2305
    </choice>
 
2306
  </define>
 
2307
</grammar>