~grm08/fluidity/hilbert-for-pyop2

« back to all changes in this revision

Viewing changes to schemas/test_advection_diffusion_options.rnc

  • 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
include "spud_base.rnc"
 
2
 
 
3
include "diagnostic_algorithms.rnc"
 
4
include "stabilisation.rnc"
 
5
 
 
6
start =
 
7
   (
 
8
      ## The root node of the options dictionary.
 
9
      element fluidity_options {
 
10
         comment,
 
11
         ## Model output files are named according to the simulation
 
12
         ## name, e.g. [simulation_name]_0.vtu. Non-standard
 
13
         ## characters in the simulation name should be avoided.
 
14
         element simulation_name {
 
15
            anystring
 
16
         },
 
17
         ## Options dealing with the specification of geometry
 
18
         element geometry {
 
19
            ## Dimension of the problem.
 
20
            ## <b>This can only be set once</b>
 
21
            element dimension {
 
22
               attribute replaces {"NDIM"},
 
23
               element integer_value {
 
24
                  attribute rank {"0"},
 
25
                  ("3"|"2"|"1")
 
26
               }
 
27
            },
 
28
            ## The position mesh
 
29
            element mesh {
 
30
               attribute name { "CoordinateMesh" },
 
31
               mesh_info
 
32
            },
 
33
            ## The velocity mesh
 
34
            element mesh {
 
35
               attribute name { "VelocityMesh" },
 
36
               mesh_info
 
37
            },
 
38
            element mesh {
 
39
               attribute name { xsd:string },
 
40
               mesh_info,
 
41
               element exclude_from_mesh_adaptivity{empty}?
 
42
            }*,
 
43
            ## Quadrature
 
44
            element quadrature {
 
45
               ## Quadrature degree
 
46
               ## 
 
47
               ## note: this specifies the degree of quadrature,
 
48
               ## not the number of gauss points
 
49
               element degree {
 
50
                  attribute replaces {"NGI"},
 
51
                  integer
 
52
               },
 
53
               ## Surface quadrature degree
 
54
               ## 
 
55
               ## note: this specifies the degree of surface
 
56
               ## quadrature not the number of surface gauss points
 
57
               element surface_degree {
 
58
                  attribute replaces {"SNGI"},
 
59
                  integer
 
60
               }?,
 
61
               ## Select which family of quadrature rules to use.
 
62
               ## The default is family_cools.
 
63
               ## family_wandzura allows for degree up to 30
 
64
               ## on triangular meshes.
 
65
               ## family_grundmann_moeller allows for degree up to
 
66
               ## 29 on simplicial meshes in arbitrary dimension.
 
67
               element quadrature_family {
 
68
                 ( "family_cools" | "family_grundmann_moeller" | "family_wandzura" ) 
 
69
               }?
 
70
            }
 
71
         },
 
72
         ## Input/output options
 
73
         element io {
 
74
            ## Format for dump files. Only vtk for now.
 
75
            element dump_format {
 
76
               element string_value{
 
77
                  "vtk"
 
78
               }
 
79
            },
 
80
            (
 
81
               ## Period between dumps in time units.
 
82
               ##
 
83
               ## Specifies the period between each dump of the solution to disk.
 
84
               ## A value of 0.0 indicates that there would be a dump at every timestep.
 
85
               element dump_period {
 
86
               (
 
87
                 element constant {
 
88
                   attribute replaces {"TIMDUM"},
 
89
                   real
 
90
                 }|
 
91
                ## Python function prescribing real input. Functions should be of the form:
 
92
                ##
 
93
                ##  def val(t):
 
94
                ##     # Function code
 
95
                ##     return # Return value
 
96
                ##
 
97
                ##
 
98
                element python {
 
99
                  attribute replaces {"TIMDUM"},
 
100
                  python_code
 
101
                }
 
102
              )
 
103
              }|
 
104
              ## Dump period, in timesteps.
 
105
              ## 
 
106
              ## Specifies the number of timesteps between each dump of the solution to disk.
 
107
              ## A value of 0 indicates a dump at every timestep.
 
108
              element dump_period_in_timesteps {
 
109
              (
 
110
                element constant {
 
111
                  integer
 
112
                }|
 
113
                ## Python function prescribing real input. Functions should be of the form:
 
114
                ##
 
115
                ##  def val(t):
 
116
                ##     # Function code
 
117
                ##     return # Return value
 
118
                ##
 
119
                ##
 
120
                element python {
 
121
                  python_code
 
122
                }
 
123
              )
 
124
              }
 
125
            ),
 
126
            # every CPUDUM seconds write results to disc.
 
127
            ## This is usually disabled.
 
128
            element cpu_dump_period {
 
129
               attribute replaces {"CPUDUM"},
 
130
               real
 
131
            }?,
 
132
            ## The period between dumps in walltime seconds. This is usually disabled.
 
133
            element wall_time_dump_period {
 
134
               attribute replaces {"WTIDUM"},
 
135
               real
 
136
            }?,
 
137
            (
 
138
               ## The mesh on to which all the fields will be
 
139
               ## interpolated for VTK output.
 
140
               element output_mesh {
 
141
                  attribute name { "VelocityMesh" }
 
142
               }|
 
143
               ## The mesh on to which all the fields will be
 
144
               ## interpolated for VTK output.
 
145
               element output_mesh {
 
146
                  attribute name { "PressureMesh" }
 
147
               }|
 
148
               ## The mesh on to which all the fields will be
 
149
               ## interpolated for VTK output.
 
150
               element output_mesh {
 
151
                  attribute name { "CoordinateMesh" }
 
152
               }|
 
153
               ## The mesh on to which all the fields will be
 
154
               ## interpolated for VTK output.
 
155
               element output_mesh {
 
156
                  attribute name { xsd:string }
 
157
               }
 
158
            )
 
159
         },
 
160
         ## Options dealing with time discretisation
 
161
         element timestepping {
 
162
            ## Current simulation time. At the start of the simulation this
 
163
            ## is the start time.
 
164
            element current_time {
 
165
               attribute replaces {"ACCTIM"},
 
166
               real,
 
167
               ## The following excerpt from the Udunits
 
168
               ## documentation explains the time unit encoding by
 
169
               ## example:
 
170
               ##
 
171
               ## The specification:
 
172
               ##
 
173
               ## seconds since 1992-10-8 15:15:42.5 -6:00
 
174
               ##
 
175
               ## indicates seconds since October 8th, 1992 at 3
 
176
               ## hours, 15 minutes and 42.5 seconds in the afternoon
 
177
               ## in the time zone which is six hours to the west of
 
178
               ## Coordinated Universal Time (i.e.  Mountain Daylight
 
179
               ## Time). The time zone specification can also be
 
180
               ## written without a colon using one or two-digits
 
181
               ## (indicating hours) or three or four digits
 
182
               ## (indicating hours and minutes).
 
183
               ##
 
184
               ## Time units are particularly required in situations
 
185
               ## where the problem (time-varying) boundary conditions
 
186
               ## and/ initial conditions are a function of time as
 
187
               ## defined by a calendar.  Examples include atmospheric
 
188
               ## forcing and climatology. The current time, specified
 
189
               ## above, is zero at the reference data/time.
 
190
               element time_units{attribute date { xsd:string }}?
 
191
            },
 
192
            ## The time step size. If adaptive time stepping is used
 
193
            ## then this is the initial time step size.
 
194
            element timestep {
 
195
               attribute replaces {"DT"},
 
196
               real
 
197
            },
 
198
            ## Simulation time at which the simulation should end.
 
199
            element finish_time {
 
200
               attribute replaces {"LTIME"},
 
201
               real
 
202
            },
 
203
            ## Timestep after which the simulation should end.
 
204
            element final_timestep {
 
205
               integer
 
206
            }?,
 
207
            ## Maximum CPU time (secs) taken up before
 
208
            ## simulation terminates writing results to disc.
 
209
            ## 
 
210
            ## Manual suggests 1.E+20
 
211
            element cpu_time_limit {
 
212
               attribute replaces {"CPULIM"},
 
213
               real
 
214
            }?,
 
215
            ## Maximum wall time (secs) taken up before
 
216
            ## simulation terminates writing results to disc.
 
217
            ## 
 
218
            ## This is usually disabled.
 
219
            element wall_time_limit {
 
220
               attribute replaces {"WATIME"},
 
221
               real
 
222
            }?
 
223
         },
 
224
         ## The material or phase options
 
225
         element material_phase {
 
226
            attribute name { "Fluid" },
 
227
            (
 
228
               ## Velocity vector and momentum options
 
229
               element vector_field {
 
230
                  attribute rank { "1" },
 
231
                  attribute name { "Velocity" },
 
232
                  ## Field type
 
233
                  element prescribed {
 
234
                     element mesh {
 
235
                        attribute name { "VelocityMesh" }
 
236
                     },
 
237
                     prescribed_vector_field
 
238
                  }
 
239
               }?,
 
240
               ## Passive Tracer
 
241
               element scalar_field {
 
242
                  attribute rank { "0" },
 
243
                  attribute name { "Tracer" },
 
244
                  attribute replaces { "IDENT = 666" },
 
245
                  element prognostic {
 
246
                     velocity_mesh_choice,
 
247
                     prognostic_scalar_field
 
248
                  }
 
249
               },
 
250
               ## CFLNumber
 
251
               ##
 
252
               ## See http://amcg.ese.ic.ac.uk/index.php?title=Local:Diagnostics#CFL_Number
 
253
               ##
 
254
               ## Adapting to this field is not recommended
 
255
               element scalar_field {
 
256
                  attribute rank { "0" },
 
257
                  attribute name { "CFLNumber" },
 
258
                  attribute replaces { "IDENT = -601" },
 
259
                  (
 
260
                     element diagnostic {
 
261
                        internal_algorithm,
 
262
                        velocity_mesh_choice,
 
263
                        diagnostic_scalar_field
 
264
                     }
 
265
                  )
 
266
               }?
 
267
               #scalar_field_choice*,
 
268
               #vector_field_choice*,
 
269
               #tensor_field_choice*
 
270
            )
 
271
         }
 
272
      }
 
273
   )      
 
274
 
 
275
# Choice of input method, e.g. for boundary conditions
 
276
input_choice_real =
 
277
   (
 
278
      input_choice_real_contents
 
279
   )
 
280
 
 
281
input_choice_real_plus_boundary_forcing =
 
282
   (
 
283
      input_choice_real_contents|
 
284
        element from_file {
 
285
           element tidal {
 
286
                attribute file_name { string },
 
287
                attribute variable_name_amplitude { string },
 
288
                attribute variable_name_phase { string },
 
289
                ## See E.W. Schwiderski - Rev. Geophys. Space
 
290
                ## Phys. Vol. 18 No. 1 pp. 243--268, 1980
 
291
                ## for details of these constituent.
 
292
                attribute name {"M2"|"S2"|"N2"|"K2"|"K1"|"O1"|"P1"|"Q1"|"Mf"|"Mm"|"Ssa"}
 
293
           }+
 
294
         }
 
295
   )
 
296
 
 
297
input_choice_real_plus_file =
 
298
   (
 
299
      input_choice_real_contents|
 
300
      ## Initialise the field from an existing file (indended primarily for picking up prescribed fields from previously run prognostic simulations). 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).
 
301
      ##
 
302
      ## THIS WILL NOT WORK FOR PRESCRIBED FIELDS NOT DIRECTLY UNDERNEATH /material_phase
 
303
      element from_file {
 
304
         attribute file_name { xsd:string },
 
305
         ## The format of the input file containing field data.
 
306
         element format {
 
307
            element string_value {
 
308
               "vtu"
 
309
            }
 
310
         },
 
311
         comment
 
312
      }
 
313
   )
 
314
 
 
315
input_choice_real_contents =
 
316
   ## Constant value
 
317
   element constant {
 
318
      real
 
319
   }|
 
320
   ## Python function prescribing real input. Functions should be of the form:
 
321
   ##
 
322
   ##  def val(X, t):
 
323
   ##     # Function code
 
324
   ##     return # Return value
 
325
   ##
 
326
   ## where X is a tuple of length geometry dimension.
 
327
   element python {
 
328
      python_code
 
329
   }
 
330
   
 
331
# Choice of input method for initial conditions
 
332
# Note: combine = "choice" should be used here to combine with input_choice_real, but Diamond doesn't support it
 
333
input_choice_initial_condition_real =
 
334
   (
 
335
      ## Constant value
 
336
      element constant {
 
337
         real
 
338
      }|
 
339
      ## Python function prescribing real input. Functions should be of the form:
 
340
      ##
 
341
      ##  def val(X, t):
 
342
      ##     # Function code
 
343
      ##     return # Return value
 
344
      ##
 
345
      ## where X is a tuple of length geometry dimension.
 
346
      element python {
 
347
         python_code
 
348
      }|
 
349
      ## Initialise the field from an existing file (indended
 
350
      ## primarily for use in checkpointing). The file mesh must match
 
351
      ## the mesh of this field  (except for piecewise constant fields 
 
352
      ## which will be remapped back from the discontinuous nodal values). 
 
353
      ## In parallel the process number is
 
354
      ## appended to the filename, e.g. if the file_name attribute is
 
355
      ## set to "input.vtu", process 0 reads from "input-0.vtu".
 
356
      element from_file {
 
357
         attribute file_name { xsd:string },
 
358
         ## The format of the input file containing field
 
359
         ## data. Supported formats include: NetCDF CF 1.4
 
360
         ## (http://cf-pcmdi.llnl.gov/)
 
361
         element format {
 
362
            element string_value {
 
363
               "vtu"|"NetCDF - CF 1.x"
 
364
            }
 
365
         },
 
366
         comment
 
367
      }
 
368
   )
 
369
 
 
370
# Choice of input method, e.g. for boundary conditions
 
371
input_choice_real_dim_vector =
 
372
   (
 
373
      input_choice_real_dim_vector_contents
 
374
   )
 
375
 
 
376
# Choice of input method, e.g. for prescribed fields
 
377
input_choice_real_dim_vector_plus_file =
 
378
   (
 
379
      input_choice_real_dim_vector_contents|
 
380
      ## Initialise the field from an existing file (indended primarily for picking up prescribed fields from previously run prognostic simulations). 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).
 
381
      ##
 
382
      ## THIS WILL NOT WORK FOR PRESCRIBED FIELDS NOT DIRECTLY UNDERNEATH /material_phase
 
383
      element from_file {
 
384
         attribute file_name { xsd:string },
 
385
         ## The format of the input file containing field data.
 
386
         element format {
 
387
            element string_value {
 
388
               "vtu"
 
389
            }
 
390
         },
 
391
         comment
 
392
      }
 
393
   )
 
394
 
 
395
input_choice_real_dim_vector_contents =
 
396
   ## Constant value
 
397
   element constant {
 
398
      real_dim_vector
 
399
   }|
 
400
   ## Python function prescribing dimensional vector input. Functions should be of the form:
 
401
   ##
 
402
   ##  def val(X, t):
 
403
   ##     # Function code
 
404
   ##     return # Return value
 
405
   ##
 
406
   ## where X and the return value are tuples of length geometry dimension.
 
407
   element python {
 
408
      python_code
 
409
   }
 
410
 
 
411
# Choice of input method, e.g. for boundary conditions
 
412
# this one specifies a vector field of dim minus one
 
413
input_choice_real_dim_minus_one_vector =
 
414
   (
 
415
      ## Constant value
 
416
      element constant {
 
417
         real_dim_minus_one_vector
 
418
      }|
 
419
      ## Python function prescribing dimensional vector input. Functions should be of the form:
 
420
      ##
 
421
      ##  def val(X, t):
 
422
      ##     # Function code
 
423
      ##     return # Return value
 
424
      ##
 
425
      ## where X and the return value are tuples of length geometry dimension.
 
426
      element python {
 
427
         python_code
 
428
      }
 
429
   )
 
430
 
 
431
## Import data from NetCDF CF-1.x file.
 
432
input_choice_netcdf =
 
433
   (
 
434
      element from_file {
 
435
         ## The format of this file should conform to NetCDF CF 1.x
 
436
         ## (http://cf-pcmdi.llnl.gov/)
 
437
         attribute file_name { xsd:string },
 
438
         comment
 
439
      }
 
440
   )
 
441
 
 
442
# Choice of input method for initial conditions
 
443
# Note: combine = "choice" should be used here to combine with input_choice_real, but Diamond doesn't support it
 
444
input_choice_initial_condition_vector =
 
445
   (
 
446
      ## Constant value
 
447
      element constant {
 
448
         real_dim_vector
 
449
      }|
 
450
      ## Python function prescribing dimensional vector input. Functions should be of the form:
 
451
      ##
 
452
      ##  def val(X, t):
 
453
      ##     # Function code
 
454
      ##     return # Return value
 
455
      ##
 
456
      ## where X and the return value are tuples of length geometry dimension.
 
457
      element python {
 
458
         python_code
 
459
      }|
 
460
      ## 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).
 
461
      element from_file {
 
462
         attribute file_name { xsd:string },
 
463
         ## The format of the input file containing field data.
 
464
         element format {
 
465
            element string_value {
 
466
               "vtu"
 
467
            }
 
468
         },
 
469
         comment
 
470
      }
 
471
   )  
 
472
 
 
473
# Choice of input method for initial/boundary conditions
 
474
# version for real symmetric tensor
 
475
input_choice_real_dim_symmetric_tensor =
 
476
   (
 
477
      ## Constant symmetric tensor
 
478
      element constant {
 
479
         real_dim_symmetric_tensor
 
480
      }|
 
481
      ## Python command prescribing symmetric tensor input.
 
482
      ##
 
483
      ## Note that it is for the python function to determine 
 
484
      ## that the results it produces are, in fact, symmetric.
 
485
      ##
 
486
      ## An example that returns the three-dimensional identity:
 
487
      ##
 
488
      ##  def val(X, t):
 
489
      ##    return [[1, 0, 0],
 
490
      ##                [0, 1, 0],
 
491
      ##                [0, 0, 1]]
 
492
      element python {
 
493
         python_code
 
494
      }
 
495
   )
 
496
 
 
497
# Choice of input method for initial/boundary conditions
 
498
# version for real tensor
 
499
input_choice_real_dim_tensor =
 
500
   (
 
501
      ## Constant tensor
 
502
      element constant {
 
503
         real_dim_tensor
 
504
      }|
 
505
      ## Python command prescribing tensor input.
 
506
      ##
 
507
      ## An example that returns the three-dimensional identity:
 
508
      ##
 
509
      ##  def val(X, t):
 
510
      ##    return [[1, 0, 0],
 
511
      ##                [0, 1, 0],
 
512
      ##                [0, 0, 1]]
 
513
      element python {
 
514
         python_code
 
515
      }
 
516
   )
 
517
 
 
518
prognostic_velocity_field =
 
519
   (
 
520
      velocity_equation_choice,
 
521
      ## Spatial discretisation options
 
522
      element spatial_discretisation {
 
523
         (
 
524
            ## A new version of continuous galerkin assembly.
 
525
            element continuous_galerkin {
 
526
               ## Stabilisation options for the galerkin discretisation
 
527
               element stabilisation{
 
528
                  (
 
529
                     no_stabilisation|
 
530
                     su_stabilisation|
 
531
                     supg_stabilisation
 
532
                  )
 
533
               },
 
534
               ## Discretisation options for the mass terms in the velocity equation.
 
535
               element mass_terms{
 
536
                  ## Lump the mass matrix - currently required if solving for pressure
 
537
                  element lump_mass_matrix {
 
538
                     ## Lump on the submesh.
 
539
                     ## This only works for simplex meshes and is only
 
540
                     ## strictly valid on 2d meshes.
 
541
                     element use_submesh {
 
542
                       empty
 
543
                     }?
 
544
                  }?,
 
545
                  ## Remove the mass terms from the equation.
 
546
                  element exclude_mass_terms {
 
547
                     empty
 
548
                  }?
 
549
               },
 
550
               ## Discretisation options for the advection terms in the velocity equation.
 
551
               element advection_terms {
 
552
                  ## Integrate the advection terms of the momentum equation by parts.
 
553
                  ## This allows for the imposition of weak boundary conditions.
 
554
                  ## If activated the element advection matrix takes the form:
 
555
                  ##    /                                            /
 
556
                  ##  - | (grad N_A dot nu) N_B rho dV - (1. - beta) | N_A ( div nu ) N_B rho dV
 
557
                  ##    /                                            /
 
558
                  ## otherwise it takes the standard form:
 
559
                  ##    /                                     /
 
560
                  ##    | N_A (nu dot grad N_B) rho dV + beta | N_A ( div nu ) N_B rho dV
 
561
                  ##    /                                     /
 
562
                  ## where beta is set in conservative_advection, N is
 
563
                  ## a shape function and nu is the relative nonlinear
 
564
                  ## velocity.
 
565
                  element integrate_advection_by_parts {
 
566
                     empty
 
567
                  }?,
 
568
                  ## Remove the advection terms (u.grad u rho + beta
 
569
                  ## div u rho u) from the equation.
 
570
                  ## This overrides any other advection term options
 
571
                  ## (including conservative_advection below).
 
572
                  element exclude_advection_terms {
 
573
                     empty
 
574
                  }?
 
575
               },
 
576
               ## Discretisation options for the stress terms in the velocity equation.
 
577
               element stress_terms {
 
578
                  (
 
579
                     ## Use tensor form of the stress terms.
 
580
                     ##
 
581
                     ## This is only valid for incompressible
 
582
                     ## simulations as it is basically a simplication
 
583
                     ## of full stress form when divergent elements can
 
584
                     ## be cancelled out.
 
585
                     ##
 
586
                     ## ONLY DIAGONAL COMPONENTS OF VISCOSITY CAN BE
 
587
                     ## SET (i.e. either isotropic or
 
588
                     ## anistropic_symmetric with zero off diagonals
 
589
                     ## tensors).
 
590
                     ##
 
591
                     ## If diagonal components differ from each other
 
592
                     ## this must be for numerical reasons (i.e. not
 
593
                     ## physical variations in viscosity otherwise
 
594
                     ## simplification is not valid).
 
595
                     ##
 
596
                     ## If activated, the dim x dim (in this example
 
597
                     ## 3d) stress matrix takes the form:
 
598
                     ##
 
599
                     ##  /  mu_xx*N_a,x*N_b,x + mu_yy*N_a,y*N_b,y + mu_zz*N_a,z*N_b,z
 
600
                     ##  |   0                                             ...
 
601
                     ##  \   0
 
602
                     ##
 
603
                     ##      0
 
604
                     ##  ... mu_xx*N_a,x*N_b,x + mu_yy*N_a,y*N_b,y + mu_zz*N_a,z*N_b,z   ...
 
605
                     ##      0
 
606
                     ##
 
607
                     ##      0                                                           \
 
608
                     ##  ... 0                                                           |
 
609
                     ##     mu_xx*N_a,x*N_b,x + mu_yy*N_a,y*N_b,y + mu_zz*N_a,z*N_b,z   /
 
610
                     ##
 
611
                     ## which is derived from b_a^T c b_b, where:
 
612
                     ##
 
613
                     ##  b_a = / N_a,x  \   c = /  mu_xx    0      0    \
 
614
                     ##        | N_a,y  |       |    0    mu_yy    0    |
 
615
                     ##        \ N_a,z  /       \    0      0    mu_zz  /
 
616
                     ##
 
617
                     ## where N_a and N_b are shape functions of the
 
618
                     ## ath and bth node respectively and mu are the
 
619
                     ## components of the viscosity tensor.
 
620
                    element tensor_form {
 
621
                      empty
 
622
                    }|
 
623
                     ## Use full stress form of the stress tensor.
 
624
                     ##
 
625
                     ## This is required if performing a compressible simulation.
 
626
                     ##
 
627
                     ## If using a viscosity ALL COMPONENTS OF
 
628
                     ## VISCOSITY MUST BE SET (i.e. either
 
629
                     ## anisotropic_symmetric or
 
630
                     ## anisotropic_asymmetric tensors).
 
631
                     ##
 
632
                     ## If components differ form each other this must
 
633
                     ## be for numerical reasons (i.e. not physical
 
634
                     ## variations in viscosity).
 
635
                     ##
 
636
                     ## If activated, the dim x dim (in this example
 
637
                     ## 3d) stress matrix takes the form:
 
638
                     ##
 
639
                     ##  /   2*N_a,x*N_b,x*mu_xx + N_a,y*N_b,y*mu_yy + N_a,z*N_b,z*mu_zz - 2/3*N_a,x*N_b,x*mu_xx
 
640
                     ##  |   N_a,x*N_b,y*mu_xy - 2/3*N_a,y*N_b,x*mu_yx                                             ...
 
641
                     ##  \   N_a,x*N_b,z*mu_xz - 2/3*N_a,z*N_b,x*mu_zx
 
642
                     ##
 
643
                     ##      N_a,y*N_b,x*mu_xy - 2/3*N_a,x*N_b,y*mu_xy
 
644
                     ##  ... N_a,x*N_b,x*mu_xx + 2*N_a,y*N_b,y*mu_yy + N_a,z*N_b,z*mu_zz - 2/3*N_a,y*N_b,y*mu_yy   ...
 
645
                     ##      N_a,y*N_b,z*mu_yz - 2/3*N_a,z*N_b,y*mu_zy
 
646
                     ##
 
647
                     ##      N_a,z*N_b,x*mu_xz - 2/3*N_a,x*N_b,z*mu_xz                                             \
 
648
                     ##  ... N_a,z*N_b,y*mu_yz - 2/3*N_a,y*N_b,z*mu_yz                                             |
 
649
                     ##      N_a,x*N_b,x*mu_xx + N_a,y*N_b,y*mu_yy + 2*N_a,z*N_b,z*mu_zz - 2/3*N_a,z*N_b,z*mu_zz   /
 
650
                     ##
 
651
                     ## which is derived from b_a^T c b_b, where:
 
652
                     ##
 
653
                     ##  b_a = / N_a,x   0     0   \   c = /  4/3*mu_xx  -2/3*mu_xy -2/3*mu_xz  0    0    0   \
 
654
                     ##        |  0    N_a,y   0   |       | -2/3*mu_yx   4/3*mu_yy -2/3*mu_yz  0    0    0   |
 
655
                     ##        |   0     0   N_a,z |       | -2/3*mu_zx  -2/3*mu_zy  4/3*mu_zz  0    0    0   |
 
656
                     ##        | N_a,y N_a,x   0   |       |     0           0          0     mu_xy  0    0   |
 
657
                     ##        | N_a,z   0   N_a,x |       |     0           0          0       0  mu_xz  0   |
 
658
                     ##        \   0   N_a,z N_a,y /       \     0           0          0       0    0  mu_yz /
 
659
                     ##
 
660
                     ## where N_a and N_b are shape functions of the ath and bth node respectively and mu are the components of the viscosity tensor.
 
661
                     element stress_form {
 
662
                        ## Use the legacy form of the stress tensor.
 
663
                        ##
 
664
                        ## If activated, the dim x dim (in this case
 
665
                        ## 3d) stress matrix takes the form:
 
666
                        ##
 
667
                        ##  /   2*N_a,x*N_b,x*mu_xx + N_a,y*N_b,y*mu_yy + N_a,z*N_b,z*mu_zz - 2/3*N_a,x*N_b,x*mu_xx
 
668
                        ##  |   N_a,x*N_b,y*mu_yx - 2/3*N_a,y*N_b,x*mu_yy                                             ...
 
669
                        ##  \   N_a,x*N_b,z*mu_zx - 2/3*N_a,z*N_b,x*mu_zz
 
670
                        ##
 
671
                        ##      N_a,y*N_b,x*mu_xy - 2/3*N_a,x*N_b,y*mu_xx
 
672
                        ##  ... N_a,x*N_b,x*mu_xx + 2*N_a,y*N_b,y*mu_yy + N_a,z*N_b,z*mu_zz - 2/3*N_a,y*N_b,y*mu_yy   ...
 
673
                        ##      N_a,y*N_b,z*mu_zy - 2/3*N_a,z*N_b,y*mu_zz
 
674
                        ##
 
675
                        ##      N_a,z*N_b,x*mu_xz - 2/3*N_a,x*N_b,z*mu_xx                                             \
 
676
                        ##  ... N_a,z*N_b,y*mu_yz - 2/3*N_a,y*N_b,z*mu_yy                                             |
 
677
                        ##      N_a,x*N_b,x*mu_xx + N_a,y*N_b,y*mu_yy + 2*N_a,z*N_b,z*mu_zz - 2/3*N_a,z*N_b,z*mu_zz   /
 
678
                        ##
 
679
                        ## where N_a and N_b are shape functions of
 
680
                        ## the ath and bth node respectively and mu
 
681
                        ## are the components of the viscosity tensor.
 
682
                      element legacy_stress_form {
 
683
                        empty
 
684
                      }?
 
685
                    }
 
686
                  )
 
687
               },
 
688
               element les_model {
 
689
                  ## suggested value 0.1
 
690
                  element smagorinsky_coefficient {
 
691
                     real
 
692
                  },
 
693
                  element form {
 
694
                     element tensor_form{empty}
 
695
                   |
 
696
                     element stress_form{empty}
 
697
                  },
 
698
                  element order {  
 
699
                     element second_order{empty}
 
700
                   |
 
701
                     element fourth_order{empty}
 
702
                  }
 
703
               }?
 
704
            }|
 
705
            ## Discontinuous galerkin formulation. This causes Momentum_DG to be
 
706
            ## called instead of diff3d. Confusingly it is not necessary to provide
 
707
            ## a discontinuous velocity field for this to work!
 
708
            element discontinuous_galerkin {
 
709
               attribute replaces { "DISOPT" },
 
710
               ## Discretisation options for the mass terms in the velocity equation.
 
711
               element mass_terms{
 
712
                  ## Lump the mass matrix
 
713
                  element lump_mass_matrix {
 
714
                    empty
 
715
                  }?
 
716
               }?,
 
717
               element viscosity_scheme {
 
718
                  (
 
719
                     ## Classical scheme from Bassi and Rebay 
 
720
                     ## (JCP 131 267-179 1997)
 
721
                     element bassi_rebay {
 
722
                        empty
 
723
                     }|
 
724
                     ## Scheme in which upwinding is applied in
 
725
                     ## alternating directions. Devised by C.Pain.
 
726
                     element arbitrary_upwind {
 
727
                        empty
 
728
                     }|
 
729
                     ## Classical interior penalty scheme
 
730
                     ## see, e.g., SIAM Journal on Numerical Analysis
 
731
                     ## Vol. 39, No. 5 (2002), pp. 1749-1779 
 
732
                     element interior_penalty {
 
733
                        ## Penalty_parameter
 
734
                        ## The penalty term Int [u][v] dS on element boundaries
 
735
                        ## is scaled by C = C_0 h**p
 
736
                        ## This option specifies the C_0
 
737
                        ## There is a theoretical lower bound for 
 
738
                        ## stability and hence convergence
 
739
                        element penalty_parameter {
 
740
                           real
 
741
                        },
 
742
                        ## Penalty_parameter
 
743
                        ## The penalty term Int [u][v] dS on element boundaries
 
744
                        ## is scaled by C = C_0 h**p
 
745
                        ## This option specifies p
 
746
                        ## Theoretically p=-1 is required for linear elements
 
747
                        element edge_length_power {
 
748
                           real
 
749
                        },
 
750
                        ## Switch on debugging output
 
751
                        element debug {
 
752
                           ## Bound for testing element gradient matrix
 
753
                           element gradient_test_bound {
 
754
                              real
 
755
                           },
 
756
                           ## Remove the elemental integral:
 
757
                           ## Int grad u.kappa.grad v dV
 
758
                           element remove_element_integral {
 
759
                              empty
 
760
                           }?,
 
761
                           ## Remove the primal fluxes
 
762
                           element remove_primal_fluxes {
 
763
                              empty
 
764
                           }?,
 
765
                           ## Remove the penalty fluxes
 
766
                           element remove_penalty_fluxes {
 
767
                              empty
 
768
                           }?
 
769
                        }?
 
770
                     }
 
771
                  )
 
772
               },
 
773
               element advection_scheme {
 
774
                  (
 
775
                     ## Straightforward upwinding of the nonlinear velocity.
 
776
                     element upwind {
 
777
                        empty
 
778
                     }|
 
779
                     ## Disable advection
 
780
                     element none {
 
781
                        empty
 
782
                     }
 
783
                  ),
 
784
                  ## Integrate the advection terms of the momentum equation by parts.
 
785
                  ##
 
786
                  ## Integrating the advection term by parts is
 
787
                  ## necessary for a discontinuous
 
788
                  ## galerkin discretisation however it is possible to
 
789
                  ## select how many times the
 
790
                  ## integration by parts is performed.
 
791
                  ## Twice is the norm.
 
792
                  element integrate_advection_by_parts {
 
793
                    (
 
794
                      ## If activated the element advection matrix takes the form:
 
795
                      ##    /                                 /
 
796
                      ##    | N_A (nu dot grad N_B) dV + beta | N_A ( div nu ) N_B dV
 
797
                      ##    /                                 /
 
798
                      ##      /                                         /
 
799
                      ##  + I | N_A_i (nu dot n) N_B_o ds + [(1-I) - 1] | N_A_i (nu dot n) N_B_i ds
 
800
                      ##      /                                         /
 
801
                      ## where beta is set in conservative_advection,
 
802
                      ## N is a shape function (uppercase
 
803
                      ## subscripts indicate nodes A or B while
 
804
                      ## lowercase subscripts indicate inner or outer
 
805
                      ## faces i and o respectively), nu is the
 
806
                      ## nonlinear velocity and n is the outward
 
807
                      ## pointing normal from the element.
 
808
                      element twice {
 
809
                        empty
 
810
                      }|
 
811
                      ## If activated the element advection matrix takes the form:
 
812
                      ##    /                                        /
 
813
                      ##  - | (grad N_A dot nu) N_B dV - (1. - beta) | N_A ( div nu ) N_B dV
 
814
                      ##    /                                        /
 
815
                      ##      /                                   /
 
816
                      ##  + I | N_A_i (nu dot n) N_B_o ds + (1-I) | N_A_i (nu dot n) N_B_i ds
 
817
                      ##      /                                   /
 
818
                      ## where beta is set in conservative_advection,
 
819
                      ## N is a shape function (uppercase
 
820
                      ## subscripts indicate nodes A or B while
 
821
                      ## lowercase subscripts indicate inner or outer
 
822
                      ## faces i and o respectively), nu is the
 
823
                      ## nonlinear velocity and n is the outward
 
824
                      ## pointing normal from the element.
 
825
                      element once {
 
826
                        empty
 
827
                      }
 
828
                    )
 
829
                  },
 
830
                  ## If activated the conservation term:
 
831
                  ##  /
 
832
                  ##  | N_A ( div nu ) N_B dV
 
833
                  ##  /
 
834
                  ## is integrated_by_parts such that the element
 
835
                  ## advection matrix becomes:
 
836
                  ##         /                                        /
 
837
                  ##  - beta | (grad N_A dot nu) N_B dV + (1. - beta) | N_A (nu dot grad N_B) dV
 
838
                  ##         /                                        /
 
839
                  ##      /                                                /
 
840
                  ##  + I | N_A_i (nu dot n) N_B_o ds + [(1-I) - (1-beta)] | N_A_i (nu dot n) N_B_i ds
 
841
                  ##      /                                                /                  
 
842
                  ## where beta is set in conservative_advection, N is
 
843
                  ## a shape function (uppercase
 
844
                  ## subscripts indicate nodes A or B while lowercase
 
845
                  ## subscripts indicate inner or outer
 
846
                  ## faces i and o respectively), nu is the nonlinear
 
847
                  ## velocity and n is the outward pointing normal
 
848
                  ## from the element.
 
849
                  ## This is invariant regardless of whether the main
 
850
                  ## advection term is integrated by parts once or
 
851
                  ## twice.
 
852
                  element integrate_conservation_term_by_parts {
 
853
                    empty
 
854
                  }?
 
855
               }
 
856
            }|
 
857
            ## Use the legacy finite element discretisation
 
858
            element legacy_continuous_galerkin {
 
859
               attribute replaces { "DISOPT" },
 
860
               (
 
861
                  ## balancing diffusion based on (x,y) space.
 
862
                  element balancing_diffusion_x {
 
863
                     attribute replaces { "DISOPT = 1" },
 
864
                     empty
 
865
                  }|
 
866
                  ## Laxwendrof balancing diffusion.
 
867
                  element laxwendroff_balancing_diffusion {
 
868
                     attribute replaces { "DISOPT = 2" },
 
869
                     empty
 
870
                  }|
 
871
                  ## (x,y,t) -balancing diffusion.
 
872
                  element balancing_diffusion_xt {
 
873
                     attribute replaces { "DISOPT = 3" },
 
874
                     empty
 
875
                  }|
 
876
                  ## No balancing diffusion.
 
877
                  element no_balancing_diffusion {
 
878
                     attribute replaces { "DISOPT = 4" },
 
879
                     empty
 
880
                  }|
 
881
                  ## nonlinear streamline and cross stream diffusion.
 
882
                  element nonlinear_streamline_w_crossstream_diffusion {
 
883
                     attribute replaces { "DISOPT = 5" },
 
884
                     empty
 
885
                  }|
 
886
                  ## nonlinear upwind in steapest direction.
 
887
                  element nonlinear_upwind_steepest {
 
888
                     attribute replaces { "DISOPT = 6" },
 
889
                     empty
 
890
                  }|
 
891
                  ## nonlinear streamline+ cross stream diffusion(but restricted)
 
892
                  element nonlinear_streamline_w_restricted_crossstream_diffusion {
 
893
                     attribute replaces { "DISOPT = 7" },
 
894
                     empty
 
895
                  }|
 
896
                  ## LES option using constant length scale.
 
897
                  element les_constant_length_scale {
 
898
                     attribute replaces { "DISOPT = 42" },
 
899
                     empty
 
900
                  }|
 
901
                  ## LES option using isotropic length scale.
 
902
                  element les_isotropic_length_scale {
 
903
                     attribute replaces { "DISOPT = 43" },
 
904
                     empty
 
905
                  }|
 
906
                  ## LES option which uses no balancing diffusion.
 
907
                  element les_no_balancing_diffusion {
 
908
                     attribute replaces { "DISOPT = 44" },
 
909
                     empty
 
910
                  }|
 
911
                  ## LES option which uses no balancing diffusion.
 
912
                  element les_no_balancing_diffusion_2 {
 
913
                     attribute replaces { "DISOPT = 45" },
 
914
                     empty
 
915
                  }|
 
916
                  ## same as 45 but with 4th order dissipation.
 
917
                  element les_no_balancing_diffusion_fourth_order_dissipation {
 
918
                     attribute replaces { "DISOPT = 46" },
 
919
                     empty
 
920
                  }|
 
921
                  ## LES but in tensor form like hart3d
 
922
                  element les_tensor_form {
 
923
                     attribute replaces { "DISOPT = 47" },
 
924
                     empty
 
925
                  }|
 
926
                  ## LES 4th order version of 47
 
927
                  element les_fourth_order {
 
928
                     attribute replaces { "DISOPT = 48" },
 
929
                     empty
 
930
                  }|
 
931
                  ## NO balancing diffusion(DISOPT=4)and take out non-linear terms.
 
932
                  element no_balancing_diffusion_remove_nonlinear_terms {
 
933
                     attribute replaces { "DISOPT = 125" },
 
934
                     empty
 
935
                  }
 
936
               ),
 
937
               ## Lump the mass matrix in the momentum equation
 
938
               element lump_mass_matrix {
 
939
                  attribute replaces {"MLUMP"},
 
940
                  empty
 
941
               }?
 
942
            }|
 
943
            element legacy_discretisation {
 
944
               ## Legacy discretisation option (DISOPT)
 
945
               ##
 
946
               ##  From diff3d comments (other possibilities are known to exist!):
 
947
               ##  ==============================================================
 
948
               ##  DISOPT=1 - balancing diffusion based on (x,y) space.
 
949
               ##  DISOPT=2 - Laxwendrof balancing diffusion.
 
950
               ##  DISOPT=3 - (x,y,t) -balancing diffusion.
 
951
               ##  DISOPT=4 - No balancing diffusion.
 
952
               ##  DISOPT=5 - nonlinear streamline and cross stream diffusion.
 
953
               ##  DISOPT=6 - nonlinear upwind in steapest direction.
 
954
               ##  DISOPT=7 - nonlinear streamline+ cross stream diffusion(but restricted)
 
955
               ##  
 
956
               ##  DISOPT=42- LES option using constant length scale.
 
957
               ##  DISOPT=43- LES option using isotropic length scale.
 
958
               ##  DISOPT=44- LES option which uses no balancing diffusion.
 
959
               ##  DISOPT=45- LES option which uses no balancing diffusion.
 
960
               ##  DISOPT=46- same as 45 but with 4th order dissipation.
 
961
               ##  DISOPT=47 -LES but in tensor form like hart3d.
 
962
               ##  DISOPT=48 -LES 4th order version of 47.
 
963
               ##  
 
964
               ##  DISOPT=125 - NO balancing diffusion(DISOPT=4)and take out non-linear terms.
 
965
               element legacy_disopt {
 
966
                  attribute replaces {"DISOPT"},
 
967
                  integer
 
968
               },
 
969
               ## Lump the mass matrix in the momentum equation
 
970
               element legacy_mlump {
 
971
                  attribute replaces {"MLUMP"},
 
972
                  empty
 
973
               }?,
 
974
               ## Legacy discretisation option for control volume advection of momentum (DISOPT)
 
975
               ## Set to 0 if not activated
 
976
               ##            Method for face-value est.   Time-stepping     Limiting
 
977
               ##  ------------------------------------------------------------------
 
978
               ##    =0      1st order in space          Theta=specified    UNIVERSAL
 
979
               ##    =1      1st order in space          Theta=non-linear   UNIVERSAL
 
980
               ##    =2      Trapazoidal rule in space   Theta=specified    UNIVERSAL
 
981
               ##    =3      Trapazoidal rule in space   Theta=non-linear   UNIVERSAL
 
982
               ##    =4      Finite elements in space    Theta=specified    UNIVERSAL
 
983
               ##    =5      Finite elements in space    Theta=non-linear   UNIVERSAL
 
984
               ##    =6      Finite elements in space    Theta=specified    NONE
 
985
               ##    =7      Finite elements in space    Theta=non-linear   NONE
 
986
               ##    =8      Finite elements in space    Theta=specified    DOWNWIND+
 
987
               ##    =9      Finite elements in space    Theta=non-linear   DOWNWIND+
 
988
               element legacy_ndisop {
 
989
                  attribute replaces {"NDISOP"},
 
990
                  integer
 
991
               }?
 
992
            }
 
993
         ),
 
994
         ## Conservative discretisation of momentum equations
 
995
         ##  BETA=1. -- conservative (divergence form)
 
996
         ##  BETA=0. -- non-conservative
 
997
         ##  0. < BETA < 1.
 
998
         element conservative_advection {
 
999
            attribute replaces {"BETA"},
 
1000
            real
 
1001
         },
 
1002
         inner_element_velocity?
 
1003
      },
 
1004
      ## Temporal discretisation options
 
1005
      element temporal_discretisation {
 
1006
         ## Implicit/explicit control (THETA)
 
1007
         ##  =0.  -- explicit
 
1008
         ##  =0.5 -- Crank-Nicolson
 
1009
         ##  =1.  -- implicit
 
1010
         element theta {
 
1011
            attribute replaces {"THETA"},
 
1012
            real
 
1013
         },
 
1014
         ## Non-linear relaxation term
 
1015
         ##  =0.  -- previous timestep velocity solution used in non-linear terms of momentum equations
 
1016
         ##  =1.  -- previous iteration velocity solution used in non-linear terms of momentum equations
 
1017
         ##  0. < ITHETA < 1.
 
1018
         element relaxation {
 
1019
            attribute replaces {"ITHETA"},
 
1020
            real
 
1021
         },
 
1022
         element discontinuous_galerkin {
 
1023
            (
 
1024
               ## Use timestep subcycling to solve this equation.
 
1025
               ## Specify the number of subcycles.
 
1026
               ## This only works for pure control volume discretisations.
 
1027
               element number_advection_subcycles {
 
1028
                  integer
 
1029
               }
 
1030
            )?
 
1031
         }?
 
1032
      },
 
1033
      ## Solver
 
1034
      element solver {
 
1035
         linear_solver_options_asym
 
1036
      },
 
1037
      constitutive_laws,
 
1038
      (
 
1039
         ## Initial condition for WholeMesh
 
1040
         ##
 
1041
         ## Only specify one condition if not using mesh regions.
 
1042
         ## Otherwise select other initial_condition option, specify region_ids
 
1043
         ## and distinct names.  Then add extra intial conditions for other regions.
 
1044
         element initial_condition {
 
1045
            attribute name { "WholeMesh" },
 
1046
            input_choice_initial_condition_vector
 
1047
         }|
 
1048
         ## Multiple initial_conditions are allowed if specifying
 
1049
         ## different values in different
 
1050
         ## regions of the mesh (defined by region_ids).  In this case
 
1051
         ## each initial_condition
 
1052
         ## requires a distinct name for the options dictionary.
 
1053
         element initial_condition {
 
1054
            attribute name { string },
 
1055
            region_ids,
 
1056
            input_choice_initial_condition_vector
 
1057
         }
 
1058
      )+,
 
1059
      ## Boundary conditions
 
1060
      element boundary_conditions {
 
1061
         attribute replaces { "boundary, TMPER1 TMPER2 TMPERI" },
 
1062
         attribute name { string },
 
1063
         ## Surface id:
 
1064
         element surface_ids {
 
1065
            integer_vector
 
1066
         },
 
1067
         velocity_boundary_conditions
 
1068
      }*,
 
1069
      ## For a Newtonian fluid this is the shear viscosity.
 
1070
      ##
 
1071
      ## For continuous_galerkin see stress_terms to see how the
 
1072
      ## viscosity tensor is dealt with in the momentum equation.
 
1073
      element tensor_field {
 
1074
         attribute replaces {"MUPTXX MUPTYY MUPTZZ MUPTYZ MUPTXZ MUPTXY RMUPXX RMUPYY RMUPZZ RMUPYZ RMUPXZ RMUPXY CONMU ALLMU TWOMU ONEMU"},
 
1075
         attribute name { "Viscosity" },
 
1076
         attribute rank { "2" },
 
1077
         (
 
1078
            element prescribed {
 
1079
               prescribed_values_tensor_field
 
1080
            }|
 
1081
            element diagnostic {
 
1082
               internal_algorithm,
 
1083
               diagnostic_tensor_field
 
1084
            }
 
1085
         )
 
1086
      }?,
 
1087
      ## Source
 
1088
      element vector_field {
 
1089
         attribute name { "Source" },
 
1090
         attribute rank { "1" },
 
1091
         attribute replaces { "CONSOX CONSOY CONSOZ RONSOX RONSOY RONSOZ ZSOX ZSOY ZSOZ" },
 
1092
         (
 
1093
            element prescribed {
 
1094
               mesh_choice?,
 
1095
               prescribed_vector_field_no_adapt
 
1096
            }|
 
1097
            element diagnostic {
 
1098
               internal_algorithm,
 
1099
               diagnostic_vector_field
 
1100
            }
 
1101
         ),
 
1102
         element lump_source {
 
1103
            attribute replaces { "SLUMP" },
 
1104
            empty
 
1105
         }?
 
1106
      }?,
 
1107
      ## Absorption
 
1108
      element vector_field {
 
1109
         attribute name { "Absorption" },
 
1110
         attribute rank { "1" },
 
1111
         attribute replaces { "XABSZE YABSZE ZABSZE XABS YABS ZABS XABSOR YABSOR ZABSOR XABSCO YABSCO ZABSCO" },
 
1112
         (
 
1113
            element prescribed {
 
1114
               prescribed_vector_field_no_adapt
 
1115
            }|
 
1116
            element diagnostic { 
 
1117
               internal_algorithm,
 
1118
               diagnostic_vector_field
 
1119
            }
 
1120
         ),
 
1121
         (
 
1122
           ## Default absorption: no lumping, is fully evaluated before the
 
1123
           ## the pressure correction.
 
1124
           element default_absorption {
 
1125
              attribute replaces {"ABSLUM"},
 
1126
              empty
 
1127
           }|
 
1128
           ## Lump the inclusion of absorbtion terms.
 
1129
           element lump_absorption {
 
1130
              attribute replaces {"ABSLUM"},
 
1131
              empty
 
1132
           }|
 
1133
           ## Includes the pressure correction to the velocity in the
 
1134
           ## absorption term (for theta>0). This makes the absorption
 
1135
           ## term more implicit. The absorption term is lumped if and
 
1136
           ## only if the mass matrix is lumped (lump_mass_matrix).
 
1137
           element include_pressure_correction {
 
1138
              empty
 
1139
           }
 
1140
         )
 
1141
      }?,
 
1142
      ## Elastic parameters for elastic and visco-elastic materials
 
1143
      ## For a linearly elastic solid
 
1144
      ## In legacy elastic solids were run with SOLIDS = 2 from solidity_options.inp.
 
1145
      ## In gem ONEMU and CONMU = .TRUE.
 
1146
      ## and RMUPZZ taken as the isotropic Young`s modulus
 
1147
      ## UNDER DEVELOPMENT
 
1148
      ##  - currently only works for lagrangian meshes
 
1149
      ##  - only single materials tested so far
 
1150
      ##  - momentum equations assembled in solid3d so not all
 
1151
      ##    discretisation options above are valid
 
1152
      element tensor_field {
 
1153
         attribute replaces { "SOLIDS = 1 from solidity_options.inp" },
 
1154
         attribute name { "Elasticity" },
 
1155
         attribute rank { "2" },
 
1156
         (
 
1157
            element prescribed {
 
1158
               prescribed_values_tensor_field
 
1159
            }|
 
1160
            element diagnostic {
 
1161
               internal_algorithm,
 
1162
               diagnostic_tensor_field
 
1163
            }
 
1164
         )
 
1165
      }?,
 
1166
      ## SurfaceTension
 
1167
      element tensor_field {
 
1168
         attribute name { "SurfaceTension" },
 
1169
         attribute rank { "2" },
 
1170
         (
 
1171
            element diagnostic {
 
1172
                internal_algorithm,
 
1173
                attribute field_name { "MaterialVolumeFraction" },
 
1174
                ## Choose whether the mass matrix is lumped or not for the calculation of the gradient
 
1175
                element lump_mass_matrix {
 
1176
                  empty
 
1177
                }?,
 
1178
                ## Solver options are necessary if you're not lumping your mass or if you're field isn't dg
 
1179
                element solver {
 
1180
                  linear_solver_options_sym
 
1181
                }?,
 
1182
                ## Choose whether the surface tension term in the momentum equation is integrated by parts or not
 
1183
                element integrate_by_parts {
 
1184
                  empty
 
1185
                }?,
 
1186
                diagnostic_tensor_field
 
1187
            }
 
1188
         )
 
1189
      }?,
 
1190
      ## Cohesion for plastic materials
 
1191
      ## UNDER DEVELOPMENT
 
1192
      ##  - currently only works for lagrangian meshes
 
1193
      ##  - only single materials tested so far
 
1194
      ##  - momentum equations assembled in solid3d so not all
 
1195
      ##    discretisation options above are valid
 
1196
      element scalar_field {
 
1197
         attribute name { "Cohesion" },
 
1198
         attribute rank { "0" },
 
1199
         attribute replaces { "COHESI from solidity_options.inp" },
 
1200
         (
 
1201
            element prescribed {
 
1202
               prescribed_scalar_field_no_adapt
 
1203
            }|
 
1204
            element diagnostic {
 
1205
               internal_algorithm,
 
1206
               diagnostic_scalar_field
 
1207
            }
 
1208
         )
 
1209
      }?,
 
1210
      ## Friction Angle for plastic materials
 
1211
      ## UNDER DEVELOPMENT
 
1212
      ##  - currently only works for lagrangian meshes
 
1213
      ##  - only single materials tested so far
 
1214
      ##  - momentum equations assembled in solid3d so not all
 
1215
      ##    discretisation options above are valid
 
1216
      element scalar_field {
 
1217
         attribute name { "FrictionAngle" },
 
1218
         attribute rank { "0" },
 
1219
         attribute replaces { "FRCANG from solidity_options.inp" },
 
1220
         (
 
1221
            element prescribed {
 
1222
               prescribed_scalar_field_no_adapt
 
1223
            }|
 
1224
            element diagnostic {
 
1225
               internal_algorithm,
 
1226
               diagnostic_scalar_field
 
1227
            }
 
1228
         )
 
1229
      }?,
 
1230
      prognostic_vector_output_options,
 
1231
      prognostic_vector_stat_options,
 
1232
      vector_convergence_options,
 
1233
      prognostic_detector_options,
 
1234
      vector_steady_state_options,
 
1235
      adaptivity_options_prognostic_vector_field,
 
1236
      interpolation_algorithm_vector,
 
1237
      discrete_properties_algorithm_vector?
 
1238
   )
 
1239
 
 
1240
prognostic_scalar_field =
 
1241
   (
 
1242
      ## Solver
 
1243
      element solver {
 
1244
         linear_solver_options_sym
 
1245
      },
 
1246
      (
 
1247
         ## Initial condition for WholeMesh
 
1248
         ##
 
1249
         ## Only specify one condition if not using mesh regions.
 
1250
         ## Otherwise select other initial_condition option, specify region_ids
 
1251
         ## and distinct names.  Then add extra intial conditions for other regions.
 
1252
         element initial_condition {
 
1253
            attribute name { "WholeMesh" },
 
1254
            input_choice_initial_condition_real
 
1255
         }|
 
1256
         ## Multiple initial_conditions are allowed if specifying
 
1257
         ## different values in different
 
1258
         ## regions of the mesh (defined by region_ids).  In this case
 
1259
         ## each initial_condition
 
1260
         ## requires a distinct name for the options dictionary.
 
1261
         element initial_condition {
 
1262
            attribute name { string },
 
1263
            region_ids,
 
1264
            input_choice_initial_condition_real
 
1265
         }
 
1266
      ),
 
1267
      ## Diffusivity for field
 
1268
      element tensor_field {
 
1269
         attribute name { "Diffusivity" },
 
1270
         attribute rank { "2" },
 
1271
         attribute replaces { "TMUXX TMUYY TMUZZ TMUYZ TMUXZ TMUXY TALLMU TCONMU" },
 
1272
         element prescribed {
 
1273
            mesh_choice?,
 
1274
            prescribed_values_tensor_field
 
1275
         }
 
1276
      }?,
 
1277
      prognostic_scalar_output_options,
 
1278
      prognostic_scalar_stat_options
 
1279
   )
 
1280
 
 
1281
# Default child of diagnostic scalar field
 
1282
diagnostic_scalar_field =
 
1283
   (
 
1284
      diagnostic_output_options,
 
1285
      diagnostic_scalar_stat_options,
 
1286
      scalar_convergence_options,
 
1287
      diagnostic_detector_options,
 
1288
      scalar_steady_state_options,
 
1289
      adaptivity_options_scalar_field,
 
1290
      recalculation_options?
 
1291
   )
 
1292
   
 
1293
# Default child of diagnostic scalar field without adaptivity options
 
1294
diagnostic_scalar_field_no_adapt =
 
1295
   (
 
1296
      diagnostic_output_options,
 
1297
      diagnostic_scalar_stat_options,
 
1298
      diagnostic_detector_options
 
1299
   )
 
1300
 
 
1301
# Default child of diagnostic scalar field
 
1302
diagnostic_scalar_field_tidal_range =
 
1303
   (
 
1304
      diagnostic_output_options,
 
1305
      diagnostic_scalar_stat_options,
 
1306
      diagnostic_detector_options,
 
1307
      adaptivity_options_scalar_field,
 
1308
      (
 
1309
          element spin_up_time {
 
1310
             real
 
1311
          }
 
1312
      )       
 
1313
   )
 
1314
 
 
1315
# Default child of prescribed scalar field
 
1316
# This is a choice of ways of inputing the prescribed field
 
1317
prescribed_scalar_field =
 
1318
   (
 
1319
      prescribed_scalar_field_no_adapt,
 
1320
      adaptivity_options_scalar_field,
 
1321
      interpolation_algorithm_scalar?,
 
1322
      discrete_properties_algorithm_scalar?,
 
1323
      recalculation_options?
 
1324
   )
 
1325
 
 
1326
# Default child of prescribed scalar field without adaptivity options
 
1327
# This is a choice of ways of inputing the prescribed field
 
1328
prescribed_scalar_field_no_adapt =
 
1329
   (
 
1330
      prescribed_values_scalar_field,
 
1331
      prescribed_output_options,
 
1332
      prescribed_scalar_stat_options,
 
1333
      prescribed_detector_options
 
1334
   )
 
1335
   
 
1336
prescribed_values_scalar_field =
 
1337
   (
 
1338
      (
 
1339
         ## Value for WholeMesh
 
1340
         ## Only specify one value if not using mesh regions.
 
1341
         ## Otherwise select other value option, specify region_ids
 
1342
         ## and distinct names.  Then add extra values for other regions.
 
1343
         element value {
 
1344
            attribute name { "WholeMesh" },
 
1345
            input_choice_real_plus_file
 
1346
         }|
 
1347
         ## Multiple values are now allowed if using different value assignments
 
1348
         ## in different regions of the mesh (specified by region_ids).
 
1349
         ## In this case each value requires a distinct name for the options dictionary.
 
1350
         element value {
 
1351
            attribute name { string },
 
1352
            region_ids,
 
1353
            input_choice_real_plus_file
 
1354
         }
 
1355
      )+
 
1356
   )
 
1357
 
 
1358
# Default child of diagnostic vector field
 
1359
# Currently, this is empty, but in future this might include
 
1360
# options that are general to all diagnostic vector fields
 
1361
diagnostic_vector_field =
 
1362
   (
 
1363
      diagnostic_output_options,
 
1364
      diagnostic_vector_stat_options,
 
1365
      vector_convergence_options,      
 
1366
      diagnostic_detector_options,
 
1367
      vector_steady_state_options,      
 
1368
      adaptivity_options_vector_field,
 
1369
      recalculation_options?
 
1370
   )
 
1371
 
 
1372
 
 
1373
diagnostic_vector_field_bed_shear_stress =
 
1374
   (
 
1375
      (
 
1376
          element density {
 
1377
             real
 
1378
          }
 
1379
      ),       
 
1380
      (
 
1381
          element drag_coefficient {
 
1382
             real
 
1383
          }
 
1384
      ),   
 
1385
      diagnostic_output_options,
 
1386
      diagnostic_vector_stat_options,
 
1387
      diagnostic_detector_options,
 
1388
      adaptivity_options_vector_field
 
1389
   )
 
1390
 
 
1391
 
 
1392
 
 
1393
# Default child of prescribed vector field
 
1394
# This is a choice of ways of inputing the prescribed field
 
1395
prescribed_vector_field =
 
1396
   (
 
1397
      prescribed_vector_field_no_adapt,
 
1398
      adaptivity_options_vector_field,
 
1399
      interpolation_algorithm_vector?,
 
1400
      discrete_properties_algorithm_vector?,
 
1401
      recalculation_options?
 
1402
   )
 
1403
   
 
1404
# Default child of prescribed vector field without adaptivity options
 
1405
# This is a choice of ways of inputing the prescribed field
 
1406
prescribed_vector_field_no_adapt =
 
1407
   (
 
1408
      prescribed_values_vector_field,
 
1409
      prescribed_output_options,
 
1410
      prescribed_vector_stat_options,
 
1411
      prescribed_detector_options
 
1412
   )
 
1413
 
 
1414
prescribed_values_vector_field =
 
1415
   (
 
1416
      (
 
1417
         ## Value for WholeMesh
 
1418
         ##
 
1419
         ## Only specify one value if not using mesh regions.
 
1420
         ## Otherwise select other value option, specify region_ids
 
1421
         ## and distinct names.  Then add extra values for other regions.
 
1422
         element value {
 
1423
            attribute name { "WholeMesh" },
 
1424
            input_choice_real_dim_vector_plus_file
 
1425
         }|
 
1426
         ## Multiple values are now allowed if using different value assignments
 
1427
         ## in different regions of the mesh (specified by region_ids).
 
1428
         ## In this case each value requires a distinct name for the options dictionary.
 
1429
         element value {
 
1430
            attribute name { string },
 
1431
            region_ids,
 
1432
            input_choice_real_dim_vector_plus_file
 
1433
         }
 
1434
      )+
 
1435
   )
 
1436
 
 
1437
# Default child of diagnostic tensor field
 
1438
# Currently, this is empty, but in future this might include
 
1439
# options that are general to all diagnostic tensor fields
 
1440
diagnostic_tensor_field =
 
1441
   (
 
1442
      diagnostic_output_options,
 
1443
      adaptivity_options_tensor_field
 
1444
   )
 
1445
 
 
1446
# Default child of prescribed vector field
 
1447
# This is a choice of ways of inputing the prescribed tensor field
 
1448
# If the field is constant then a symmetric, or asymmetric tensor may be entered
 
1449
prescribed_tensor_field =
 
1450
   (
 
1451
      prescribed_values_tensor_field,
 
1452
      adaptivity_options_tensor_field
 
1453
   )
 
1454
 
 
1455
prescribed_values_tensor_field =
 
1456
   (
 
1457
      (
 
1458
         ## Value for WholeMesh
 
1459
         ##
 
1460
         ## Only specify one value if not using mesh regions.
 
1461
         ## Otherwise select other value option, specify region_ids
 
1462
         ## and distinct names.  Then add extra values for other regions.
 
1463
         element value {
 
1464
            attribute name { "WholeMesh" },
 
1465
            input_choice_tensor_field
 
1466
         }|
 
1467
         ## Multiple values are now allowed if using different value assignments
 
1468
         ## in different regions of the mesh (specified by region_ids).
 
1469
         ## In this case each value requires a distinct name for the options dictionary.
 
1470
         element value {
 
1471
            attribute name { string },
 
1472
            region_ids,
 
1473
            input_choice_tensor_field
 
1474
         }
 
1475
      )+
 
1476
   )
 
1477
 
 
1478
prognostic_pressure_field =
 
1479
   (
 
1480
      element spatial_discretisation {
 
1481
         (
 
1482
            element continuous_galerkin {
 
1483
               ## remove the  fourth order pressure stabilisation term KCMC
 
1484
               ## must be removed for multimaterial and free surface calculations
 
1485
               element remove_stabilisation_term {
 
1486
                  attribute replaces { "NOFILT" }
 
1487
               }?,
 
1488
               ## Integrate the continuity equation by parts.
 
1489
               ##
 
1490
               ## This allows for the imposition of weak velocity boundary conditions with continuous_galerkin.
 
1491
               ## If activated this means that the pressure gradient operator is not integrated by parts.
 
1492
               element integrate_continuity_by_parts {
 
1493
                  attribute replaces { "PREOPT" },
 
1494
                  empty
 
1495
               }?
 
1496
            }|
 
1497
            element control_volumes {
 
1498
               attribute replaces { "NCOLOP = X1XXXXX -> INTERF, NOFILT" }
 
1499
            }
 
1500
         )
 
1501
      },
 
1502
      ## Reference node (Node at which pressure = 0.)
 
1503
      ##
 
1504
      ## Must be less than the total number of nodes.
 
1505
      ## If parallel must be less than the total number of nodes of the first processor.
 
1506
      ##
 
1507
      ## Note - it is also an option to remove the null-space of the residual vector. This
 
1508
      ## option is available under solvers.
 
1509
      element reference_node {
 
1510
         attribute replaces { "NDPSET" },
 
1511
         integer
 
1512
      }?,
 
1513
      ## **UNDER DEVELOPMENT**
 
1514
      ## This searches the CMC matrix diagonal looking for nodes that are less than the maximum value time epsilon(0.0) (i.e. nodes that are effectively zero).
 
1515
      ## It then zeros that row and column and places a one on the diagonal and a zero on the rhs.
 
1516
      ## At a debug level of 2 it also prints out the value and the sum of the row values.
 
1517
      ## This is useful as a debugging tool if PETSc complains about zeros on the diagonal (i.e. if you have a stiff node in your mesh) but doesn't necessary produce nice answers at the end.
 
1518
      element repair_stiff_nodes {
 
1519
         empty
 
1520
      }?,
 
1521
      ## Atmospheric pressure
 
1522
      ##
 
1523
      ## Manual suggests 1.01325E+6
 
1524
      element atmospheric_pressure {
 
1525
         attribute replaces {"PATMOS"},
 
1526
         real
 
1527
      }?,
 
1528
      ## scheme
 
1529
      element scheme {
 
1530
         ## Use a poisson pressure equation to calculate a first guess at pressure.
 
1531
         ## This does not necessarily satisfy continuity.
 
1532
         ##   = 1 -- use a poisson guess at every timestep
 
1533
         ##   = 0 -- never use a poisson guess
 
1534
         ##   =-1 -- use a poisson guess at the first timestep only
 
1535
         ## Manual suggests -1
 
1536
         element poisson_pressure_solution {
 
1537
            attribute replaces {"POISON"},
 
1538
            (
 
1539
               element string_value{
 
1540
                  # Lines is a hint to the gui about the size of the text box.
 
1541
                  # It is not an enforced limit on string length.
 
1542
                  attribute lines { "1" },
 
1543
                  ( "never" | "every timestep" | "only first timestep")
 
1544
               },
 
1545
               comment
 
1546
            )
 
1547
         },
 
1548
         (
 
1549
            ## Use the incompressible projection method to determine
 
1550
            ## the pressure and satisfy continuity
 
1551
            element use_projection_method {
 
1552
               attribute replaces {"PROJEC"},
 
1553
               ## Assemble and use the full schur complement.
 
1554
               ## This allows you to not lump the mass matrix if you're using
 
1555
               ## cg and to use the full momentum matrix in the projection if
 
1556
               ## you so desire.
 
1557
               element full_schur_complement {
 
1558
                 ( 
 
1559
                   ## Specify the inner matrix (IM) to form the projection schur complement (C^T*IM^{-1}*C). 
 
1560
                   ## Use the full mass matrix.
 
1561
                   ##
 
1562
                   ## Make sure you've not lumped your mass in the velocity spatial_discretisation if you want to be consistent!
 
1563
                   element inner_matrix {
 
1564
                     attribute name { "FullMassMatrix" },
 
1565
                     element solver {
 
1566
                       linear_solver_options_sym
 
1567
                     }
 
1568
                   }|
 
1569
                   ## Specify the inner matrix (IM) to form the projection schur complement (C^T*IM^{-1}*C). 
 
1570
                   ## Use the full momentum matrix.
 
1571
                   ##
 
1572
                   ## Doesn't really matter if you've lumped your mass or not but why would you if you're doing a full inner solve anyway?
 
1573
                   element inner_matrix {
 
1574
                     attribute name { "FullMomentumMatrix" },
 
1575
                     element solver {
 
1576
                       linear_solver_options_asym
 
1577
                     }
 
1578
                   }
 
1579
                 ),
 
1580
                 (
 
1581
                   ## Specify the preconditioner matrix to use on the schur complement.
 
1582
                   ##
 
1583
                   ## For DG, the LumpedSchurComplement is our best approximation to CMC.
 
1584
                   element preconditioner_matrix {
 
1585
                     attribute name { "LumpedSchurComplement" },
 
1586
                     element lump_on_submesh {
 
1587
                       empty
 
1588
                     }?
 
1589
                   }|
 
1590
                   ## Specify the preconditioner matrix to use on the schur complement.
 
1591
                   ##
 
1592
                   ## DiagonalSchurComplement = C_P^T * [(Big_m)_diagonal]^-1 * C
 
1593
                   element preconditioner_matrix {
 
1594
                     attribute name { "DiagonalSchurComplement" },
 
1595
                     empty
 
1596
                   }|
 
1597
                   ## Specify the preconditioner matrix to use on the schur complement.
 
1598
                   element preconditioner_matrix {
 
1599
                     attribute name { "NoPreconditionerMatrix" },
 
1600
                     empty
 
1601
                   }
 
1602
                 )
 
1603
               }?
 
1604
            }|
 
1605
            ## Use the compressible projection method to determine the
 
1606
            ## pressure and satisfy continuity and the eos.
 
1607
            ## This is only currently compatible with control volume
 
1608
            ## pressure spatial discretisations and requires a
 
1609
            ## multimaterial eos.
 
1610
            element use_compressible_projection_method {
 
1611
               attribute replaces {"MKCOMP from solidity_options.inp"},
 
1612
               (
 
1613
                  ## Variable (normally a density) used to normalise
 
1614
                  ## each materials contribution
 
1615
                  ## to the C_P^T matrix.  Leave unselected for no normalisation.
 
1616
                  ## Selects the MaterialDensity field.
 
1617
                  element normalisation {
 
1618
                     attribute name{ "MaterialDensity" },
 
1619
                     empty
 
1620
                  }|
 
1621
                  ## Variable (normally a density) used to normalise
 
1622
                  ## each materials contribution
 
1623
                  ## to the C_P^T matrix.  Leave unselected for no normalisation.
 
1624
                  ## Selects the bulk Density field.
 
1625
                  element normalisation {
 
1626
                     attribute name{ "Density" },
 
1627
                     empty
 
1628
                  }|
 
1629
                  ## Variable (normally a density) used to normalise
 
1630
                  ## each materials contribution
 
1631
                  ## to the C_P^T matrix.  Leave unselected for no normalisation.
 
1632
                  ## Allows the selection of an arbitrary field.
 
1633
                  element normalisation {
 
1634
                     attribute name{ string },
 
1635
                     empty
 
1636
                  }
 
1637
               )?
 
1638
 
 
1639
            }
 
1640
         ),
 
1641
         ## rediscretise the equations at every timestep and iteration
 
1642
         ## (for instance if using a compressible formulation
 
1643
         ## or if density varies a lot or if not using a Boussinesque approximation)
 
1644
         element update_discretised_equation {
 
1645
            attribute replaces {"CMCHAN"},
 
1646
            empty
 
1647
         }?
 
1648
      },
 
1649
      ## Solver
 
1650
      element solver {
 
1651
         linear_solver_options_sym
 
1652
      },
 
1653
      (
 
1654
         ## Initial condition for WholeMesh
 
1655
         ##
 
1656
         ## Only specify one condition if not using mesh regions.
 
1657
         ## Otherwise select other initial_condition option, specify region_ids
 
1658
         ## and distinct names.  Then add extra intial conditions for other regions.
 
1659
         element initial_condition {
 
1660
            attribute name { "WholeMesh" },
 
1661
            input_choice_initial_condition_real
 
1662
         }|
 
1663
         ## Multiple initial_conditions are allowed if specifying
 
1664
         ## different values in different
 
1665
         ## regions of the mesh (defined by region_ids).  In this case
 
1666
         ## each initial_condition
 
1667
         ## requires a distinct name for the options dictionary.
 
1668
         element initial_condition {
 
1669
            attribute name { string },
 
1670
            region_ids,
 
1671
            input_choice_initial_condition_real
 
1672
         }
 
1673
      )*,
 
1674
      element boundary_conditions {
 
1675
         attribute name { string },
 
1676
         ## Surface id:
 
1677
         element surface_ids {
 
1678
            integer_vector
 
1679
         },
 
1680
         ## Type
 
1681
         element type {
 
1682
            attribute name { "dirichlet" },
 
1683
            ## Apply the dirichlet bc weakly.  Available
 
1684
            ## automatically with discontinuous_galerkin,
 
1685
            ## control_volume, and legacy_mixed_cv_cg
 
1686
            ## spatial_discretisations.
 
1687
            ## If not selected boundary conditions are applied strongly.
 
1688
            element apply_weakly {
 
1689
              ## If the initial condition and boundary conditions
 
1690
              ## differ, setting this option will cause the initial
 
1691
              ## condition on the boundary to be overwritten with
 
1692
              ## the boundary condition. Since you are applying the
 
1693
              ## boundary condition weakly, you probably do *not*
 
1694
              ## want this.
 
1695
              element boundary_overwrites_initial_condition {
 
1696
                 empty
 
1697
              }?
 
1698
            }?,
 
1699
            input_choice_real_plus_boundary_forcing
 
1700
         }
 
1701
      }*,
 
1702
      pressure_output_options,
 
1703
      prognostic_scalar_stat_options,
 
1704
      scalar_convergence_options,
 
1705
      detector_options_disabled_default,
 
1706
      scalar_steady_state_options,
 
1707
      adaptivity_options_prognostic_scalar_field,
 
1708
      interpolation_algorithm_scalar_full,
 
1709
      discrete_properties_algorithm_scalar?
 
1710
   )
 
1711
 
 
1712
prognostic_geostrophic_pressure_field =
 
1713
   (
 
1714
      element spatial_discretisation {
 
1715
         ## Select whether on not to include the buoyancy term "g" in the RHS:
 
1716
         ##
 
1717
         ##   f = - grad p_gp + g
 
1718
         element geostrophic_pressure_option {
 
1719
            attribute replaces { "GEOBAL" },
 
1720
            element string_value {
 
1721
               "include_buoyancy" | "exclude_buoyancy"
 
1722
            }
 
1723
         }
 
1724
      },
 
1725
      (
 
1726
         ## Solver
 
1727
         element solver {
 
1728
            linear_solver_options_sym
 
1729
         }
 
1730
      ),
 
1731
      (
 
1732
         ## Initial condition for WholeMesh
 
1733
         ##
 
1734
         ## Only specify one condition if not using mesh regions.
 
1735
         ## Otherwise select other initial_condition option, specify region_ids
 
1736
         ## and distinct names.  Then add extra intial conditions for other regions.
 
1737
         element initial_condition {
 
1738
            attribute name { "WholeMesh" },
 
1739
            input_choice_initial_condition_real
 
1740
         }|
 
1741
         ## Multiple initial_conditions are allowed if specifying
 
1742
         ## different values in different
 
1743
         ## regions of the mesh (defined by region_ids).  In this case
 
1744
         ## each initial_condition
 
1745
         ## requires a distinct name for the options dictionary.
 
1746
         element initial_condition {
 
1747
            attribute name { string },
 
1748
            region_ids,
 
1749
            input_choice_initial_condition_real
 
1750
         }
 
1751
      )*,
 
1752
      prognostic_scalar_output_options,
 
1753
      prognostic_scalar_stat_options,
 
1754
      prognostic_detector_options,
 
1755
      scalar_steady_state_options,
 
1756
      adaptivity_options_prognostic_scalar_field,
 
1757
      interpolation_algorithm_scalar_full,
 
1758
      discrete_properties_algorithm_scalar?
 
1759
   )
 
1760
   
 
1761
# Balance pressure field, this is a copy of prognostic_scalar_field above
 
1762
# removing all options that don't apply (mainly advection related)
 
1763
prognostic_balance_pressure_field =
 
1764
   (
 
1765
      ## Spatial discretisation options
 
1766
      element spatial_discretisation {
 
1767
         # note I removed disott here as it
 
1768
         # will switch on free-surface options in geoeli1p
 
1769
         # should be hard-coded to 0 in comsca therefore
 
1770
         # tlump is irrelevant
 
1771
         # suftem should be hard-coded to .false. if nlevel is set
 
1772
         ## Geostrophic pressure option
 
1773
         element geostrophic_pressure_option {
 
1774
            attribute replaces { "GEOBAL" },
 
1775
            element string_value {
 
1776
               "include_buoyancy"|"exclude_buoyancy"
 
1777
            }
 
1778
         }
 
1779
         # unfortunately tbeta doesn`t make sense here
 
1780
         # so we have to code an exception for not having it in comsca
 
1781
      },
 
1782
      # Temporal_discretisation doesn`t apply to balance pressure
 
1783
      # (there`s no time derivative). Exception again
 
1784
      # Solver block is the same as prognostic_scalar_field
 
1785
      ## Solver
 
1786
      element solver {
 
1787
         linear_solver_options_sym
 
1788
      },
 
1789
      # Alas, no initial_condition either, so we'd better not checkpointing it...
 
1790
      ## Disables checkpointing of this field
 
1791
      element exclude_from_checkpointing {
 
1792
        comment
 
1793
      },
 
1794
      # There are boundary conditions, but nothing you can set
 
1795
      # (all derived from velocity b.c.s)
 
1796
      # no Diffusivity tensor_field
 
1797
      # no Source scalar_field
 
1798
      # no Absorption scalar_field
 
1799
      # no adaptive time-stepping
 
1800
      prognostic_scalar_output_options,
 
1801
      prognostic_scalar_stat_options,
 
1802
      scalar_convergence_options,
 
1803
      prognostic_detector_options,
 
1804
      scalar_steady_state_options,
 
1805
      adaptivity_options_prognostic_scalar_field,
 
1806
      interpolation_algorithm_scalar_full,
 
1807
      discrete_properties_algorithm_scalar?
 
1808
   )
 
1809
 
 
1810
# Vertical balance pressure field, this is a copy of prognostic_scalar_field above
 
1811
# removing all options that don't apply (mainly advection related)
 
1812
prognostic_vertical_balance_pressure_field =
 
1813
   (
 
1814
      ## Spatial discretisation options
 
1815
      element spatial_discretisation {
 
1816
        # we don't have any yet
 
1817
        empty
 
1818
      },
 
1819
      # Temporal_discretisation doesn`t apply to balance pressure
 
1820
      # (there`s no time derivative). Exception again
 
1821
      # no solver block as we don't do a PETSc solve
 
1822
      # Alas, no initial_condition either...
 
1823
      # boundary conditions are fixed (p=0 on top)
 
1824
      # no Diffusivity tensor_field
 
1825
      # no Source scalar_field
 
1826
      # no Absorption scalar_field
 
1827
      # no adaptive time-stepping
 
1828
      prognostic_scalar_output_options,
 
1829
      prognostic_scalar_stat_options,
 
1830
      scalar_convergence_options,
 
1831
      prognostic_detector_options,
 
1832
      scalar_steady_state_options,
 
1833
      adaptivity_options_prognostic_scalar_field,
 
1834
      interpolation_algorithm_scalar,
 
1835
      discrete_properties_algorithm_scalar?
 
1836
   )
 
1837
   
 
1838
# free surface field, this is a copy of prognostic_scalar_field above
 
1839
# removing all options that don't apply (mainly advection related)
 
1840
prognostic_free_surface_field =
 
1841
   (
 
1842
      (
 
1843
         ## Spatial discretisation options
 
1844
         element spatial_discretisation {
 
1845
            ## Form a full 3D system for the free surface
 
1846
            element free_surface_3D {
 
1847
               attribute replaces { "DISOTT=2^0 (frees3d)" },
 
1848
               empty
 
1849
            }?,
 
1850
            element fourth_order_dissipation {
 
1851
               attribute replaces { "DISOTT=2^2 (fourthfrees_diss)" },
 
1852
               empty
 
1853
            }?,
 
1854
            ## low order (linear) free surface
 
1855
            element low_order_free_surface {
 
1856
               attribute replaces { "DISOTT=2^3 (geo_short)" },
 
1857
               empty
 
1858
            }?,
 
1859
            (
 
1860
               ## Select free surface filter
 
1861
               ##
 
1862
               ## With PN-PN we need some filter to supress spurious modes.
 
1863
               element default_free_surface_filter {
 
1864
                  empty
 
1865
               }|
 
1866
               ## Select free surface filter
 
1867
               ##
 
1868
               ## With PN-PN we need some filter to supress spurious modes.
 
1869
               element user_specified_free_surface_filter {
 
1870
                  ## Default is to apply 0.01 and for wetting and drying cases 1.0
 
1871
                  element non_linear_filter_coefficient {
 
1872
                     real
 
1873
                  }
 
1874
               }|
 
1875
               ## Switch off free surface filter, this is more efficient than setting the coefficient to 0.
 
1876
               element switch_off_free_surface_filter {
 
1877
                  attribute replaces { "DISOTT=2^8 (nofsta)" },
 
1878
                  empty
 
1879
               }
 
1880
            ),
 
1881
            ## Apply wetting and drying routines
 
1882
            element wetting_drying {
 
1883
               attribute replaces { "DISOTT=2^10 (wetdry)" },
 
1884
               empty
 
1885
            }?,
 
1886
            ## Tidal forcing options 
 
1887
            element tidal_forcing {
 
1888
               ## M2
 
1889
               element M2 {
 
1890
                 attribute replaces {"DISOTT=2^11"}, 
 
1891
                 empty
 
1892
               }?,
 
1893
               ## S2
 
1894
               element S2 {
 
1895
                  empty
 
1896
               }?,
 
1897
               ## N2
 
1898
               element N2 {
 
1899
                  empty
 
1900
               }?,
 
1901
               ## K2
 
1902
               element K2 {
 
1903
                  empty
 
1904
               }?,
 
1905
               ## K1
 
1906
               element K1 {
 
1907
                  empty
 
1908
               }?,
 
1909
               ## O1
 
1910
               element O1 {
 
1911
                  empty
 
1912
               }?,
 
1913
               ## P1
 
1914
               element P1 {
 
1915
                  empty
 
1916
               }?,
 
1917
               ## Q1
 
1918
               element Q1 {
 
1919
                  empty
 
1920
               }?,             
 
1921
               ## Switch on all tidal components
 
1922
               element all_tidal_components {
 
1923
                  attribute replaces { "DISOTT=2^5 (tidallcom)" },
 
1924
                  empty
 
1925
               }?,
 
1926
               ## Switches on a Love number of 0.3
 
1927
               element love_number {
 
1928
                  attribute replaces { "DISOTT=2^6 (tlove)" },
 
1929
                  empty
 
1930
               }?,
 
1931
               ## Use static tidal force for testing
 
1932
               element static_tidal_force {
 
1933
                  attribute replaces { "DISOTT=2^7 (statid)" },
 
1934
                  empty
 
1935
               }?
 
1936
            }?
 
1937
         }|
 
1938
         ## Legacy Free Surface
 
1939
         ## Allows astronomical forcing for multiple tidal constituents.
 
1940
         ## Integer should be sum of desired components as follows:
 
1941
         ##
 
1942
         ## 3D Free Surface = 1
 
1943
         ##
 
1944
         ## Fourth Order Dissipation = 4
 
1945
         ##
 
1946
         ## Low Order Free Surface = 8
 
1947
         ##
 
1948
         ## Implicit absorption in the free surface (good for wetting/drying) = 16
 
1949
         ##
 
1950
         ## Turn on all tides = 32
 
1951
         ##
 
1952
         ## Love Number = 64
 
1953
         ##
 
1954
         ## Static Tidal Force = 128
 
1955
         ##
 
1956
         ## M2 constituent = 2048
 
1957
         ##
 
1958
         ## S2 constituent = 4096
 
1959
         ##
 
1960
         ## N2 constituent = 8192
 
1961
         ## 
 
1962
         ## K2 constituent = 16384
 
1963
         ##
 
1964
         ## K1 constituent = 32768
 
1965
         ##
 
1966
         ## O1 constituent = 65536
 
1967
         ## 
 
1968
         ## P1 constituent = 131072
 
1969
         ##
 
1970
         ## Q1 constituent = 262144
 
1971
         element Legacy_Free_Surface {
 
1972
            attribute replaces {"FREESDISOTT"},
 
1973
            integer
 
1974
         }
 
1975
      ),
 
1976
      # atheta, ctheta and fstheta (absorption, coriolis and free surface)
 
1977
      # need to go in temporal discretisation
 
1978
      # they are currently hard-coded however
 
1979
      element temporal_discretisation {
 
1980
         ## Implicit/explicitness for the free surface.
 
1981
         ##
 
1982
         ## Suggested value 1.0 (should be at least bigger than 0.5).
 
1983
         ##  =0.  -- explicit
 
1984
         ##  =0.5 -- Crank-Nicolson
 
1985
         ##  =1.  -- implicit
 
1986
         element theta {
 
1987
            attribute replaces {"THETA"},
 
1988
            real
 
1989
         },
 
1990
         # Maybe this should go under a proper absorption field under free surface?
 
1991
         ## Implicit/explicitness for absorption
 
1992
         ## =0.  -- explicit (default)
 
1993
         ## =0.5 -- Crank-Nicolson
 
1994
         ## =1.  -- implicit
 
1995
         element absorption_theta {
 
1996
            attribute replaces {"disott=2^4 (IMPABS)"},
 
1997
            real
 
1998
         }?
 
1999
      },
 
2000
      ## Solver
 
2001
      element solver {
 
2002
         linear_solver_options_sym
 
2003
      },
 
2004
      (
 
2005
         ## Initial condition for WholeMesh
 
2006
         ##
 
2007
         ## Only specify one condition if not using mesh regions.
 
2008
         ## Otherwise select other initial_condition option, specify region_ids
 
2009
         ## and distinct names.  Then add extra intial conditions for other regions.
 
2010
         element initial_condition {
 
2011
            attribute name { "WholeMesh" },
 
2012
            input_choice_initial_condition_real
 
2013
         }|
 
2014
         ## Multiple initial_conditions are allowed if specifying
 
2015
         ## different values in different
 
2016
         ## regions of the mesh (defined by region_ids).  In this case
 
2017
         ## each initial_condition
 
2018
         ## requires a distinct name for the options dictionary.
 
2019
         element initial_condition {
 
2020
            attribute name { string },
 
2021
            region_ids,
 
2022
            input_choice_initial_condition_real
 
2023
         }
 
2024
      )+,
 
2025
      ## Boundary conditions
 
2026
      element boundary_conditions {
 
2027
         attribute replaces { "boundary, TTPER1 TTPER2 TTPERI" },
 
2028
         attribute name { string },
 
2029
         ## Surface id:
 
2030
         element surface_ids {
 
2031
            integer_vector
 
2032
         },
 
2033
         ## Type
 
2034
         (
 
2035
            element type {
 
2036
               attribute name { "dirichlet" },
 
2037
               (
 
2038
                  input_choice_real_contents|
 
2039
                  element from_file {
 
2040
                     element tidal {
 
2041
                        attribute file_name { string },
 
2042
                        attribute variable_name_amplitude { string },
 
2043
                        attribute variable_name_phase { string },
 
2044
                        ## See E.W. Schwiderski - Rev. Geophys. Space
 
2045
                        ## Phys. Vol. 18 No. 1 pp. 243--268, 1980
 
2046
                        ## for details of these constituent.
 
2047
                        attribute name {"M2"|"S2"|"N2"|"K2"|"K1"|"O1"|"P1"|"Q1"|"Mf"|"Mm"|"Ssa"}
 
2048
                     }+
 
2049
                  }
 
2050
               )
 
2051
            }|
 
2052
            element type {
 
2053
               attribute name { "neumann" },
 
2054
               input_choice_real
 
2055
            }|
 
2056
            element type {
 
2057
               attribute name { "robin" },
 
2058
               element order_zero_coefficient {
 
2059
                  input_choice_real
 
2060
               },
 
2061
               element order_one_coefficient {
 
2062
                  input_choice_real
 
2063
               }
 
2064
            }
 
2065
         )
 
2066
      }*,
 
2067
      # no Diffusivity for field
 
2068
      # no source term
 
2069
      # no Absorption term
 
2070
      # no Adaptive timestepping option
 
2071
      prognostic_scalar_output_options,
 
2072
      prognostic_scalar_stat_options,
 
2073
      scalar_convergence_options,
 
2074
      prognostic_detector_options,
 
2075
      scalar_steady_state_options,
 
2076
      adaptivity_options_prognostic_scalar_field,
 
2077
      interpolation_algorithm_scalar,
 
2078
      discrete_properties_algorithm_scalar?
 
2079
   )
 
2080
 
 
2081
# stream function, this is a copy of prognostic_scalar_field above
 
2082
# removing all options that don't apply (mainly advection related)
 
2083
prognostic_stream_function_field =
 
2084
   (
 
2085
      ## Solver
 
2086
      element solver {
 
2087
         linear_solver_options_asym
 
2088
      },
 
2089
      ## Disables checkpointing of this field
 
2090
      element exclude_from_checkpointing {
 
2091
        comment
 
2092
      },
 
2093
      # no Diffusivity for field
 
2094
      # no source term
 
2095
      # no Absorption term
 
2096
      # no Adaptive timestepping option
 
2097
      prognostic_scalar_output_options,
 
2098
      prognostic_scalar_stat_options,
 
2099
      prognostic_detector_options,
 
2100
      adaptivity_options_prognostic_scalar_field,
 
2101
      interpolation_algorithm_scalar,
 
2102
      discrete_properties_algorithm_scalar?
 
2103
   )
 
2104
   
 
2105
# Richardson number field. This is a normal diagnostic scalar field, but with
 
2106
# Richardson number metric options added
 
2107
adaptivity_options_richardson_number_field.adaptivity_options =
 
2108
   (
 
2109
      ## Do not use an interpolation error driven metric for this field
 
2110
      element no_interpolation_measure {
 
2111
        comment
 
2112
      }
 
2113
   )
 
2114
adaptivity_options_richardson_number_field.adaptivity_options |= adaptivity_options_scalar_field.adaptivity_options
 
2115
adaptivity_options_richardson_number_field =
 
2116
   (
 
2117
      element adaptivity_options {
 
2118
         adaptivity_options_richardson_number_field.adaptivity_options,
 
2119
         ## An isotropic metric formulation based on the Richardson number. Uses
 
2120
         ## the logic that wherever the Richardson number is small, we expect
 
2121
         ## to need resolution. Generates edge lengths using:
 
2122
         ##
 
2123
         ##   Edge length = min_edge_length if Ri <= min_ri
 
2124
         ##                 max_edge_length if Ri >= max_ri
 
2125
         ##                 a linear fit between min_edge_length and max_edge_length otherwise
 
2126
         element richardson_number_metric {
 
2127
            ## Richardson number at which we have minimum edge length (default 0.0)
 
2128
            element min_ri {
 
2129
              real
 
2130
            }?,
 
2131
            ## Richardson number at which we have maximum edge length
 
2132
            element max_ri {
 
2133
              real
 
2134
            },
 
2135
            ## Minimum edge length that can be requested by the Richardson number
 
2136
            ## metric
 
2137
            element min_edge_length {
 
2138
              real
 
2139
            },
 
2140
            ## Maximum edge length that can be requested by the Richardson number
 
2141
            ## metric
 
2142
            element max_edge_length {
 
2143
              real
 
2144
            },
 
2145
            ## Enable to preserve anisotropy when merging with other metric
 
2146
            ## formulations
 
2147
            element anisotropy_preserving_merge {
 
2148
               comment
 
2149
            }?,
 
2150
            comment
 
2151
         }?,
 
2152
         adaptivity_preprocessing
 
2153
      }?
 
2154
   )
 
2155
diagnostic_richardson_number_field = diagnostic_scalar_field_no_adapt
 
2156
diagnostic_richardson_number_field &= adaptivity_options_richardson_number_field
 
2157
 
 
2158
diagnostic_cv_gradient_vector_field =
 
2159
   (
 
2160
      ## Choose whether the mass matrix is lumped or not
 
2161
      element lump_mass_matrix {
 
2162
            empty
 
2163
      }?,
 
2164
      ## Solver options are necessary if you're not lumping your mass or if you're field isn't dg
 
2165
      element solver {
 
2166
         linear_solver_options_sym
 
2167
      }?,
 
2168
      ## Normalise the gradient by its magnitude
 
2169
      element normalise {
 
2170
        empty
 
2171
      }?,
 
2172
      diagnostic_output_options,
 
2173
      diagnostic_vector_stat_options,
 
2174
      vector_convergence_options,
 
2175
      diagnostic_detector_options,
 
2176
      vector_steady_state_options,
 
2177
      adaptivity_options_vector_field,
 
2178
      recalculation_options?
 
2179
   )
 
2180
 
 
2181
diagnostic_gradient_vector_field =
 
2182
   (
 
2183
      ## Solver
 
2184
      element solver {
 
2185
         linear_solver_options_sym
 
2186
      },
 
2187
      diagnostic_output_options,
 
2188
      diagnostic_vector_stat_options,
 
2189
      vector_convergence_options,
 
2190
      diagnostic_detector_options,
 
2191
      vector_steady_state_options,
 
2192
      adaptivity_options_vector_field,
 
2193
      recalculation_options?
 
2194
   )
 
2195
 
 
2196
diagnostic_cv_divergence_scalar_field =
 
2197
   (
 
2198
      # No solver options because it can be solved directly!
 
2199
      diagnostic_output_options,
 
2200
      diagnostic_scalar_stat_options,
 
2201
      scalar_convergence_options,
 
2202
      diagnostic_detector_options,
 
2203
      scalar_steady_state_options,
 
2204
      adaptivity_options_scalar_field,
 
2205
      recalculation_options?
 
2206
   )
 
2207
 
 
2208
diagnostic_fe_divergence_scalar_field =
 
2209
   (
 
2210
      ## Solver
 
2211
      element solver {
 
2212
         linear_solver_options_sym
 
2213
      },
 
2214
      diagnostic_output_options,
 
2215
      diagnostic_scalar_stat_options,
 
2216
      scalar_convergence_options,
 
2217
      diagnostic_detector_options,
 
2218
      scalar_steady_state_options,
 
2219
      adaptivity_options_scalar_field,
 
2220
      recalculation_options?
 
2221
   )
 
2222
 
 
2223
# three optional input vectors for user-specified rotation matrix
 
2224
rotation_matrix_components =
 
2225
   (
 
2226
      ## Select if you want to specify the normal direction
 
2227
      ## of the rotation matrix.
 
2228
      ## If off then fluidity computes the normal (replaces GETTAN = .TRUE.)
 
2229
      ## If on the tangents vectors must also be specified.
 
2230
      element normal_direction {
 
2231
         attribute replaces { "GETTAN=.FALSE." },
 
2232
         input_choice_real_dim_vector
 
2233
      }?,
 
2234
      ## specify first unit tangent vector to boundary
 
2235
      element tangent_direction_1 {
 
2236
         attribute replaces { "GETTAN=.FALSE." },
 
2237
         input_choice_real_dim_vector
 
2238
      }?,
 
2239
      ## specify second (if exists, i.e. if 3d) unit tangent vector to boundary
 
2240
      element tangent_direction_2 {
 
2241
         attribute replaces { "GETTAN=.FALSE." },
 
2242
         input_choice_real_dim_vector
 
2243
      }?
 
2244
   )
 
2245
 
 
2246
velocity_components_choice =
 
2247
   (
 
2248
      (
 
2249
# rotated bcs are not implemented... this is where they should go when they are
 
2250
#         element align_bc_with_surface {
 
2251
#            element normal_component {
 
2252
#               input_choice_real
 
2253
#            }?,
 
2254
#            element tangent_component_1 {
 
2255
#               input_choice_real
 
2256
#            }?,
 
2257
#            element tangent_component_2 {
 
2258
#               input_choice_real
 
2259
#            }?,
 
2260
#            rotation_matrix_components
 
2261
#         }|
 
2262
         element align_bc_with_cartesian {
 
2263
            element x_component {
 
2264
               input_choice_real_bc_component
 
2265
            }?,
 
2266
            element y_component {
 
2267
               input_choice_real_bc_component
 
2268
            }?,
 
2269
            element z_component {
 
2270
               input_choice_real_bc_component
 
2271
            }?
 
2272
         }
 
2273
      )
 
2274
   )
 
2275
   
 
2276
input_choice_real_bc_component = 
 
2277
   (
 
2278
      input_choice_real|
 
2279
      element synthetic_eddy_method {
 
2280
         ## use a large number to ensure Gaussian 
 
2281
         ## behaviour of the fluctuating component
 
2282
         element number_of_eddies {
 
2283
           integer
 
2284
         },
 
2285
         element turbulence_lengthscale {
 
2286
            input_choice_real
 
2287
         },
 
2288
         ## mean profile
 
2289
         ##
 
2290
         ## usually a function of height,
 
2291
         ## for ABL simulations use a log profile
 
2292
         element mean_profile {
 
2293
            input_choice_real
 
2294
         },
 
2295
         ## Reynolds stresses profile
 
2296
         ##
 
2297
         ## usually a function of height,
 
2298
         ## assumes that the remaining stresses are negligible 
 
2299
         element Re_stresses_profile {
 
2300
           input_choice_real
 
2301
         }
 
2302
      }
 
2303
   )
 
2304
 
 
2305
# and again for robin b.c.s
 
2306
robin_velocity_components_choice =
 
2307
   (
 
2308
      (
 
2309
#         element align_bc_with_surface {
 
2310
#            element normal_component {
 
2311
#               element order_zero_coefficient {
 
2312
#                  input_choice_real
 
2313
#               },
 
2314
#               element order_one_coefficient {
 
2315
#                  input_choice_real
 
2316
#               }
 
2317
#            }?,
 
2318
#            element tangent_component_1 {
 
2319
#               element order_zero_coefficient {
 
2320
#                  input_choice_real
 
2321
#               },
 
2322
#               element order_one_coefficient {
 
2323
#                  input_choice_real
 
2324
#               }
 
2325
#            }?,
 
2326
#            element tangent_component_2 {
 
2327
#               element order_zero_coefficient {
 
2328
#                  input_choice_real
 
2329
#               },
 
2330
#               element order_one_coefficient {
 
2331
#                  input_choice_real
 
2332
#               }
 
2333
#            }?,
 
2334
#            rotation_matrix_components
 
2335
#         }|
 
2336
         element align_bc_with_cartesian {
 
2337
            element x_component {
 
2338
               element order_zero_coefficient {
 
2339
                  input_choice_real
 
2340
               },
 
2341
               element order_one_coefficient {
 
2342
                  input_choice_real
 
2343
               }
 
2344
            }?,
 
2345
            element y_component {
 
2346
               element order_zero_coefficient {
 
2347
                  input_choice_real
 
2348
               },
 
2349
               element order_one_coefficient {
 
2350
                  input_choice_real
 
2351
               }
 
2352
            }?,
 
2353
            element z_component {
 
2354
               element order_zero_coefficient {
 
2355
                  input_choice_real
 
2356
               },
 
2357
               element order_one_coefficient {
 
2358
                  input_choice_real
 
2359
               }
 
2360
            }?
 
2361
         }
 
2362
      )
 
2363
   )
 
2364
 
 
2365
velocity_boundary_conditions =
 
2366
   (
 
2367
      (
 
2368
         element type {
 
2369
            attribute name { "dirichlet" },
 
2370
            ## Apply the dirichlet bc weakly.  Available automatically
 
2371
            ## with a discontinuous_galerkin Velocity
 
2372
            ## spatial_discretisation.  Available if you
 
2373
            ## integrate_continuity_by_parts with a
 
2374
            ## continuous_galerkin Pressure or use a control_volume
 
2375
            ## Pressure spatial_discretisation and/or
 
2376
            ## integrate_advection_by_parts under Velocity
 
2377
            ## spatial_discretisation with continuous_galerkin.
 
2378
            ##
 
2379
            ## If not selected boundary conditions are applied strongly.
 
2380
            element apply_weakly {
 
2381
               ## If the initial condition and boundary conditions
 
2382
               ## differ, setting this option will cause the initial
 
2383
               ## condition on the boundary to be overwritten with
 
2384
               ## the boundary condition. Since you are applying the
 
2385
               ## boundary condition weakly, you probably do *not*
 
2386
               ## want this.
 
2387
               element boundary_overwrites_initial_condition {
 
2388
                  empty
 
2389
               }?
 
2390
            }?,
 
2391
            velocity_components_choice
 
2392
         }|
 
2393
         element type {
 
2394
            attribute name { "neumann" },
 
2395
            velocity_components_choice
 
2396
         }|
 
2397
         element type {
 
2398
            attribute name { "robin" },
 
2399
            robin_velocity_components_choice
 
2400
         }|
 
2401
         element type {
 
2402
            attribute name { "free_surface" }
 
2403
         }|
 
2404
         ## Apply quadratic drag. Specify drag coefficient. If you
 
2405
         ## want to exactly replicate results from using the OCEDRA
 
2406
         ## option, set this to 0.003 and remember to apply to both
 
2407
         ## bottom and sides.
 
2408
         element type {
 
2409
            attribute name { "drag" },
 
2410
            input_choice_real,
 
2411
            (
 
2412
              ## Use a quadratic drag.
 
2413
              ##
 
2414
              ## This means that the drag coefficient is nondimensional.
 
2415
              element quadratic_drag {
 
2416
                empty
 
2417
              }|
 
2418
              ## Use a linear drag (basically just a surface absorption term).
 
2419
              ##
 
2420
              ## This means that the drag coefficient has units of momentum.
 
2421
              element linear_drag {
 
2422
                empty
 
2423
              }
 
2424
            )
 
2425
         }|
 
2426
 
 
2427
         ## Apply wind forcing specified by stress or wind velocity.
 
2428
         ## Replaces windy.dat and windy.py
 
2429
         element type {
 
2430
            attribute name { "wind_forcing" },
 
2431
            (
 
2432
               ## Wind forcing with user specified wind stress
 
2433
               ##
 
2434
               ## <b> Note that the stress needs to be specified
 
2435
               ## using the same density units as the reference_density 
 
2436
               ## under equation of state.</b>So if you use the recommended
 
2437
               ## non-dimensional value of 1.0 for reference_density and
 
2438
               ## your calculated stress is in kg m^-1s^-2 and the dimensional
 
2439
               ## reference_density is 1000.0 kg m^-3, you need to divide
 
2440
               ## the calculated stress in SI units by 1000.0.
 
2441
               element wind_stress {
 
2442
                  input_choice_real_dim_minus_one_vector|
 
2443
                  element from_netcdf {
 
2444
                     ## The format of this file should conform to NetCDF CF 1.x
 
2445
                     ## (http://cf-pcmdi.llnl.gov/).
 
2446
                     attribute file_name { xsd:string },
 
2447
                     attribute east_west { xsd:string },
 
2448
                     attribute north_south { xsd:string },
 
2449
                     comment
 
2450
                  }
 
2451
               }|
 
2452
               ## Wind forcing with user specified 10m wind velocity
 
2453
               element wind_velocity {
 
2454
                  ## Specify wind drag coefficient (dimensionless)
 
2455
                  ## Suggested value: 4.0e-4
 
2456
                  element wind_drag_coefficient {
 
2457
                     input_choice_real
 
2458
                  },
 
2459
                  ## Density of air. 
 
2460
                  ##
 
2461
                  ## <b>Note that you have to specify
 
2462
                  ## this density in the same units as the 
 
2463
                  ## reference_density under equation of state.</b>
 
2464
                  ## So with a typicial value of rho_air=1.3 kgm^-3
 
2465
                  ## and rho_water=1000 kgm^-3, if you fill in the 
 
2466
                  ## recommended (non-dimensional) value of 1.0 for 
 
2467
                  ## reference_density, this field needs to be 1.3e-3.
 
2468
                  element density_air {
 
2469
                     real
 
2470
                  },
 
2471
                  ## Specify wind velocity
 
2472
                  element wind_velocity {
 
2473
                     input_choice_real_dim_minus_one_vector|
 
2474
                     element from_netcdf {
 
2475
                        ## The format of this file should conform to NetCDF CF 1.x
 
2476
                        ## (http://cf-pcmdi.llnl.gov/)
 
2477
                        attribute file_name { xsd:string },
 
2478
                        attribute east_west { xsd:string },
 
2479
                        attribute north_south { xsd:string },
 
2480
                        comment
 
2481
                     }
 
2482
                  }
 
2483
               }
 
2484
            )
 
2485
         }|
 
2486
 
 
2487
         ## When using control_volumes under Pressure
 
2488
         ## spatial_discretisation or when using
 
2489
         ## integrate_continuity_by_parts with continuous_galerkin
 
2490
         ## Pressure and continuous_galerkin Velocity this
 
2491
         ## boundary condition type imposes a weak no normal flow
 
2492
         ## boundary condition on the surface_ids specified.
 
2493
         element type {
 
2494
            attribute name { "no_normal_flow" },
 
2495
            empty
 
2496
         }|
 
2497
 
 
2498
         ## Implements a penalty function for the near wall region.
 
2499
         ## Using this option coarse meshes can
 
2500
         ## be used in the near wall region.
 
2501
         ##
 
2502
         ## Should be used in combination with a no_normal_flow condition. 
 
2503
         ##
 
2504
         ## See Bazilevs et al. 2007
 
2505
         element type{
 
2506
            attribute name { "near_wall_treatment" },
 
2507
            element tolerance {real}
 
2508
         }|
 
2509
         ## Log law of the wall
 
2510
         ##
 
2511
         ## Should be used in combination with a no_normal_flow condition. 
 
2512
         element type{
 
2513
            attribute name { "log_law_of_wall" },
 
2514
            element surface_roughness {real}
 
2515
         }
 
2516
      )
 
2517
   )
 
2518
   
 
2519
# Output options for prognostic fields
 
2520
prognostic_scalar_output_options =
 
2521
   (
 
2522
      ## Specify what is written to vtu dump files
 
2523
      element output {
 
2524
         ## By default each field in the options file is written to vtu.
 
2525
         ## Select this option to exclude this field.
 
2526
         element exclude_from_vtu {
 
2527
            empty
 
2528
         }?,
 
2529
         ## Select this option to also write the values of this field
 
2530
         ## on the previous timestep.
 
2531
         ## (included under the name: Old<field_name> )
 
2532
         element include_previous_time_step {
 
2533
            empty
 
2534
         }?,
 
2535
         ## Select this option to also write the values of this field
 
2536
         ## used in the nonlinear iteration.
 
2537
         ## (included under the name: Nonlinear<field_name> )
 
2538
         element include_nonlinear_field {
 
2539
            empty
 
2540
         }?,
 
2541
         ## Output a file details the convergence (or otherwise) of
 
2542
         ## this field with every advective nonlinear
 
2543
         ## iteration.
 
2544
         ## ONLY WORKS FOR PURE CONTROL VOLUME DISCRETISATIONS.
 
2545
         element convergence_file {
 
2546
            comment
 
2547
         }?
 
2548
      }
 
2549
   )
 
2550
 
 
2551
# Output options for pressure (can't have a convergence file)
 
2552
pressure_output_options =
 
2553
   (
 
2554
      ## Specify what is written to vtu dump files
 
2555
      element output {
 
2556
         ## By default each field in the options file is written to vtu.
 
2557
         ## Select this option to exclude this field.
 
2558
         element exclude_from_vtu {
 
2559
            empty
 
2560
         }?,
 
2561
         ## Select this option to also write the values of this field
 
2562
         ## on the previous timestep.
 
2563
         ## (included under the name: Old<field_name> )
 
2564
         element include_previous_time_step {
 
2565
            empty
 
2566
         }?,
 
2567
         ## Select this option to also write the values of this field
 
2568
         ## used in the nonlinear iteration.
 
2569
         ## (included under the name: Nonlinear<field_name> )
 
2570
         element include_nonlinear_field {
 
2571
            empty
 
2572
         }?,
 
2573
         ## Write out some extra debugging vtu files that can be used
 
2574
         ## to analyse what goes on in the pressure projection steps.
 
2575
         ## WARNING: this may create a huge amount of vtu files, as 
 
2576
         ## multiple files are written per nonlinear iteration.
 
2577
         element debugging_vtus {
 
2578
            empty
 
2579
         }?
 
2580
      }
 
2581
   )
 
2582
 
 
2583
# Output options for prognostic fields
 
2584
prognostic_vector_output_options =
 
2585
   (
 
2586
      ## Specify what is written to vtu dump files
 
2587
      element output {
 
2588
         ## By default each field in the options file is written to vtu.
 
2589
         ## Select this option to exclude this field.
 
2590
         element exclude_from_vtu {
 
2591
            empty
 
2592
         }?,
 
2593
         ## Select this option to also write the values of this field
 
2594
         ## on the previous timestep.
 
2595
         ## (included under the name: Old<field_name> )
 
2596
         element include_previous_time_step {
 
2597
            empty
 
2598
         }?,
 
2599
         ## Select this option to also write the values of this field
 
2600
         ## used in the nonlinear iteration.
 
2601
         ## (included under the name: Nonlinear<field_name> )
 
2602
         element include_nonlinear_field {
 
2603
            empty
 
2604
         }?
 
2605
      }
 
2606
   )
 
2607
   
 
2608
# Output options for all other fields
 
2609
field_output_options =
 
2610
   (
 
2611
      ## Specify what is written to vtu dump files
 
2612
      element output {
 
2613
         ## By default each field in the options file is written to vtu.
 
2614
         ## Select this option to exclude this field.
 
2615
         element exclude_from_vtu {
 
2616
            empty
 
2617
         }?
 
2618
      }
 
2619
   )
 
2620
   
 
2621
diagnostic_output_options = field_output_options
 
2622
prescribed_output_options = field_output_options
 
2623
 
 
2624
# Options for inclusion/exclusion of standard field statistics from the .stat
 
2625
# file
 
2626
include_stat =
 
2627
   (
 
2628
      ## Include this field in the .stat file (magnitude and components)
 
2629
      element include_in_stat {
 
2630
         comment
 
2631
      }
 
2632
   )
 
2633
exclude_components_from_stat =
 
2634
   (
 
2635
      ## Include just the magnitude of this field in the .stat file
 
2636
      ## (excluding the components)
 
2637
      element exclude_components_from_stat {
 
2638
         comment
 
2639
      }
 
2640
   )
 
2641
exclude_stat =
 
2642
   (
 
2643
      ## Exclude this field from the .stat file.
 
2644
      element exclude_from_stat {
 
2645
         comment
 
2646
      }
 
2647
   )
 
2648
 
 
2649
# Diagnostic statistics options for prognostic scalar fields
 
2650
prognostic_scalar_stat_options = 
 
2651
   (
 
2652
      ## Specify what is added to .stat files
 
2653
      element stat {
 
2654
        prognostic_scalar_stat_options.stat
 
2655
      }
 
2656
   )
 
2657
  
 
2658
# Diagnostic statistics for all other scalar fields
 
2659
prognostic_scalar_stat_no_old_or_nonlinear_options =
 
2660
   (
 
2661
      ## Specify what is added to .stat files
 
2662
      element stat {
 
2663
         prognostic_scalar_stat_no_old_or_nonlinear_options.stat
 
2664
         
 
2665
      }
 
2666
   )
 
2667
 
 
2668
diagnostic_scalar_stat_options = prognostic_scalar_stat_no_old_or_nonlinear_options
 
2669
prescribed_scalar_stat_options = prognostic_scalar_stat_no_old_or_nonlinear_options
 
2670
 
 
2671
# Combining of stat elements for scalar fields
 
2672
prognostic_scalar_stat_options.stat = prognostic_scalar_stat_no_old_or_nonlinear_options.stat
 
2673
prognostic_scalar_stat_options.stat &=
 
2674
   (
 
2675
      ## Enable to include the previous timestep value of this field in the .stat file.
 
2676
      element include_previous_time_step {
 
2677
         comment
 
2678
      }?,
 
2679
      ## Enable to include the values of this field in the nonlinear
 
2680
      ## iteration in the .stat file.
 
2681
      element include_nonlinear_field {
 
2682
         comment
 
2683
      }?
 
2684
   )
 
2685
prognostic_scalar_stat_no_old_or_nonlinear_options.stat = 
 
2686
   (
 
2687
      exclude_stat?,
 
2688
      cv_stats?,
 
2689
      surface_integral_stats_scalar*,
 
2690
      mixing_stats*
 
2691
   )   
 
2692
   
 
2693
# Diagnostic statistics options for vector fields, with enabled by default
 
2694
vector_field_stat_options_enabled_default = include_stat
 
2695
vector_field_stat_options_enabled_default |= exclude_components_from_stat
 
2696
vector_field_stat_options_enabled_default |= exclude_stat
 
2697
 
 
2698
# Diagnostic statistics options for vector fields, with enabled by default
 
2699
vector_field_stat_options_disabled_default = exclude_stat
 
2700
vector_field_stat_options_disabled_default |= exclude_components_from_stat
 
2701
vector_field_stat_options_disabled_default |= include_stat
 
2702
 
 
2703
# Diagnostic statistics for prognostic vector fields
 
2704
prognostic_vector_stat_options =
 
2705
   (
 
2706
      ## Specify what is added to .stat files
 
2707
      element stat {
 
2708
         (
 
2709
            prognostic_vector_stat_options.stat
 
2710
         )
 
2711
      }      
 
2712
   )
 
2713
 
 
2714
# Diagnostic statistics for all other vector fields
 
2715
prognostic_vector_stat_no_old_or_nonlinear_options =
 
2716
   (
 
2717
      ## Specify what is added to .stat files
 
2718
      element stat {
 
2719
         prognostic_vector_stat_no_old_or_nonlinear_options.stat
 
2720
      }
 
2721
   )
 
2722
diagnostic_vector_stat_options = prognostic_vector_stat_no_old_or_nonlinear_options
 
2723
prescribed_vector_stat_options = prognostic_vector_stat_no_old_or_nonlinear_options
 
2724
 
 
2725
# Combining of stat elements for vector fields
 
2726
prognostic_vector_stat_options.stat = prognostic_vector_stat_no_old_or_nonlinear_options.stat
 
2727
prognostic_vector_stat_options.stat &=
 
2728
   (
 
2729
      ## Specify how the previous timestep value of this field is added to the .stat file.
 
2730
      element previous_time_step {
 
2731
         vector_field_stat_options_disabled_default
 
2732
      },
 
2733
      ## Specify how the values of this field used in the nonlinear iteration are added to the .stat file.
 
2734
      element nonlinear_field {
 
2735
         vector_field_stat_options_disabled_default
 
2736
      },
 
2737
      ## What surface IDs do you want to do the calculation over?
 
2738
      element compute_body_forces_on_surfaces {
 
2739
         integer_vector
 
2740
      }?
 
2741
   )
 
2742
prognostic_vector_stat_no_old_or_nonlinear_options.stat =
 
2743
   (
 
2744
      vector_field_stat_options_enabled_default,
 
2745
      surface_integral_stats_vector*
 
2746
   )
 
2747
 
 
2748
# Convergence options for prognostic scalar fields
 
2749
scalar_convergence_options =
 
2750
   (
 
2751
      ## Decide whether this field is tested for convergence
 
2752
      ## during nonlinear iterations
 
2753
      ## (if /timestepping/nonlinear_iterations and
 
2754
      ## /timestepping/nonlinear_iterations/tolerance are
 
2755
      ## enabled).
 
2756
      ## Also specifies whether the field is added to the 
 
2757
      ## convergence file (if /io/convergence_file is enabled).
 
2758
      element convergence {
 
2759
         (
 
2760
            ## Include this field in convergence testing
 
2761
            ## (if /timestepping/nonlinear_iterations and
 
2762
            ## /timestepping/nonlinear_iterations/tolerance are
 
2763
            ## enabled) and file (if /io/convergence_file is enabled)
 
2764
            element include_in_convergence {
 
2765
               comment
 
2766
            }|
 
2767
            ## Exclude this field from convergence testing and file 
 
2768
            element exclude_from_convergence {
 
2769
               comment
 
2770
            }
 
2771
         )
 
2772
      }
 
2773
   )
 
2774
 
 
2775
# Convergence statistics options for prognostic vector fields (velocity)
 
2776
vector_convergence_options =
 
2777
   (
 
2778
      ## Decide whether this field is tested for convergence
 
2779
      ## during nonlinear iterations
 
2780
      ## (if /timestepping/nonlinear_iterations and
 
2781
      ## /timestepping/nonlinear_iterations/tolerance are
 
2782
      ## enabled).
 
2783
      ## Also specifies whether the field is added to the 
 
2784
      ## convergence file (if /io/convergence_file is enabled).
 
2785
      element convergence {
 
2786
         (
 
2787
            ## Include this field (magnitude and components)
 
2788
            ## in convergence testing
 
2789
            ## (if /timestepping/nonlinear_iterations and
 
2790
            ## /timestepping/nonlinear_iterations/tolerance are
 
2791
            ## enabled) and file (if /io/convergence_file is enabled)
 
2792
            element include_in_convergence {
 
2793
               comment
 
2794
            }|
 
2795
            ## Include just the magnitude of this field 
 
2796
            ## in convergence testing
 
2797
            ## (if /timestepping/nonlinear_iterations and
 
2798
            ## /timestepping/nonlinear_iterations/tolerance are
 
2799
            ## enabled) and file (if /io/convergence_file is enabled)
 
2800
            ## i.e. excluding the components
 
2801
            element exclude_components_from_convergence {
 
2802
               comment
 
2803
            }|
 
2804
            ## Exclude this field entirely from convergence testing and file 
 
2805
            element exclude_from_convergence {
 
2806
               comment
 
2807
            }
 
2808
         )
 
2809
      }
 
2810
   )
 
2811
 
 
2812
# Steady state options for prognostic scalar fields
 
2813
scalar_steady_state_options =
 
2814
   (
 
2815
      ## Decide whether this field is tested for a steady state
 
2816
      ## between timesteps
 
2817
      ## (if /timestepping/steady_state is
 
2818
      ## enabled).
 
2819
      element steady_state {
 
2820
         (
 
2821
            ## Include this field in steady state testing
 
2822
            ## (if /timestepping/steady_state is
 
2823
            ## enabled)
 
2824
            element include_in_steady_state {
 
2825
               comment
 
2826
            }|
 
2827
            ## Exclude this field from steady state testing
 
2828
            element exclude_from_steady_state {
 
2829
               comment
 
2830
            }
 
2831
         )
 
2832
      }
 
2833
   )
 
2834
 
 
2835
# Steady state statistics options for prognostic vector fields (velocity)
 
2836
vector_steady_state_options =
 
2837
   (
 
2838
      ## Decide whether this field is tested for a steady state
 
2839
      ## between timesteps
 
2840
      ## (if /timestepping/steady_state is
 
2841
      ## enabled).
 
2842
      element steady_state {
 
2843
         (
 
2844
            ## Include this field (magnitude and components)
 
2845
            ## in steady state testing
 
2846
            ## (if /timestepping/steady_state is enabled)
 
2847
            element include_in_steady_state {
 
2848
               comment
 
2849
            }|
 
2850
            ## Include just the magnitude of this field 
 
2851
            ## in steady state testing
 
2852
            ## (if /timestepping/steady_state is
 
2853
            ## enabled)
 
2854
            ## i.e. excluding the components
 
2855
            element exclude_components_from_steady_state {
 
2856
               comment
 
2857
            }|
 
2858
            ## Exclude this field entirely from convergence testing and file 
 
2859
            element exclude_from_steady_state {
 
2860
               comment
 
2861
            }
 
2862
         )
 
2863
      }
 
2864
   )
 
2865
 
 
2866
# Options for whether a field is to be included in detector output.
 
2867
detector_options_enabled_default = 
 
2868
   (
 
2869
      ## Specify what is added to detector files
 
2870
      element detectors {
 
2871
         (
 
2872
            ## This field is output at each detector location.
 
2873
            element include_in_detectors {
 
2874
               comment
 
2875
            }|
 
2876
            ## This field is not output at detector locations.
 
2877
            element exclude_from_detectors {
 
2878
               comment
 
2879
            }
 
2880
         )
 
2881
      }
 
2882
   )
 
2883
 
 
2884
# Options for whether a field is to be included in detector output.
 
2885
detector_options_disabled_default = 
 
2886
   (
 
2887
      ## Specify what is added to detector files
 
2888
      element detectors {
 
2889
         (
 
2890
            ## This field is not output at detector locations.
 
2891
            element exclude_from_detectors {
 
2892
               comment
 
2893
            }|
 
2894
            ## This field is output at each detector location.
 
2895
            element include_in_detectors {
 
2896
               comment
 
2897
            }
 
2898
         )
 
2899
      }
 
2900
   )
 
2901
 
 
2902
# Detector output defaults on for prognostic and diagnostic fields, 
 
2903
# off for prescribed.
 
2904
prognostic_detector_options = detector_options_enabled_default
 
2905
diagnostic_detector_options = detector_options_enabled_default
 
2906
prescribed_detector_options = detector_options_disabled_default
 
2907
 
 
2908
adaptivity_preprocessing =
 
2909
      ## Occasionally, it is desirable to apply operations or filters
 
2910
      ## to fields before using them for the purposes of adaptivity.
 
2911
      element preprocessing {
 
2912
        (
 
2913
            ## Invert a helmholtz operator to smooth out the field
 
2914
            ## before using it to adapt. This can help with noisy
 
2915
            ## fields.
 
2916
            element helmholtz_smoother {
 
2917
                 element smoothing_length_scale {
 
2918
                     real_dim_symmetric_tensor
 
2919
                 },
 
2920
                 element solver {
 
2921
                   linear_solver_options_sym
 
2922
                 }
 
2923
            }
 
2924
        )
 
2925
      }?
 
2926
 
 
2927
adaptivity_options_prognostic_scalar_field =
 
2928
   (
 
2929
      element adaptivity_options {
 
2930
         (
 
2931
            ## When specifying absolute measure
 
2932
            ## one specifies the absolute interpolation 
 
2933
            ## error in the units of the field that is 
 
2934
            ## being adapted, e.g. you can specify
 
2935
            ## the error to be 1.3 units 
 
2936
            element absolute_measure {
 
2937
               attribute replaces { "ADOPTT = 0" },
 
2938
               element scalar_field {
 
2939
                  attribute rank { "0" },
 
2940
                  attribute name { "InterpolationErrorBound" },
 
2941
                  attribute replaces { "ADWEIT" },
 
2942
                  element prescribed {
 
2943
                     prescribed_scalar_field_no_adapt
 
2944
                  }
 
2945
               }
 
2946
            }|
 
2947
            ##When specifying relative measure
 
2948
            ##one specifies the interpolation error
 
2949
            ##relative to the field that is
 
2950
            ##being adapted, e.g. you can specify
 
2951
            ##the error to be 5% (i.e. 0.05)
 
2952
            element relative_measure {
 
2953
               attribute replaces { "ADOPTT = 1" },
 
2954
               element scalar_field {
 
2955
                  attribute rank { "0" },
 
2956
                  attribute name { "InterpolationErrorBound" },
 
2957
                  attribute replaces { "ADADOT" },
 
2958
                  element prescribed {
 
2959
                     prescribed_scalar_field_no_adapt
 
2960
                  }
 
2961
               },
 
2962
               ## The relative Hessian is calculated according to:
 
2963
               ##
 
2964
               ##   Q = H / max{ |psi|, psi_min}
 
2965
               ##
 
2966
               ## where H is the Hessian, psi is the field value and
 
2967
               ## psi_min is the tolerance. The tolerance prevents
 
2968
               ## division by zero errors.
 
2969
               ##
 
2970
               ## Source: Fluidity/ICOM manual draft version 1.2
 
2971
               element tolerance {
 
2972
                  attribute replaces { "ADATOT" },
 
2973
                  real
 
2974
               }
 
2975
            }|
 
2976
            ## Adapt using the anisotropic strategy of 
 
2977
            ## Formaggia, Perotto, Micheletti.
 
2978
            ## Rather than taking two derivatives
 
2979
            ## and deriving the anisotropic information,
 
2980
            ## this approach computes an anisotropic Zienkiewicz-Zhu
 
2981
            ## error estimator for each element. The approach then
 
2982
            ## optimises the element orientation and length scales
 
2983
            ## to equidistribute the estimated error.
 
2984
            element anisotropic_zienkiewicz_zhu {
 
2985
              ## Tau is an anisotropic estimate for the H1 seminorm of the
 
2986
              ## error. This estimator is efficient and reliable, under the
 
2987
              ## caveat that the initial mesh is sufficiently fine so as to
 
2988
              ## prevent data oscillation. (Micheletti & Perotto, 2006)
 
2989
              ## Typically, tau will be ~= 6-8 * |e|_H1.
 
2990
              element tau {
 
2991
                real
 
2992
              }
 
2993
            }
 
2994
         ),
 
2995
         adaptivity_preprocessing
 
2996
      }?
 
2997
   )
 
2998
 
 
2999
adaptivity_options_scalar_field.adaptivity_options =
 
3000
   (
 
3001
      ## When specifying absolute measure
 
3002
      ## one specifies the absolute interpolation 
 
3003
      ## error in the units of the field that is 
 
3004
      ## being adapted, e.g. you can specify
 
3005
      ## the error to be 1.3 units 
 
3006
      element absolute_measure {
 
3007
         attribute replaces { "ADOPTT = 0" },
 
3008
         element scalar_field {
 
3009
            attribute rank { "0" },
 
3010
            attribute name { "InterpolationErrorBound" },
 
3011
            attribute replaces { "ADWEIT" },
 
3012
            element prescribed {
 
3013
               prescribed_scalar_field_no_adapt
 
3014
            }
 
3015
         }
 
3016
      }|
 
3017
      ## When specifying relative measure
 
3018
      ## one specifies the interpolation error
 
3019
      ## relative to the field that is
 
3020
      ## being adapted, e.g. you can specify
 
3021
      ## the error to be 5% (i.e. 0.05)
 
3022
      element relative_measure {
 
3023
         attribute replaces { "ADOPTT = 1" },
 
3024
         element scalar_field {
 
3025
            attribute rank { "0" },
 
3026
            attribute name { "InterpolationErrorBound" },
 
3027
            attribute replaces { "ADADOT" },
 
3028
            element prescribed {
 
3029
               prescribed_scalar_field_no_adapt
 
3030
            }
 
3031
         },
 
3032
         ## The relative Hessian is calculated according to:
 
3033
         ##
 
3034
         ##   Q = H / max{ |psi|, psi_min}
 
3035
         ##
 
3036
         ## where H is the Hessian, psi is the field value and
 
3037
         ## psi_min is the tolerance. The tolerance prevents
 
3038
         ## division by zero errors.
 
3039
         ##
 
3040
         ## Source: Fluidity/ICOM manual draft version 1.2
 
3041
         element tolerance {
 
3042
            attribute replaces { "ADATOT" },
 
3043
            real
 
3044
         }
 
3045
      }|
 
3046
      ## Adapt using the anisotropic strategy of 
 
3047
      ## Formaggia, Perotto, Micheletti.
 
3048
      ## Rather than taking two derivatives
 
3049
      ## and deriving the anisotropic information,
 
3050
      ## this approach computes an anisotropic Zienkiewicz-Zhu
 
3051
      ## error estimator for each element. The approach then
 
3052
      ## optimises the element orientation and length scales
 
3053
      ## to equidistribute the estimated error.
 
3054
      element anisotropic_zienkiewicz_zhu {
 
3055
        ## Tau is an anisotropic estimate for the H1 seminorm of the
 
3056
        ## error. This estimator is efficient and reliable, under the
 
3057
        ## caveat that the initial mesh is sufficiently fine so as to
 
3058
        ## prevent data oscillation. (Micheletti & Perotto, 2006)
 
3059
        ## Typically, tau will be ~= 6-8 * |e|_H1.
 
3060
        element tau {
 
3061
          real
 
3062
        }
 
3063
      }
 
3064
   )
 
3065
adaptivity_options_scalar_field =
 
3066
   (
 
3067
      element adaptivity_options {
 
3068
         adaptivity_options_scalar_field.adaptivity_options,
 
3069
         adaptivity_preprocessing
 
3070
      }?
 
3071
   )
 
3072
 
 
3073
adaptivity_options_prognostic_vector_field =
 
3074
   (
 
3075
      ## Adaptivity weights
 
3076
      element adaptivity_options {
 
3077
         (
 
3078
            ## When specifying absolute measure
 
3079
            ## one specifies the absolute interpolation 
 
3080
            ## error in the units of the field that is 
 
3081
            ## being adapted, e.g. you can specify
 
3082
            ## the error to be 1.3 units 
 
3083
            element absolute_measure {
 
3084
               element vector_field {
 
3085
                  attribute rank { "1" },
 
3086
                  attribute name { "InterpolationErrorBound" },
 
3087
                  attribute replaces { "ADWEIU ADWEIV ADWEIW" },
 
3088
                  element prescribed {
 
3089
                     prescribed_vector_field_no_adapt
 
3090
                  }
 
3091
               }
 
3092
            }|
 
3093
            ## When specifying relative measure
 
3094
            ## one specifies the interpolation error
 
3095
            ## relative to the field that is
 
3096
            ## being adapted, e.g. you can specify
 
3097
            ## the error to be 5% (i.e. 0.05)
 
3098
            element relative_measure {
 
3099
               element vector_field {
 
3100
                  attribute rank { "1" },
 
3101
                  attribute name { "InterpolationErrorBound" },
 
3102
                  attribute replaces { "ADATOU ADATOV ADATOW" },
 
3103
                  element prescribed {
 
3104
                     prescribed_vector_field_no_adapt
 
3105
                  }
 
3106
               },
 
3107
               ## The relative Hessian is calculated according to:
 
3108
               ##
 
3109
               ##   Q = H / max{ |psi|, psi_min}
 
3110
               ##
 
3111
               ## where H is the Hessian, psi is the field value and
 
3112
               ## psi_min is the tolerance. The tolerance prevents
 
3113
               ## division by zero errors.
 
3114
               ##
 
3115
               ## Source: Fluidity/ICOM manual draft version 1.2
 
3116
               element tolerance {
 
3117
                  real_dim_vector
 
3118
               }
 
3119
            }
 
3120
         ),
 
3121
         adaptivity_preprocessing
 
3122
      }?
 
3123
   )
 
3124
 
 
3125
adaptivity_options_vector_field =
 
3126
   (
 
3127
      ## Adaptivity weights
 
3128
      element adaptivity_options {
 
3129
         (
 
3130
            ## When specifying absolute measure
 
3131
            ## one specifies the absolute interpolation 
 
3132
            ## error in the units of the field that is 
 
3133
            ## being adapted, e.g. you can specify
 
3134
            ## the error to be 1.3 units 
 
3135
            element absolute_measure {
 
3136
               element vector_field {
 
3137
                  attribute rank { "1" },
 
3138
                  attribute name { "InterpolationErrorBound" },
 
3139
                  attribute replaces { "ADWEIU ADWEIV ADWEIW" },
 
3140
                  element prescribed {
 
3141
                     prescribed_vector_field_no_adapt
 
3142
                  }
 
3143
               }
 
3144
            }|
 
3145
            ## When specifying relative measure
 
3146
            ## one specifies the interpolation error
 
3147
            ## relative to the field that is
 
3148
            ## being adapted, e.g. you can specify
 
3149
            ## the error to be 5% (i.e. 0.05)
 
3150
            element relative_measure {
 
3151
               element vector_field {
 
3152
                  attribute rank { "1" },
 
3153
                  attribute name { "InterpolationErrorBound" },
 
3154
                  attribute replaces { "ADATOU ADATOV ADATOW" },
 
3155
                  element prescribed {
 
3156
                     prescribed_vector_field_no_adapt
 
3157
                  }
 
3158
               },
 
3159
               ## The relative Hessian is calculated according to:
 
3160
               ##
 
3161
               ##   Q = H / max{ |psi|, psi_min}
 
3162
               ##
 
3163
               ## where H is the Hessian, psi is the field value and
 
3164
               ## psi_min is the tolerance. The tolerance prevents
 
3165
               ## division by zero errors.
 
3166
               ##
 
3167
               ## Source: Fluidity/ICOM manual draft version 1.2
 
3168
               element tolerance {
 
3169
                  real_dim_vector
 
3170
               }
 
3171
            }
 
3172
         ),
 
3173
         adaptivity_preprocessing
 
3174
      }?
 
3175
   )
 
3176
 
 
3177
adaptivity_options_prognostic_tensor_field =
 
3178
   (
 
3179
      ## Adaptivity weights
 
3180
      element adaptivity_options {
 
3181
         (
 
3182
            ## When specifying absolute measure
 
3183
            ## one specifies the absolute interpolation 
 
3184
            ## error in the units of the field that is 
 
3185
            ## being adapted, e.g. you can specify
 
3186
            ## the error to be 1.3 units 
 
3187
            element absolute_measure {
 
3188
               element tensor_field {
 
3189
                  attribute rank { "2" },
 
3190
                  attribute name { "InterpolationErrorBound" },
 
3191
                  element prescribed {
 
3192
                     prescribed_values_tensor_field
 
3193
                  }
 
3194
               }
 
3195
            }|
 
3196
            ## When specifying relative measure
 
3197
            ## one specifies the interpolation error
 
3198
            ## relative to the field that is
 
3199
            ## being adapted, e.g. you can specify
 
3200
            ## the error to be 5% (i.e. 0.05)
 
3201
            element relative_measure {
 
3202
               element tensor_field {
 
3203
                  attribute rank { "2" },
 
3204
                  attribute name { "InterpolationErrorBound" },
 
3205
                  element prescribed {
 
3206
                     prescribed_values_tensor_field
 
3207
                  }
 
3208
               },
 
3209
               ## The relative Hessian is calculated according to:
 
3210
               ##
 
3211
               ##   Q = H / max{ |psi|, psi_min}
 
3212
               ##
 
3213
               ## where H is the Hessian, psi is the field value and
 
3214
               ## psi_min is the tolerance. The tolerance prevents
 
3215
               ## division by zero errors.
 
3216
               ##
 
3217
               ## Source: Fluidity/ICOM manual draft version 1.2
 
3218
               element tolerance {
 
3219
                  real_dim_tensor
 
3220
               }
 
3221
            }
 
3222
         ),
 
3223
         adaptivity_preprocessing
 
3224
      }?
 
3225
   )
 
3226
 
 
3227
adaptivity_options_tensor_field =
 
3228
   (
 
3229
      ## Adaptivity weights
 
3230
      element adaptivity_options {
 
3231
         (
 
3232
            ## When specifying absolute measure
 
3233
            ## one specifies the absolute interpolation 
 
3234
            ## error in the units of the field that is 
 
3235
            ## being adapted, e.g. you can specify
 
3236
            ## the error to be 1.3 units 
 
3237
            element absolute_measure {
 
3238
               element tensor_field {
 
3239
                  attribute rank { "2" },
 
3240
                  attribute name { "InterpolationErrorBound" },
 
3241
                  element prescribed {
 
3242
                     prescribed_values_tensor_field
 
3243
                  }
 
3244
               }
 
3245
            }|
 
3246
            ## When specifying relative measure
 
3247
            ## one specifies the interpolation error
 
3248
            ## relative to the field that is
 
3249
            ## being adapted, e.g. you can specify
 
3250
            ## the error to be 5% (i.e. 0.05)
 
3251
            element relative_measure {
 
3252
               element tensor_field {
 
3253
                  attribute rank { "2" },
 
3254
                  attribute name { "InterpolationErrorBound" },
 
3255
                  element prescribed {
 
3256
                     prescribed_values_tensor_field
 
3257
                  }
 
3258
               },
 
3259
               ## The relative Hessian is calculated according to:
 
3260
               ##
 
3261
               ##   Q = H / max{ |psi|, psi_min}
 
3262
               ##
 
3263
               ## where H is the Hessian, psi is the field value and
 
3264
               ## psi_min is the tolerance. The tolerance prevents
 
3265
               ## division by zero errors.
 
3266
               ##
 
3267
               ## Source: Fluidity/ICOM manual draft version 1.2
 
3268
               element tolerance {
 
3269
                  real_dim_tensor
 
3270
               }
 
3271
            }
 
3272
         ),
 
3273
         adaptivity_preprocessing
 
3274
      }?
 
3275
   )
 
3276
generic_aliased_field =
 
3277
   (
 
3278
      attribute material_phase_name { xsd:string },
 
3279
      attribute field_name { xsd:string }
 
3280
   )
 
3281
 
 
3282
# Most common mesh choices
 
3283
mesh_choice = 
 
3284
   (
 
3285
      element mesh {
 
3286
         attribute name { xsd:string }
 
3287
      }|
 
3288
      element mesh {
 
3289
         attribute name { "CoordinateMesh" }
 
3290
      }|
 
3291
      element mesh {
 
3292
         attribute name { "VelocityMesh" }
 
3293
      }|
 
3294
      element mesh {
 
3295
         attribute name { "PressureMesh" }
 
3296
      }
 
3297
   )
 
3298
 
 
3299
# Not really a choice, for fields that have to be on the velocity mesh
 
3300
# currently that's all scalar fields, except pressure
 
3301
# and of course velocity itself
 
3302
# If you want to implement scalar fields on other meshes, feel free to do so
 
3303
# but bare in mind you need to make sure the field stays outside RMEM.
 
3304
# Currently all scalar fields are packed in RMEM with length nonods
 
3305
velocity_mesh_choice =
 
3306
   (
 
3307
      (
 
3308
         element mesh {
 
3309
            attribute name { "VelocityMesh" }
 
3310
         }|
 
3311
         element mesh {
 
3312
            attribute name { "PressureMesh" }
 
3313
         }|
 
3314
         element mesh {
 
3315
            attribute name { "CoordinateMesh" }
 
3316
         }|
 
3317
         element mesh {
 
3318
            attribute name { string }
 
3319
         }
 
3320
      )
 
3321
   )
 
3322
 
 
3323
pressure_mesh_choice =
 
3324
   (
 
3325
      (
 
3326
         element mesh {
 
3327
            attribute name { "PressureMesh" }
 
3328
         }|
 
3329
         element mesh {
 
3330
            attribute name { "VelocityMesh" }
 
3331
         }|
 
3332
         element mesh {
 
3333
            attribute name { "CoordinateMesh" }
 
3334
         }|
 
3335
         element mesh {
 
3336
            attribute name { string }
 
3337
         }
 
3338
      )
 
3339
   )
 
3340
 
 
3341
# This is the choice of additional scalar field to be solved for
 
3342
scalar_field_choice =
 
3343
   (
 
3344
# The first is a generic field, which may be used for any user-defined field
 
3345
# that FLUIDITY knows nothing about, or a generic diagnostic
 
3346
      (
 
3347
         element scalar_field {
 
3348
            attribute rank { "0" },
 
3349
            attribute name { xsd:string },
 
3350
            ## Field type
 
3351
            (
 
3352
               element prognostic {
 
3353
                  velocity_mesh_choice,
 
3354
                  prognostic_scalar_field
 
3355
               }|
 
3356
               element prescribed {
 
3357
                  velocity_mesh_choice,
 
3358
                  prescribed_scalar_field
 
3359
               }|
 
3360
               element diagnostic {
 
3361
                  scalar_diagnostic_algorithms,
 
3362
                  velocity_mesh_choice,
 
3363
                  python_diagnostic_field_code?,
 
3364
                  diagnostic_scalar_field
 
3365
               }|
 
3366
               element aliased {
 
3367
                  generic_aliased_field
 
3368
               }
 
3369
            )
 
3370
         }|
 
3371
         ## Prognostic scalar fields below this
 
3372
         element ___Prognostic_Fields_Below___ {
 
3373
            empty
 
3374
         }|
 
3375
 
 
3376
# This is the long list of fields that FLUIDITY knows about
 
3377
# -- First is a list of fields that are primarily prognostic,
 
3378
#    but can be set to prescribed, or aliased...
 
3379
# -- The list is in order of most frequently used.
 
3380
 
 
3381
         ## Salinity
 
3382
         element scalar_field {
 
3383
            attribute rank { "0" },
 
3384
            attribute name { "Salinity" },
 
3385
            attribute replaces { "IDENT = 42" },
 
3386
            (
 
3387
               element prognostic {
 
3388
                  velocity_mesh_choice,
 
3389
                  prognostic_scalar_field
 
3390
               }|
 
3391
               element prescribed {
 
3392
                  velocity_mesh_choice,
 
3393
                  prescribed_scalar_field
 
3394
               }|
 
3395
               element aliased {
 
3396
                  generic_aliased_field
 
3397
               }
 
3398
            )
 
3399
         }|
 
3400
         ## Temperature
 
3401
         element scalar_field {
 
3402
            attribute rank { "0" },
 
3403
            attribute name { "Temperature" },
 
3404
            attribute replaces { "IDENT = -1" },
 
3405
            (
 
3406
               element prognostic {
 
3407
                  velocity_mesh_choice,
 
3408
                  prognostic_scalar_field
 
3409
               }|
 
3410
               element prescribed {
 
3411
                  velocity_mesh_choice,
 
3412
                  prescribed_scalar_field
 
3413
               }|
 
3414
               element aliased {
 
3415
                  generic_aliased_field
 
3416
               }
 
3417
            )
 
3418
         }|
 
3419
         ## Background Temperature
 
3420
         element scalar_field {
 
3421
            attribute rank { "0" },
 
3422
            attribute name { "BackgroundTemperature" },
 
3423
            (
 
3424
               element prescribed {
 
3425
                  velocity_mesh_choice,
 
3426
                  prescribed_scalar_field
 
3427
               }
 
3428
            )
 
3429
         }|
 
3430
         ## Passive Tracer
 
3431
         element scalar_field {
 
3432
            attribute rank { "0" },
 
3433
            attribute name { "Tracer" },
 
3434
            attribute replaces { "IDENT = 666" },
 
3435
            (
 
3436
               element prognostic {
 
3437
                  velocity_mesh_choice,
 
3438
                  prognostic_scalar_field
 
3439
               }|
 
3440
               element prescribed {
 
3441
                  velocity_mesh_choice,
 
3442
                  prescribed_scalar_field
 
3443
               }|
 
3444
               element aliased {
 
3445
                  generic_aliased_field
 
3446
               }
 
3447
            )
 
3448
         }|
 
3449
         ## Free Surface
 
3450
         ## NOTE: the prognostic FreeSurface field only works with the
 
3451
         ## legacy_continuous_galerkin code path
 
3452
         ## NOTE: if you are using the free_surface boundary condition
 
3453
         ## applied to the Velocity field (recommended), you should not 
 
3454
         ## use the prognostic FreeSurface field. In this case you may 
 
3455
         ## (optionally) add a diagnostic FreeSurface field.
 
3456
         element scalar_field {
 
3457
            attribute rank { "0" },
 
3458
            attribute name { "FreeSurface" },
 
3459
            (
 
3460
               ## Free Surface
 
3461
               ## NOTE: the prognostic FreeSurface field only works with the
 
3462
               ## legacy_continuous_galerkin code path
 
3463
               element prognostic {
 
3464
                  ## Note that this is not the quadratic mesh balance pressure is
 
3465
                  ## actually calculated on, but the linear mesh it is projected back
 
3466
                  ## on for output purposes.
 
3467
                  element mesh {
 
3468
                     attribute name { "VelocityMesh" }
 
3469
                  },
 
3470
                  prognostic_free_surface_field
 
3471
               }|
 
3472
               ## Free Surface
 
3473
               ## NOTE: the diagnostic FreeSurface field only works in combination
 
3474
               ## with the free_surface boundary condition applied to the Velocity
 
3475
               ## field. It gives you a 3D field (constant over the vertical)
 
3476
               ## of the free surface elevation.
 
3477
               element diagnostic {
 
3478
                  internal_algorithm,
 
3479
                  # this is hard-coded on the PressureMesh as long as the Pressure is
 
3480
                  # if this is no longer true, it should be option-checked to be on the
 
3481
                  # same mesh as Pressure
 
3482
                  ## Must be on the same mesh as Pressure
 
3483
                  element mesh {
 
3484
                     attribute name { "PressureMesh" }
 
3485
                  },
 
3486
                  diagnostic_scalar_field
 
3487
               }
 
3488
               
 
3489
            )
 
3490
         }|
 
3491
         ## Second Fluid
 
3492
         element scalar_field {
 
3493
            attribute rank { "0" },
 
3494
            attribute name { "SecondFluid" },
 
3495
            attribute replaces { "IDENT = 56" },
 
3496
            (
 
3497
               element prognostic {
 
3498
                  velocity_mesh_choice,
 
3499
                  prognostic_scalar_field
 
3500
               }|
 
3501
               element prescribed {
 
3502
                  velocity_mesh_choice,
 
3503
                  prescribed_scalar_field
 
3504
               }|
 
3505
               element aliased {
 
3506
                  generic_aliased_field
 
3507
               }
 
3508
            )
 
3509
         }|
 
3510
         ## Diffuse Interface
 
3511
         element scalar_field {
 
3512
            attribute rank { "0" },
 
3513
            attribute name { "DiffuseInterface" },
 
3514
            attribute replaces { "IDENT = 57" },
 
3515
            (
 
3516
               element prognostic {
 
3517
                  velocity_mesh_choice,
 
3518
                  prognostic_scalar_field
 
3519
               }|
 
3520
               element prescribed {
 
3521
                  velocity_mesh_choice,
 
3522
                  prescribed_scalar_field
 
3523
               }|
 
3524
               element aliased {
 
3525
                  generic_aliased_field
 
3526
               }
 
3527
            )
 
3528
         }|
 
3529
         element scalar_field {
 
3530
            attribute rank { "0" },
 
3531
            attribute name { "BalancePressure" },
 
3532
            attribute replaces { "IDENT = -2003" },
 
3533
            (
 
3534
               element prognostic {
 
3535
                  # Note the assumptions about quadratic/linear below and hard-coding
 
3536
                  # of the mesh, this is because of restrictions of the
 
3537
                  # current code, will change in the near future.
 
3538
                  ## Note that this is not the quadratic mesh balance pressure is
 
3539
                  ## actually calculated on, but the linear mesh it is projected back
 
3540
                  ## on for output purposes.
 
3541
                  element mesh {
 
3542
                     attribute name {  "VelocityMesh" }
 
3543
                  },
 
3544
                  prognostic_balance_pressure_field
 
3545
               }
 
3546
            )
 
3547
         }|
 
3548
         ## If enabled, decomposes Pressure by solving for the balanced part of 
 
3549
         ## Pressure using a "geopressure" solver:
 
3550
         ## 
 
3551
         ##   f = - grad p_gp + g
 
3552
         ##
 
3553
         ## By choosing an appropriate mesh (typically velocity mesh order + 1)
 
3554
         ## for the balanced part of pressure, physical balance can be
 
3555
         ## represented to a higher degree of accuracy.
 
3556
         ##
 
3557
         ## Expanded BalancePressure field. As BalancePressure, but with
 
3558
         ## additional options, including the ability to choose a general
 
3559
         ## mesh for the geopressure solver.
 
3560
         element scalar_field {
 
3561
            attribute rank { "0" },
 
3562
            attribute name { "GeostrophicPressure" },
 
3563
            attribute replaces { "IDENT = -2003" },
 
3564
            (
 
3565
               element prognostic {
 
3566
                  ## The GeostrophicPressure mesh
 
3567
                  ## 
 
3568
                  ## <b>WARNING: It is usual for this to be a higher degree
 
3569
                  ## mesh than the velocity mesh</b>
 
3570
                  element mesh {
 
3571
                     attribute name { xsd:string },
 
3572
                     comment
 
3573
                  },
 
3574
                  prognostic_geostrophic_pressure_field
 
3575
               }
 
3576
            )
 
3577
         }|
 
3578
         element scalar_field {
 
3579
            attribute rank { "0" },
 
3580
            attribute name { "VerticalBalancePressure" },
 
3581
            (
 
3582
               element prognostic {
 
3583
                  ## This needs to be a quadratic DG mesh
 
3584
                  mesh_choice,
 
3585
                  prognostic_vertical_balance_pressure_field
 
3586
               }
 
3587
            )
 
3588
         }|
 
3589
         ## MaterialVolumeFraction field:
 
3590
         ##
 
3591
         ## Volume fraction of this material.
 
3592
         ## Required in multimaterial simulations.
 
3593
         ##  - if prognostic solves for the volume fraction
 
3594
         ##  - if prescribed uses a specified volume fraction
 
3595
         ##  - if diagnostic solves for the final material volume fraction
 
3596
         ## Only 1 diagnostic MaterialVolumeFraction field allowed per
 
3597
         ## simulation or solves for all the volume fractions based on
 
3598
         ## the SumMaterialVolumeFractions field.
 
3599
         ## 
 
3600
         ## A diagnostic MaterialVolumeFraction field is currently required for
 
3601
         ## compressible multimaterial simulations (even if only 1 material).
 
3602
         ## Generally also requires a MaterialDensity field.
 
3603
         element scalar_field {
 
3604
            attribute rank { "0" },
 
3605
            attribute name { "MaterialVolumeFraction" },
 
3606
            (
 
3607
               element prognostic {
 
3608
                  velocity_mesh_choice,
 
3609
                  prognostic_scalar_field,
 
3610
                  cap_option?,
 
3611
                  surface_tension_option?
 
3612
               }|
 
3613
               element diagnostic {
 
3614
                  internal_algorithm,
 
3615
                  velocity_mesh_choice,
 
3616
                  diagnostic_scalar_field,
 
3617
                  cap_option?
 
3618
               }|
 
3619
               element prescribed {
 
3620
                  velocity_mesh_choice,
 
3621
                  prescribed_scalar_field,
 
3622
                  cap_option?
 
3623
               }|
 
3624
               element aliased {
 
3625
                  generic_aliased_field
 
3626
               }
 
3627
            )
 
3628
         }|
 
3629
         ## MaterialDensity field:
 
3630
         ##
 
3631
         ## Field for the density of this material.
 
3632
         ## Required in multimaterial simulations.
 
3633
         ##  - prescribed if an incompressible simulation
 
3634
         ##  - diagnostic if using a linear equation of state
 
3635
         ##  - prognostic if a compressible simulation
 
3636
         ## (note that if you set a multimaterial
 
3637
         ## equation of state and this field is
 
3638
         ## prognostic then its initial condition
 
3639
         ## will be overwritten by the density that
 
3640
         ## satisfies the initial pressure and
 
3641
         ## the equation of state)
 
3642
         element scalar_field {
 
3643
            attribute rank { "0" },
 
3644
            attribute name { "MaterialDensity" },
 
3645
            (
 
3646
               element prognostic {
 
3647
                  velocity_mesh_choice,
 
3648
                  prognostic_scalar_field
 
3649
               }|
 
3650
               element diagnostic {
 
3651
                  internal_algorithm,
 
3652
                  velocity_mesh_choice,
 
3653
                  diagnostic_scalar_field
 
3654
               }|
 
3655
               element prescribed {
 
3656
                  velocity_mesh_choice,
 
3657
                  prescribed_scalar_field
 
3658
               }|
 
3659
               element aliased {
 
3660
                  generic_aliased_field
 
3661
               }
 
3662
            )
 
3663
         }|
 
3664
         ## MaterialInternalEnergy field:
 
3665
         ##
 
3666
         ## Field for the internal energy of this material.
 
3667
         ## Required in multimaterial compressible simulations
 
3668
         ## with full miegrunneisen (perfect gas) eos.
 
3669
         element scalar_field {
 
3670
            attribute rank { "0" },
 
3671
            attribute name { "MaterialInternalEnergy" },
 
3672
            (
 
3673
               element prognostic {
 
3674
                  velocity_mesh_choice,
 
3675
                  prognostic_scalar_field
 
3676
               }|
 
3677
               element aliased {
 
3678
                  generic_aliased_field
 
3679
               }
 
3680
            )
 
3681
         }|
 
3682
         ## SumMaterialVolumeFractions field:
 
3683
         ##
 
3684
         ## Sums the prognostic MaterialVolumeFraction fields.
 
3685
         ## - diagnostic: sums all the volume fractions in the other
 
3686
         ##   material phases
 
3687
         element scalar_field {
 
3688
            attribute rank { "0" },
 
3689
            attribute name { "SumMaterialVolumeFractions" },
 
3690
            (
 
3691
               element diagnostic {
 
3692
                  internal_algorithm,
 
3693
                  velocity_mesh_choice,
 
3694
                  diagnostic_scalar_field
 
3695
               }|
 
3696
               element aliased {
 
3697
                  generic_aliased_field
 
3698
               }
 
3699
            )
 
3700
         }|
 
3701
         ## CopiedField - This field copies the previous timesteps
 
3702
         ## values from another (specified) field at every iteration
 
3703
         ## and then solves the field using different (again, specified)
 
3704
         ## scheme and solution options.
 
3705
         ## For instance, this field can be used to create a diffused
 
3706
         ## field to adapt to.
 
3707
         ## Unless someone requests otherwise this is only currently possible
 
3708
         ## for fields within the same material_phase.
 
3709
         element scalar_field {
 
3710
            attribute rank { "0" },
 
3711
            attribute name { "CopiedField" },
 
3712
            (
 
3713
               element prognostic {
 
3714
                  velocity_mesh_choice,
 
3715
                  attribute copy_from_field { string },
 
3716
                  prognostic_scalar_field
 
3717
               }
 
3718
            )
 
3719
         }|
 
3720
         ## Calculate the stream function of 2D incompressible flow. Note 
 
3721
         ## that this *only* makes sense for proper 2D (not pseudo-2D) simulations.
 
3722
         ## Requires a continuous mesh.
 
3723
         element scalar_field {
 
3724
            attribute rank { "0" },
 
3725
            attribute name { "StreamFunction" },
 
3726
            (
 
3727
               element prognostic {
 
3728
                  mesh_choice,
 
3729
                  prognostic_stream_function_field
 
3730
               }
 
3731
            )
 
3732
         }|
 
3733
         ## Phytoplankton
 
3734
         element scalar_field {
 
3735
            attribute rank { "0" },
 
3736
            attribute name { "Phytoplankton" },
 
3737
            (
 
3738
               element prognostic {
 
3739
                  velocity_mesh_choice,
 
3740
                  prognostic_scalar_field
 
3741
               }|
 
3742
               element prescribed {
 
3743
                  velocity_mesh_choice,
 
3744
                  prescribed_scalar_field
 
3745
               }
 
3746
            )
 
3747
         }|
 
3748
         ## Zooplankton
 
3749
         element scalar_field {
 
3750
            attribute rank { "0" },
 
3751
            attribute name { "Zooplankton" },
 
3752
            (
 
3753
               element prognostic {
 
3754
                  velocity_mesh_choice,
 
3755
                  prognostic_scalar_field
 
3756
               }|
 
3757
               element prescribed {
 
3758
                  velocity_mesh_choice,
 
3759
                  prescribed_scalar_field
 
3760
               }
 
3761
            )
 
3762
         }|
 
3763
         ## Nutrient
 
3764
         element scalar_field {
 
3765
            attribute rank { "0" },
 
3766
            attribute name { "Nutrient" },
 
3767
            (
 
3768
               element prognostic {
 
3769
                  velocity_mesh_choice,
 
3770
                  prognostic_scalar_field
 
3771
               }|
 
3772
               element prescribed {
 
3773
                  velocity_mesh_choice,
 
3774
                  prescribed_scalar_field
 
3775
               }
 
3776
            )
 
3777
         }|
 
3778
         ## Detritus
 
3779
         element scalar_field {
 
3780
            attribute rank { "0" },
 
3781
            attribute name { "Detritus" },
 
3782
            (
 
3783
               element prognostic {
 
3784
                  velocity_mesh_choice,
 
3785
                  prognostic_scalar_field
 
3786
               }|
 
3787
               element prescribed {
 
3788
                  velocity_mesh_choice,
 
3789
                  prescribed_scalar_field
 
3790
               }
 
3791
            )
 
3792
         }|
 
3793
 
 
3794
         ## PhaseVolumeFraction:
 
3795
         ## Required in porous_media problem type
 
3796
         element scalar_field {
 
3797
            attribute rank { "0" },
 
3798
            attribute name { "PhaseVolumeFraction" },
 
3799
            (
 
3800
               element prognostic {
 
3801
                  velocity_mesh_choice,
 
3802
                  prognostic_scalar_field
 
3803
               }|
 
3804
               element prescribed {
 
3805
                  velocity_mesh_choice,
 
3806
                  prescribed_scalar_field
 
3807
               }
 
3808
            )
 
3809
         }|
 
3810
 
 
3811
         ## Electrical Potential:
 
3812
         ## Required in electrokinetic, electrothermal
 
3813
         ## and electrochemical problems
 
3814
         ## (sub-option of porous_media problem type)
 
3815
         element scalar_field {
 
3816
            attribute rank { "0" },
 
3817
            attribute name { "ElectricalPotential" },
 
3818
            (
 
3819
               element prognostic {
 
3820
                  velocity_mesh_choice,
 
3821
                  prognostic_scalar_field
 
3822
               }
 
3823
            )
 
3824
         }|
 
3825
 
 
3826
         # Insert new prognostic scalar fields here using the template:
 
3827
         #        element scalar_field {
 
3828
         #            attribute rank { "0" },
 
3829
         #            attribute name { "NewFieldName" },
 
3830
         #            (
 
3831
         #               element prognostic {
 
3832
         #                  velocity_mesh_choice,
 
3833
         #                  prognostic_scalar_field
 
3834
         #               }|
 
3835
         #               element prescribed {
 
3836
         #                  velocity_mesh_choice,
 
3837
         #                  prescribed_scalar_field
 
3838
         #               }|
 
3839
         #               element aliased {
 
3840
         #                  generic_aliased_field
 
3841
         #               }
 
3842
         #            )
 
3843
         #        }
 
3844
         
 
3845
# -- Second is a list of fields that are primarily prescribed,
 
3846
#    but can be aliased. An example is wind velocity.
 
3847
# -- The list is in order of most frequently used.
 
3848
 
 
3849
         ## Prescribed scalar fields below this
 
3850
         element ___Prescribed_fields_below___ {
 
3851
            empty
 
3852
         }|
 
3853
         element scalar_field {
 
3854
            attribute rank { "0" },
 
3855
            attribute name { "DistanceToSideBoundaries" },
 
3856
            attribute replaces { "IDENT = -144" },
 
3857
            (
 
3858
               element prescribed {
 
3859
                  velocity_mesh_choice,
 
3860
                  prescribed_scalar_field
 
3861
               }|
 
3862
               element aliased {
 
3863
                  generic_aliased_field
 
3864
               }
 
3865
            )
 
3866
         }|
 
3867
         ## MaterialFrictionAngle for multimaterial
 
3868
         ## plasticity problems
 
3869
         ##
 
3870
         ## Requires a diagnostic bulk FrictionAngle field
 
3871
         ## - not tested yet
 
3872
         element scalar_field {
 
3873
            attribute rank { "0" },
 
3874
            attribute name { "MaterialFrictionAngle" },
 
3875
            (
 
3876
               element prescribed {
 
3877
                  velocity_mesh_choice,
 
3878
                  prescribed_scalar_field
 
3879
               }|
 
3880
               element aliased {
 
3881
                  generic_aliased_field
 
3882
               }
 
3883
            )
 
3884
         }|
 
3885
         ## MaterialCohesion for multimaterial
 
3886
         ## plasticity problems
 
3887
         ##
 
3888
         ## Requires a diagnostic bulk Cohesion field
 
3889
         ## - not tested yet
 
3890
         element scalar_field {
 
3891
            attribute rank { "0" },
 
3892
            attribute name { "MaterialCohesion" },
 
3893
            (
 
3894
               element prescribed {
 
3895
                  velocity_mesh_choice,
 
3896
                  prescribed_scalar_field
 
3897
               }|
 
3898
               element aliased {
 
3899
                  generic_aliased_field
 
3900
               }
 
3901
            )
 
3902
         }|
 
3903
#
 
3904
# Insert new prescribed scalar fields here using the template:
 
3905
#        element scalar_field {
 
3906
#            attribute rank { "0" },
 
3907
#            attribute name { "NewFieldName" },
 
3908
#            (
 
3909
#               element prescribed {
 
3910
#                  velocity_mesh_choice,
 
3911
#                  prescribed_scalar_field
 
3912
#               }|
 
3913
#               element aliased {
 
3914
#                  generic_aliased_field
 
3915
#               }
 
3916
#            )
 
3917
#        }
 
3918
#
 
3919
# -- Last is a list of fields that are primarily diagnostic,
 
3920
#    but can be aliased. An example is Tidal Range.
 
3921
# -- The list is in order of most frequently used.
 
3922
#
 
3923
         ## Diagnostic scalar fields below this
 
3924
         element ___Diagnostic_Fields_Below___ {
 
3925
            empty
 
3926
         }|
 
3927
         element scalar_field {
 
3928
            attribute rank { "0" },
 
3929
            attribute name { "PerturbationDensity" },
 
3930
            attribute replaces { "IDENT = -143" },
 
3931
            (
 
3932
               element diagnostic {
 
3933
                  internal_algorithm,
 
3934
                  velocity_mesh_choice,
 
3935
                  diagnostic_scalar_field
 
3936
               }|
 
3937
               element aliased {
 
3938
                  generic_aliased_field
 
3939
               }
 
3940
            )
 
3941
         }|
 
3942
         ## ControlVolumeDivergence:
 
3943
         ##
 
3944
         ## div field
 
3945
         ##
 
3946
         ## Divergence of the velocity field where
 
3947
         ## the divergence operator is defined using
 
3948
         ## the control volume C^T matrix.
 
3949
         ## This assumes that the test space is discontinuous
 
3950
         ## control volumes.
 
3951
         element scalar_field {
 
3952
            attribute rank { "0" },
 
3953
            attribute name { "ControlVolumeDivergence" },
 
3954
            (
 
3955
               element diagnostic {
 
3956
                  internal_algorithm,
 
3957
                  attribute field_name { string },
 
3958
                  velocity_mesh_choice,
 
3959
                  diagnostic_cv_divergence_scalar_field
 
3960
               }|
 
3961
               element aliased {
 
3962
                  generic_aliased_field
 
3963
               }
 
3964
            )
 
3965
         }|
 
3966
 
 
3967
         ## FiniteElementDivergence:
 
3968
         ##
 
3969
         ## div field
 
3970
         ##
 
3971
         ## Divergence of the velocity field where
 
3972
         ## the divergence operator is defined using
 
3973
         ## the finite element C^T matrix.
 
3974
         element scalar_field {
 
3975
            attribute rank { "0" },
 
3976
            attribute name { "FiniteElementDivergence" },
 
3977
            (
 
3978
               element diagnostic {
 
3979
                  internal_algorithm,
 
3980
                  attribute field_name { string },
 
3981
                  velocity_mesh_choice,
 
3982
                  element integrate_divergence_by_parts {
 
3983
                     empty
 
3984
                  }?,
 
3985
                  diagnostic_fe_divergence_scalar_field
 
3986
               }|
 
3987
               element aliased {
 
3988
                  generic_aliased_field
 
3989
               }
 
3990
            )
 
3991
         }|
 
3992
         ## Diffusive dissipation
 
3993
         element scalar_field {
 
3994
            attribute rank { "0" },
 
3995
            attribute name { "DiffusiveDissipation" },
 
3996
            (
 
3997
               element diagnostic {
 
3998
                  internal_algorithm,
 
3999
                  velocity_mesh_choice,
 
4000
                  diagnostic_scalar_field
 
4001
               }|
 
4002
               element aliased {
 
4003
                  generic_aliased_field
 
4004
               }
 
4005
            )
 
4006
         }|
 
4007
         ## Viscous dissipation
 
4008
         element scalar_field {
 
4009
            attribute rank { "0" },
 
4010
            attribute name { "ViscousDissipation" },
 
4011
            (
 
4012
               element diagnostic {
 
4013
                  internal_algorithm,
 
4014
                  velocity_mesh_choice,
 
4015
                  diagnostic_scalar_field
 
4016
               }|
 
4017
               element aliased {
 
4018
                  generic_aliased_field
 
4019
               }
 
4020
            )
 
4021
         }|
 
4022
         ## Richardson Number:
 
4023
         ##
 
4024
         ##  Ri = \frac{N^2}{(\frac{\partial u}{\partial z})^2 + (\frac{\partial u}{\partial z})^2}
 
4025
         ## with 
 
4026
         ##  N^2 = -\frac{g}{\rho_0}\frac{\partial \rho}{\partial z}
 
4027
         ##
 
4028
         ## Limitations:
 
4029
         ##  - Gravity must be constant.
 
4030
         ##  - Assumes gravity is in -ve final coordinate direction.
 
4031
         element scalar_field {
 
4032
            attribute rank { "0" },
 
4033
            attribute name { "RichardsonNumber" },
 
4034
            attribute depends { "Velocity,PerturbationDensity" },
 
4035
            (
 
4036
               element diagnostic {
 
4037
                  internal_algorithm,
 
4038
                  velocity_mesh_choice,
 
4039
                  diagnostic_richardson_number_field
 
4040
               }|
 
4041
               element aliased {
 
4042
                  generic_aliased_field
 
4043
               }
 
4044
            )
 
4045
         }|
 
4046
         ## CFLNumber
 
4047
         ##
 
4048
         ## See http://amcg.ese.ic.ac.uk/index.php?title=Local:Diagnostics#CFL_Number
 
4049
         ##
 
4050
         ## Adapting to this field is not recommended
 
4051
         element scalar_field {
 
4052
            attribute rank { "0" },
 
4053
            attribute name { "CFLNumber" },
 
4054
            attribute replaces { "IDENT = -601" },
 
4055
            (
 
4056
               element diagnostic {
 
4057
                  internal_algorithm,
 
4058
                  velocity_mesh_choice,
 
4059
                  diagnostic_scalar_field
 
4060
               }|
 
4061
               element aliased {
 
4062
                  generic_aliased_field
 
4063
               }
 
4064
            )
 
4065
         }|
 
4066
         ## ControlVolumeCFLNumber
 
4067
         ##
 
4068
         ## Courant Number as defined on a control volume mesh
 
4069
         ##
 
4070
         ## Adapting to this field is not recommended
 
4071
         element scalar_field {
 
4072
            attribute rank { "0" },
 
4073
            attribute name { "ControlVolumeCFLNumber" },
 
4074
            (
 
4075
               element diagnostic {
 
4076
                  internal_algorithm,
 
4077
                  velocity_mesh_choice,
 
4078
                  diagnostic_scalar_field
 
4079
               }|
 
4080
               element aliased {
 
4081
                  generic_aliased_field
 
4082
               }
 
4083
            )
 
4084
         }|
 
4085
         ## DG_CourantNumber
 
4086
         ##
 
4087
         ## Courant Number as defined on a DG mesh
 
4088
         ##
 
4089
         ## Adapting to this field is not recommended
 
4090
         element scalar_field {
 
4091
            attribute rank { "0" },
 
4092
            attribute name { "DG_CourantNumber" },
 
4093
            (
 
4094
               element diagnostic {
 
4095
                  internal_algorithm,
 
4096
                  velocity_mesh_choice,
 
4097
                  diagnostic_scalar_field
 
4098
               }|
 
4099
               element aliased {
 
4100
                  generic_aliased_field
 
4101
               }
 
4102
            )
 
4103
         }|
 
4104
         ## CVMaterialDensityCFLNumber
 
4105
         ##
 
4106
         ## Courant Number as defined on a control volume mesh and
 
4107
         ## incorporating the MaterialDensity.
 
4108
         ## Requires a MaterialDensity field!
 
4109
         ##
 
4110
         ## Adapting to this field is not recommended
 
4111
         element scalar_field {
 
4112
            attribute rank { "0" },
 
4113
            attribute name { "CVMaterialDensityCFLNumber" },
 
4114
            (
 
4115
               element diagnostic {
 
4116
                  internal_algorithm,
 
4117
                  velocity_mesh_choice,
 
4118
                  diagnostic_scalar_field
 
4119
               }|
 
4120
               element aliased {
 
4121
                  generic_aliased_field
 
4122
               }
 
4123
            )
 
4124
         }|
 
4125
         element scalar_field {
 
4126
            attribute rank { "0" },
 
4127
            attribute name { "SolidConcentration" },
 
4128
            (
 
4129
               element diagnostic {
 
4130
                  internal_algorithm,
 
4131
                  velocity_mesh_choice,
 
4132
                  diagnostic_scalar_field
 
4133
               }|
 
4134
               element aliased {
 
4135
                  generic_aliased_field
 
4136
               }
 
4137
            )
 
4138
         }|
 
4139
         ## This scalar field is meant to replace DENTRAF.
 
4140
         ## Basically, if you use new options, DENTRAF is no longer needed
 
4141
         ## No repointing is done from this field to DENTRAF.
 
4142
         element scalar_field {
 
4143
            attribute rank { "0" },
 
4144
            attribute name { "CopyofDensity" },
 
4145
            attribute replaces { "DENTRAF" },
 
4146
            (
 
4147
               element diagnostic {
 
4148
                  internal_algorithm,
 
4149
                  velocity_mesh_choice,
 
4150
                  diagnostic_scalar_field
 
4151
               }
 
4152
            )
 
4153
         }|
 
4154
         ## Add field to be used by Solid_configuration to 
 
4155
         ## Visualize the solids and MaterialVolumeFraction together
 
4156
         element scalar_field {
 
4157
            attribute rank { "0" },
 
4158
            attribute name { "VisualizeSolidFluid" },
 
4159
            (
 
4160
               element diagnostic {
 
4161
                  internal_algorithm,
 
4162
                  velocity_mesh_choice,
 
4163
                  diagnostic_scalar_field
 
4164
               }
 
4165
            )
 
4166
         }|
 
4167
         ## Add field to be used by Solid_configuration to 
 
4168
         ## Visualize the solid_Concentration
 
4169
         element scalar_field {
 
4170
            attribute rank { "0" },
 
4171
            attribute name { "VisualizeSolid" },
 
4172
            (
 
4173
               element diagnostic {
 
4174
                  internal_algorithm,
 
4175
                  velocity_mesh_choice,
 
4176
                  diagnostic_scalar_field
 
4177
               }
 
4178
            )
 
4179
         }|
 
4180
         ## Add field to be used by Solid_configuration to 
 
4181
         ## map  the solid_Concentration from particle mesh to 
 
4182
         ## the fluid mesh.
 
4183
         element scalar_field {
 
4184
            attribute rank { "0" },
 
4185
            attribute name { "ParticleScalar" },
 
4186
            (
 
4187
               element diagnostic {
 
4188
                  internal_algorithm,
 
4189
                  mesh_choice,
 
4190
                  diagnostic_scalar_field
 
4191
               }
 
4192
            )
 
4193
         }|
 
4194
         ## Add field to be used by Explicit_ALE to 
 
4195
         ## visualize functional values before iterations start.
 
4196
         element scalar_field {
 
4197
            attribute rank { "0" },
 
4198
            attribute name { "FunctionalBegin" },
 
4199
            (
 
4200
               element diagnostic {
 
4201
                  internal_algorithm,
 
4202
                  mesh_choice,
 
4203
                  diagnostic_scalar_field
 
4204
               }
 
4205
            )
 
4206
         }|
 
4207
         ## Add field to be used by Explicit_ALE to 
 
4208
         ## visualize functional values at each iteration.
 
4209
         element scalar_field {
 
4210
            attribute rank { "0" },
 
4211
            attribute name { "FunctionalIter" },
 
4212
            (
 
4213
               element diagnostic {
 
4214
                  internal_algorithm,
 
4215
                  mesh_choice,
 
4216
                  diagnostic_scalar_field
 
4217
               }
 
4218
            )
 
4219
         }|
 
4220
         ## add a MaterialVolume scalar_field to calculate the spatially varying 
 
4221
         ## volume of a material (requires a MaterialVolumeFraction)
 
4222
         element scalar_field {
 
4223
            attribute rank { "0" },
 
4224
            attribute name { "MaterialVolume" },
 
4225
            (
 
4226
               element diagnostic {
 
4227
                  internal_algorithm,
 
4228
                  velocity_mesh_choice,
 
4229
                  diagnostic_scalar_field
 
4230
               }|
 
4231
               element aliased {
 
4232
                  generic_aliased_field
 
4233
               }
 
4234
            )
 
4235
         }|
 
4236
         ## add a MaterialMass scalar_field to calculate the spatially varying 
 
4237
         ## mass of a material (requires a MaterialVolumeFraction and a MaterialDensity)
 
4238
         element scalar_field {
 
4239
            attribute rank { "0" },
 
4240
            attribute name { "MaterialMass" },
 
4241
            (
 
4242
               element diagnostic {
 
4243
                  internal_algorithm,
 
4244
                  velocity_mesh_choice,
 
4245
                  diagnostic_scalar_field
 
4246
               }|
 
4247
               element aliased {
 
4248
                  generic_aliased_field
 
4249
               }
 
4250
            )
 
4251
         }|
 
4252
         ## Calculates the MaterialDensity based on the bulk Pressure
 
4253
         ## (and MaterialInternalEnergy if appropriate) for the equation
 
4254
         ## of state of this material.
 
4255
         element scalar_field {
 
4256
            attribute rank { "0" },
 
4257
            attribute name { "MaterialEOSDensity" },
 
4258
            (
 
4259
               element diagnostic {
 
4260
                  internal_algorithm,
 
4261
                  velocity_mesh_choice,
 
4262
                  diagnostic_scalar_field
 
4263
               }|
 
4264
               element aliased {
 
4265
                  generic_aliased_field
 
4266
               }
 
4267
            )
 
4268
         }|
 
4269
         ## Calculates the MaterialPressure based on the MaterialDensity
 
4270
         ## (and MaterialInternalEnergy if appropriate) for the equation
 
4271
         ## of state of this material.
 
4272
         element scalar_field {
 
4273
            attribute rank { "0" },
 
4274
            attribute name { "MaterialPressure" },
 
4275
            (
 
4276
               element diagnostic {
 
4277
                  internal_algorithm,
 
4278
                  velocity_mesh_choice,
 
4279
                  diagnostic_scalar_field
 
4280
               }|
 
4281
               element aliased {
 
4282
                  generic_aliased_field
 
4283
               }
 
4284
            )
 
4285
         }|
 
4286
         ## Calculates the BulkMaterialPressure based on the MaterialDensity
 
4287
         ## and MaterialVolumeFraction (and MaterialInternalEnergy if appropriate) 
 
4288
         ## for the equation of state of all materials.
 
4289
         element scalar_field {
 
4290
            attribute rank { "0" },
 
4291
            attribute name { "BulkMaterialPressure" },
 
4292
            (
 
4293
               element diagnostic {
 
4294
                  internal_algorithm,
 
4295
                  velocity_mesh_choice,
 
4296
                  diagnostic_scalar_field
 
4297
               }|
 
4298
               element aliased {
 
4299
                  generic_aliased_field
 
4300
               }
 
4301
            )
 
4302
         }|
 
4303
         ## Grid Reynolds number
 
4304
         element scalar_field {
 
4305
            attribute rank { "0" },
 
4306
            attribute name { "GridReynoldsNumber" },
 
4307
            (element diagnostic {
 
4308
               internal_algorithm,
 
4309
               element mesh {
 
4310
                  attribute name { "VelocityMesh" }
 
4311
               },
 
4312
               diagnostic_scalar_field
 
4313
            }
 
4314
            | element aliased { generic_aliased_field })
 
4315
         }|
 
4316
         ## GridPecletNumber
 
4317
         ##
 
4318
         ## Peclet Number Pe = U*dx/2*diffusivity
 
4319
         ##
 
4320
         ## Also see the test case 'grid_peclet_number'
 
4321
         ## if you wish to see the effect of changing the 
 
4322
         ## diffusivity on a 1D, cg-discretised tracer-field
 
4323
         ##
 
4324
         ## Adapting to this field is not recommended
 
4325
         element scalar_field {
 
4326
            attribute rank { "0" },
 
4327
            attribute name { "GridPecletNumber" },
 
4328
            (
 
4329
               element diagnostic {
 
4330
                  internal_algorithm,
 
4331
                  ## Mesh on which to calculate dx
 
4332
                  mesh_choice,
 
4333
                  ## This is the name of the scalar field
 
4334
                  ## to calculate the Peclet number for
 
4335
                  ## Note this field needs to have a diffusivity
 
4336
                  element field_name { string },
 
4337
                  diagnostic_scalar_field
 
4338
               }|
 
4339
               element aliased {
 
4340
                  generic_aliased_field
 
4341
               }
 
4342
            )
 
4343
         }|
 
4344
         ## Horizontal velocity divergence:
 
4345
         ##
 
4346
         ## div_H velocity
 
4347
         ##
 
4348
         ## Uses the gravity field direction to determine the horizontal plane.
 
4349
         element scalar_field {
 
4350
            attribute rank { "0" },
 
4351
            attribute name { "HorizontalVelocityDivergence" },
 
4352
            (
 
4353
               element diagnostic {
 
4354
                  internal_algorithm,
 
4355
                  velocity_mesh_choice,
 
4356
                  diagnostic_scalar_field
 
4357
               }|
 
4358
               element aliased {
 
4359
                  generic_aliased_field
 
4360
               }
 
4361
            )
 
4362
         }|
 
4363
 
 
4364
         ## Velocity divergence:
 
4365
         ##
 
4366
         ## div velocity
 
4367
         ##
 
4368
         element scalar_field {
 
4369
            attribute rank { "0" },
 
4370
            attribute name { "VelocityDivergence" },
 
4371
            (
 
4372
               element diagnostic {
 
4373
                  internal_algorithm,
 
4374
                  velocity_mesh_choice,
 
4375
                  diagnostic_scalar_field
 
4376
               }|
 
4377
               element aliased {
 
4378
                  generic_aliased_field
 
4379
               }
 
4380
            )
 
4381
         }|
 
4382
 
 
4383
         ## Vorticity for a 2D field:
 
4384
         ##
 
4385
         ##  du   dv
 
4386
         ##  -- - --
 
4387
         ##  dy   dx
 
4388
         element scalar_field {
 
4389
            attribute rank { "0" },
 
4390
            attribute name { "Vorticity2D" },
 
4391
            (
 
4392
               element diagnostic {
 
4393
                  internal_algorithm,
 
4394
                  mesh_choice,
 
4395
                  diagnostic_scalar_field
 
4396
               }|
 
4397
               element aliased {
 
4398
                  generic_aliased_field
 
4399
               }
 
4400
            )
 
4401
         }|
 
4402
         
 
4403
         ## Kinetic energy density:
 
4404
         ##
 
4405
         ##  1/2 rho_0*|u|^2
 
4406
         ##
 
4407
         ## where rho_0 is the (reference) density 
 
4408
         ##
 
4409
         ## Limitations:
 
4410
         ##  - The Density, PerturbationDensity, KineticEnergyDensity and Velocity fields must be on the same mesh.
 
4411
         element scalar_field {
 
4412
            attribute rank { "0" },
 
4413
            attribute name { "KineticEnergyDensity" },
 
4414
            (
 
4415
               element diagnostic {
 
4416
                  internal_algorithm,
 
4417
                  velocity_mesh_choice,
 
4418
                  diagnostic_scalar_field
 
4419
               }|
 
4420
               element aliased {
 
4421
                  generic_aliased_field
 
4422
               }
 
4423
            )
 
4424
         }|
 
4425
         
 
4426
         ## Gravitational potential energy density:
 
4427
         ##
 
4428
         ## rho_0*(1.0 + rho')*(g dot (r - r_0))
 
4429
         ##
 
4430
         ## where rho_0 is the (reference) density, rho' is the perturbation density and r_0 is the potential energy zero point.
 
4431
         ##
 
4432
         ## Limitations:
 
4433
         ##  - Requires a constant gravity direction.
 
4434
         ##  - The Density, PerturbationDensity and GravitationalPotentialEnergyDensity fields must be on the same mesh.
 
4435
         element scalar_field {
 
4436
            attribute rank { "0" },
 
4437
            attribute name { "GravitationalPotentialEnergyDensity" },
 
4438
            (
 
4439
               element diagnostic {
 
4440
                  internal_algorithm,
 
4441
                  velocity_mesh_choice,
 
4442
                  diagnostic_scalar_field,
 
4443
                  ## Coordinate of a point with a potential energy of zero.
 
4444
                  element zero_point {
 
4445
                     real_dim_vector
 
4446
                  }
 
4447
               }|
 
4448
               element aliased {
 
4449
                  generic_aliased_field
 
4450
               }
 
4451
            )
 
4452
         }|
 
4453
         ## Isopycnal coordinate
 
4454
         ##
 
4455
         ##  z_star(x,t) = 1/A int_V' H(rho(x',t)-rho(x,t)) dV'
 
4456
         ##
 
4457
         ## where rho is the density, A is the width/area of the domain
 
4458
         ##
 
4459
         ## Limitations:
 
4460
         ##  - You need to specify a (fine) mesh to redistribute the PerturbationDensity onto
 
4461
         ##  - Requires a constant gravity direction.
 
4462
         ##  - The Density, PerturbationDensity and GravitationalPotentialEnergyDensity fields must be on the same mesh.
 
4463
         element scalar_field {
 
4464
            attribute rank { "0" },
 
4465
            attribute name { "IsopycnalCoordinate" },
 
4466
            (
 
4467
               element diagnostic {
 
4468
                  internal_algorithm,
 
4469
                  velocity_mesh_choice,
 
4470
                  ## This is the mesh onto which we redistribute the PerturbationDensity
 
4471
                  element fine_mesh {
 
4472
                     attribute name { string }
 
4473
                  },
 
4474
                  diagnostic_scalar_field                 
 
4475
               }|
 
4476
               element aliased {
 
4477
                  generic_aliased_field
 
4478
               }
 
4479
            )
 
4480
         }|
 
4481
         ## Background potential energy density:
 
4482
         ##
 
4483
         ## PE_b = rho*z_star
 
4484
         ##
 
4485
         ## where rho is the density, z_star is the isopycnal coordinate
 
4486
         ##
 
4487
         ## Limitations:
 
4488
         ##  - Requires a constant gravity direction.
 
4489
         ##  - The Density, PerturbationDensity and
 
4490
         ##  GravitationalPotentialEnergyDensity fields must be on the
 
4491
         ##  same mesh.
 
4492
         element scalar_field {
 
4493
            attribute rank { "0" },
 
4494
            attribute name { "BackgroundPotentialEnergyDensity" },
 
4495
            (
 
4496
               element diagnostic {
 
4497
                  internal_algorithm,
 
4498
                  velocity_mesh_choice,
 
4499
                  diagnostic_scalar_field                 
 
4500
               }|
 
4501
               element aliased {
 
4502
                  generic_aliased_field
 
4503
               }
 
4504
            )
 
4505
         }|
 
4506
         
 
4507
         ## Ertel potential vorticity:
 
4508
         ##
 
4509
         ##  (f + curl u) dot grad rho'
 
4510
         ##
 
4511
         ## Limitations:
 
4512
         ##  - Requires a geometry dimension of 3.
 
4513
         element scalar_field {
 
4514
            attribute rank { "0" },
 
4515
            attribute name { "PotentialVorticity" },
 
4516
            attribute depends { "Velocity,PerturbationDensity" },
 
4517
            (
 
4518
               element diagnostic {
 
4519
                  internal_algorithm,
 
4520
                  velocity_mesh_choice,
 
4521
                  diagnostic_scalar_field
 
4522
               }|
 
4523
               element aliased {
 
4524
                  generic_aliased_field
 
4525
               }
 
4526
            )
 
4527
         }|
 
4528
         ## Relative potential vorticity:
 
4529
         ##
 
4530
         ##   curl u dot grad rho'
 
4531
         element scalar_field {
 
4532
            attribute rank { "0" },
 
4533
            attribute name { "RelativePotentialVorticity" },
 
4534
            attribute depends { "Velocity,PerturbationDensity" },
 
4535
            (
 
4536
              element diagnostic {
 
4537
                  internal_algorithm,
 
4538
                  velocity_mesh_choice,
 
4539
                  diagnostic_scalar_field
 
4540
               }|
 
4541
               element aliased {
 
4542
                  generic_aliased_field
 
4543
               }
 
4544
            )
 
4545
         }|         
 
4546
         ## Local average mesh edge lengths
 
4547
         element scalar_field {
 
4548
          attribute rank { "0" },
 
4549
            attribute name { "MeshEdgeLengths" },
 
4550
            (
 
4551
              element diagnostic {
 
4552
                  internal_algorithm,
 
4553
                  element mesh {
 
4554
                     attribute name { "CoordinateMesh" }
 
4555
                  },
 
4556
                  diagnostic_scalar_field
 
4557
               }|
 
4558
               element aliased {
 
4559
                  generic_aliased_field
 
4560
               }
 
4561
            )
 
4562
         }|
 
4563
         ## Calculate the horizontal stream function psi where:
 
4564
         ##   \partial_x \psi = -v
 
4565
         ##   \partial_y \psi = u
 
4566
         ## where u and v are perpendicular to the gravity direction. Applies a
 
4567
         ## strong Dirichlet boundary condition of 0 on all boundaries.
 
4568
         element scalar_field {
 
4569
            attribute rank { "0" },
 
4570
            attribute name { "HorizontalStreamFunction" },
 
4571
            attribute depends { "Velocity" },
 
4572
            (
 
4573
              element diagnostic {
 
4574
                  internal_algorithm,
 
4575
                  velocity_mesh_choice,
 
4576
                  ## Solver
 
4577
                  element solver {
 
4578
                     linear_solver_options_sym
 
4579
                  },
 
4580
                  diagnostic_scalar_field
 
4581
               }|
 
4582
               element aliased {
 
4583
                  generic_aliased_field
 
4584
               }
 
4585
            )
 
4586
         }|
 
4587
         ## Speed:
 
4588
         ##
 
4589
         ##  |u|
 
4590
         ##
 
4591
         ## Limitations:
 
4592
         ##  - The Speed and Velocity fields must be on the same mesh.
 
4593
         element scalar_field {
 
4594
            attribute rank { "0" },
 
4595
            attribute name { "Speed" },
 
4596
            (
 
4597
               element diagnostic {
 
4598
                  internal_algorithm,
 
4599
                  velocity_mesh_choice,
 
4600
                  diagnostic_scalar_field
 
4601
               }|
 
4602
               element aliased {
 
4603
                  generic_aliased_field
 
4604
               }
 
4605
            )
 
4606
         }|
 
4607
 
 
4608
         ## Volume of the vehicles
 
4609
         ##
 
4610
         ## used in Traffic Modelling
 
4611
         element scalar_field {
 
4612
            attribute rank { "0" },
 
4613
            attribute name { "SolidPhase" },
 
4614
            attribute raplaces { "IDENT = -42"},
 
4615
            (
 
4616
               element diagnostic {
 
4617
                  internal_algorithm,
 
4618
                  velocity_mesh_choice,
 
4619
                  diagnostic_scalar_field
 
4620
               }|
 
4621
               element aliased {
 
4622
                  generic_aliased_field
 
4623
               }
 
4624
            )
 
4625
         }|
 
4626
         ## Absolute Difference between two scalar fields.
 
4627
         ##
 
4628
         ## Both fields must be in this material_phase.
 
4629
         ## Assumes both fields are on the same mesh as the AbsoluteDifference field.
 
4630
         element scalar_field {
 
4631
            attribute rank { "0" },
 
4632
            attribute name { "AbsoluteDifference" },
 
4633
            (
 
4634
               element diagnostic {
 
4635
                  internal_algorithm,
 
4636
                  attribute field_name_a { string },
 
4637
                  attribute field_name_b { string },
 
4638
                  mesh_choice,
 
4639
                  diagnostic_scalar_field,
 
4640
                  ## Evaluate the absolute difference once the average difference has been removed?
 
4641
                  element relative_to_average {
 
4642
                    empty
 
4643
                  }?,
 
4644
                  ## Ignore boundary nodes (i.e. zero them when calculating the difference)
 
4645
                  element ignore_boundaries {
 
4646
                    empty
 
4647
                  }?
 
4648
               }|
 
4649
               element aliased {
 
4650
                  generic_aliased_field
 
4651
               }
 
4652
            )
 
4653
         }|
 
4654
 
 
4655
         ## Absolute Difference between two scalar fields.
 
4656
         ##
 
4657
         ## Both fields must be in this material_phase.
 
4658
         ## Assumes both fields are on the same mesh as the AbsoluteDifference field.
 
4659
         element scalar_field {
 
4660
            attribute rank { "0" },
 
4661
            attribute name { "ScalarAbsoluteDifference" },
 
4662
            (
 
4663
               element diagnostic {
 
4664
                  internal_algorithm,
 
4665
                  attribute field_name_a { string },
 
4666
                  attribute field_name_b { string },
 
4667
                  mesh_choice,
 
4668
                  diagnostic_scalar_field,
 
4669
                  ## Evaluate the absolute difference once the average difference has been removed?
 
4670
                  element relative_to_average {
 
4671
                    empty
 
4672
                  }?,
 
4673
                  ## Ignore boundary nodes (i.e. zero them when calculating the difference)
 
4674
                  element ignore_boundaries {
 
4675
                    empty
 
4676
                  }?
 
4677
               }|
 
4678
               element aliased {
 
4679
                  generic_aliased_field
 
4680
               }
 
4681
            )
 
4682
         }|
 
4683
         ## Galerkin projection of one field onto another mesh.
 
4684
         ##
 
4685
         ## The field must be in this material_phase.
 
4686
         ## 
 
4687
         ## NOTE: you need the solver options if the mesh
 
4688
         ## of this field is continuous.
 
4689
         element scalar_field {
 
4690
            attribute rank { "0" },
 
4691
            attribute name { "GalerkinProjection" },
 
4692
            (
 
4693
               element diagnostic {
 
4694
                  internal_algorithm,
 
4695
                  element source_field_name { string },
 
4696
                  mesh_choice,
 
4697
                  ## Lump the mass matrix of the galerkin projection
 
4698
                  ## less accurate but faster and might give smoother result.                  
 
4699
                  element lump_mass {
 
4700
                     empty
 
4701
                  }?,
 
4702
                  element solver {
 
4703
                    linear_solver_options_sym
 
4704
                  }?,
 
4705
                  diagnostic_scalar_field
 
4706
               }|
 
4707
               element aliased {
 
4708
                  generic_aliased_field
 
4709
               }
 
4710
            )
 
4711
         }|
 
4712
         ## Primary production of Phytoplankton. This is calculated by
 
4713
         ## the ocean biology module and will not be calculated unless
 
4714
         ## ocean biology is being simulated.
 
4715
         element scalar_field {
 
4716
            attribute rank { "0" },
 
4717
            attribute name { "PrimaryProduction" },
 
4718
            (
 
4719
               element diagnostic {
 
4720
                  internal_algorithm,
 
4721
                  velocity_mesh_choice,
 
4722
                  diagnostic_scalar_field
 
4723
               }|
 
4724
               element aliased {
 
4725
                  generic_aliased_field
 
4726
               }
 
4727
            )
 
4728
         }|
 
4729
         ## Grazing of Phytoplankton by Zooplankton. This is calculated by
 
4730
         ## the ocean biology module and will not be calculated unless
 
4731
         ## ocean biology is being simulated.
 
4732
         element scalar_field {
 
4733
            attribute rank { "0" },
 
4734
            attribute name { "PhytoplanktonGrazing" },
 
4735
            (
 
4736
               element diagnostic {
 
4737
                  internal_algorithm,
 
4738
                  velocity_mesh_choice,
 
4739
                  diagnostic_scalar_field
 
4740
               }|
 
4741
               element aliased {
 
4742
                  generic_aliased_field
 
4743
               }
 
4744
            )
 
4745
 
 
4746
         }|
 
4747
         element scalar_field {
 
4748
            attribute rank { "0" },
 
4749
            attribute name { "TidalRange" },
 
4750
            attribute replaces { "IDENT = -32" },
 
4751
            (
 
4752
               element diagnostic {
 
4753
                  internal_algorithm,
 
4754
                  velocity_mesh_choice,
 
4755
                  diagnostic_scalar_field_tidal_range
 
4756
               }|
 
4757
               element aliased {
 
4758
                  generic_aliased_field
 
4759
               }
 
4760
            )
 
4761
         }|
 
4762
         element scalar_field {
 
4763
            attribute rank { "0" },
 
4764
            attribute name { "MaxFreeSurface" },
 
4765
            attribute replaces { "IDENT = -33" },
 
4766
            (
 
4767
               element diagnostic {
 
4768
                  internal_algorithm,
 
4769
                  velocity_mesh_choice,
 
4770
                  diagnostic_scalar_field
 
4771
               }|
 
4772
               element aliased {
 
4773
                  generic_aliased_field
 
4774
               }
 
4775
            )
 
4776
         }|
 
4777
         element scalar_field {
 
4778
            attribute rank { "0" },
 
4779
            attribute name { "MinFreeSurface" },
 
4780
            attribute replaces { "IDENT = -34" },
 
4781
            (
 
4782
               element diagnostic {
 
4783
                  internal_algorithm,
 
4784
                  velocity_mesh_choice,
 
4785
                  diagnostic_scalar_field
 
4786
               }|
 
4787
               element aliased {
 
4788
                  generic_aliased_field
 
4789
               }
 
4790
            )
 
4791
         }|
 
4792
         element scalar_field {
 
4793
            attribute rank { "0" },
 
4794
            attribute name { "HarmonicAmplitudeM2" },
 
4795
            (
 
4796
               element diagnostic {
 
4797
                  internal_algorithm,
 
4798
                  velocity_mesh_choice,
 
4799
                  diagnostic_scalar_field
 
4800
               }|
 
4801
               element aliased {
 
4802
                  generic_aliased_field
 
4803
               }
 
4804
            )
 
4805
         }|
 
4806
         element scalar_field {
 
4807
            attribute rank { "0" },
 
4808
            attribute name { "HarmonicPhaseM2" },
 
4809
            (
 
4810
               element diagnostic {
 
4811
                  internal_algorithm,
 
4812
                  velocity_mesh_choice,
 
4813
                  diagnostic_scalar_field
 
4814
               }|
 
4815
               element aliased {
 
4816
                  generic_aliased_field
 
4817
               }
 
4818
            )
 
4819
         }|
 
4820
         element scalar_field {
 
4821
            attribute rank { "0" },
 
4822
            attribute name { "HarmonicAmplitudeS2" },
 
4823
            (
 
4824
               element diagnostic {
 
4825
                  internal_algorithm,
 
4826
                  velocity_mesh_choice,
 
4827
                  diagnostic_scalar_field
 
4828
               }|
 
4829
               element aliased {
 
4830
                  generic_aliased_field
 
4831
               }
 
4832
            )
 
4833
         }|
 
4834
         element scalar_field {
 
4835
            attribute rank { "0" },
 
4836
            attribute name { "HarmonicPhaseS2" },
 
4837
            (
 
4838
               element diagnostic {
 
4839
                  internal_algorithm,
 
4840
                  velocity_mesh_choice,
 
4841
                  diagnostic_scalar_field
 
4842
               }|
 
4843
               element aliased {
 
4844
                  generic_aliased_field
 
4845
               }
 
4846
            )
 
4847
         }|
 
4848
         element scalar_field {
 
4849
            attribute rank { "0" },
 
4850
            attribute name { "HarmonicAmplitudeN2" },
 
4851
            (
 
4852
               element diagnostic {
 
4853
                  internal_algorithm,
 
4854
                  velocity_mesh_choice,
 
4855
                  diagnostic_scalar_field
 
4856
               }|
 
4857
               element aliased {
 
4858
                  generic_aliased_field
 
4859
               }
 
4860
            )
 
4861
         }|
 
4862
         element scalar_field {
 
4863
            attribute rank { "0" },
 
4864
            attribute name { "HarmonicPhaseN2" },
 
4865
            (
 
4866
               element diagnostic {
 
4867
                  internal_algorithm,
 
4868
                  velocity_mesh_choice,
 
4869
                  diagnostic_scalar_field
 
4870
               }|
 
4871
               element aliased {
 
4872
                  generic_aliased_field
 
4873
               }
 
4874
            )
 
4875
         }|
 
4876
         element scalar_field {
 
4877
            attribute rank { "0" },
 
4878
            attribute name { "HarmonicAmplitudeK2" },
 
4879
            (
 
4880
               element diagnostic {
 
4881
                  internal_algorithm,
 
4882
                  velocity_mesh_choice,
 
4883
                  diagnostic_scalar_field
 
4884
               }|
 
4885
               element aliased {
 
4886
                  generic_aliased_field
 
4887
               }
 
4888
            )
 
4889
         }|
 
4890
         element scalar_field {
 
4891
            attribute rank { "0" },
 
4892
            attribute name { "HarmonicPhaseK2" },
 
4893
            (
 
4894
               element diagnostic {
 
4895
                  internal_algorithm,
 
4896
                  velocity_mesh_choice,
 
4897
                  diagnostic_scalar_field
 
4898
               }|
 
4899
               element aliased {
 
4900
                  generic_aliased_field
 
4901
               }
 
4902
            )
 
4903
         }|
 
4904
         element scalar_field {
 
4905
            attribute rank { "0" },
 
4906
            attribute name { "HarmonicAmplitudeK1" },
 
4907
            (
 
4908
               element diagnostic {
 
4909
                  internal_algorithm,
 
4910
                  velocity_mesh_choice,
 
4911
                  diagnostic_scalar_field
 
4912
               }|
 
4913
               element aliased {
 
4914
                  generic_aliased_field
 
4915
               }
 
4916
            )
 
4917
         }|
 
4918
         element scalar_field {
 
4919
            attribute rank { "0" },
 
4920
            attribute name { "HarmonicPhaseK1" },
 
4921
            (
 
4922
               element diagnostic {
 
4923
                  internal_algorithm,
 
4924
                  velocity_mesh_choice,
 
4925
                  diagnostic_scalar_field
 
4926
               }|
 
4927
               element aliased {
 
4928
                  generic_aliased_field
 
4929
               }
 
4930
            )
 
4931
         }|
 
4932
         element scalar_field {
 
4933
            attribute rank { "0" },
 
4934
            attribute name { "HarmonicAmplitudeO1" },
 
4935
            (
 
4936
               element diagnostic {
 
4937
                  internal_algorithm,
 
4938
                  velocity_mesh_choice,
 
4939
                  diagnostic_scalar_field
 
4940
               }|
 
4941
               element aliased {
 
4942
                  generic_aliased_field
 
4943
               }
 
4944
            )
 
4945
         }|
 
4946
         element scalar_field {
 
4947
            attribute rank { "0" },
 
4948
            attribute name { "HarmonicPhaseO1" },
 
4949
            (
 
4950
               element diagnostic {
 
4951
                  internal_algorithm,
 
4952
                  velocity_mesh_choice,
 
4953
                  diagnostic_scalar_field
 
4954
               }|
 
4955
               element aliased {
 
4956
                  generic_aliased_field
 
4957
               }
 
4958
            )
 
4959
         }|
 
4960
         element scalar_field {
 
4961
            attribute rank { "0" },
 
4962
            attribute name { "HarmonicAmplitudeP1" },
 
4963
            (
 
4964
               element diagnostic {
 
4965
                  internal_algorithm,
 
4966
                  velocity_mesh_choice,
 
4967
                  diagnostic_scalar_field
 
4968
               }|
 
4969
               element aliased {
 
4970
                  generic_aliased_field
 
4971
               }
 
4972
            )
 
4973
         }|
 
4974
         element scalar_field {
 
4975
            attribute rank { "0" },
 
4976
            attribute name { "HarmonicPhaseP1" },
 
4977
            (
 
4978
               element diagnostic {
 
4979
                  internal_algorithm,
 
4980
                  velocity_mesh_choice,
 
4981
                  diagnostic_scalar_field
 
4982
               }|
 
4983
               element aliased {
 
4984
                  generic_aliased_field
 
4985
               }
 
4986
            )
 
4987
         }|
 
4988
         element scalar_field {
 
4989
            attribute rank { "0" },
 
4990
            attribute name { "HarmonicAmplitudeQ1" },
 
4991
            (
 
4992
               element diagnostic {
 
4993
                  internal_algorithm,
 
4994
                  velocity_mesh_choice,
 
4995
                  diagnostic_scalar_field
 
4996
               }|
 
4997
               element aliased {
 
4998
                  generic_aliased_field
 
4999
               }
 
5000
            )
 
5001
         }|
 
5002
         element scalar_field {
 
5003
            attribute rank { "0" },
 
5004
            attribute name { "HarmonicPhaseQ1" },
 
5005
            (
 
5006
               element diagnostic {
 
5007
                  internal_algorithm,
 
5008
                  velocity_mesh_choice,
 
5009
                  diagnostic_scalar_field
 
5010
               }|
 
5011
               element aliased {
 
5012
                  generic_aliased_field
 
5013
               }
 
5014
            )
 
5015
         }|
 
5016
         element scalar_field {
 
5017
            attribute rank { "0" },
 
5018
            attribute name { "HarmonicAmplitudeMf" },
 
5019
            (
 
5020
               element diagnostic {
 
5021
                  internal_algorithm,
 
5022
                  velocity_mesh_choice,
 
5023
                  diagnostic_scalar_field
 
5024
               }|
 
5025
               element aliased {
 
5026
                  generic_aliased_field
 
5027
               }
 
5028
            )
 
5029
         }|
 
5030
         element scalar_field {
 
5031
            attribute rank { "0" },
 
5032
            attribute name { "HarmonicPhaseMf" },
 
5033
            (
 
5034
               element diagnostic {
 
5035
                  internal_algorithm,
 
5036
                  velocity_mesh_choice,
 
5037
                  diagnostic_scalar_field
 
5038
               }|
 
5039
               element aliased {
 
5040
                  generic_aliased_field
 
5041
               }
 
5042
            )
 
5043
         }|
 
5044
         element scalar_field {
 
5045
            attribute rank { "0" },
 
5046
            attribute name { "HarmonicAmplitudeMm" },
 
5047
            (
 
5048
               element diagnostic {
 
5049
                  internal_algorithm,
 
5050
                  velocity_mesh_choice,
 
5051
                  diagnostic_scalar_field
 
5052
               }|
 
5053
               element aliased {
 
5054
                  generic_aliased_field
 
5055
               }
 
5056
            )
 
5057
         }|
 
5058
         element scalar_field {
 
5059
            attribute rank { "0" },
 
5060
            attribute name { "HarmonicPhaseMm" },
 
5061
            (
 
5062
               element diagnostic {
 
5063
                  internal_algorithm,
 
5064
                  velocity_mesh_choice,
 
5065
                  diagnostic_scalar_field
 
5066
               }|
 
5067
               element aliased {
 
5068
                  generic_aliased_field
 
5069
               }
 
5070
            )
 
5071
         }|
 
5072
         element scalar_field {
 
5073
            attribute rank { "0" },
 
5074
            attribute name { "HarmonicAmplitudeSSa" },
 
5075
            (
 
5076
               element diagnostic {
 
5077
                  internal_algorithm,
 
5078
                  velocity_mesh_choice,
 
5079
                  diagnostic_scalar_field
 
5080
               }|
 
5081
               element aliased {
 
5082
                  generic_aliased_field
 
5083
               }
 
5084
            )
 
5085
         }|
 
5086
         ## Output the universal numbering of the mesh on which this field is based.
 
5087
         element scalar_field {
 
5088
            attribute rank { "0" },
 
5089
            attribute name { "UniversalNumber" },
 
5090
            (
 
5091
               element diagnostic {
 
5092
                  internal_algorithm,
 
5093
                  mesh_choice,
 
5094
                  diagnostic_scalar_field
 
5095
               }|
 
5096
               element aliased {
 
5097
                  generic_aliased_field
 
5098
               }
 
5099
            )
 
5100
         }|
 
5101
         ## Output the processors which own the nodes of the mesh on which this field is based.
 
5102
         element scalar_field {
 
5103
            attribute rank { "0" },
 
5104
            attribute name { "NodeOwner" },
 
5105
            (
 
5106
               element diagnostic {
 
5107
                  internal_algorithm,
 
5108
                  mesh_choice,
 
5109
                  diagnostic_scalar_field
 
5110
               }|
 
5111
               element aliased {
 
5112
                  generic_aliased_field
 
5113
               }
 
5114
            )
 
5115
         }|
 
5116
         ## Output the processors which own the elements of the mesh on which this field is based.
 
5117
         element scalar_field {
 
5118
            attribute rank { "0" },
 
5119
            attribute name { "ElementOwner" },
 
5120
            (
 
5121
               element diagnostic {
 
5122
                  internal_algorithm,
 
5123
                  mesh_choice,
 
5124
                  diagnostic_scalar_field
 
5125
               }|
 
5126
               element aliased {
 
5127
                  generic_aliased_field
 
5128
               }
 
5129
            )
 
5130
         }|
 
5131
         ## Primary production of Phytoplankton. This is calculated by
 
5132
         ## the ocean biology module and will not be calculated unless
 
5133
         ## ocean biology is being simulated.
 
5134
         element scalar_field {
 
5135
            attribute rank { "0" },
 
5136
            attribute name { "HarmonicPhaseSSa" },
 
5137
            (
 
5138
               element diagnostic {
 
5139
                  internal_algorithm,
 
5140
                  velocity_mesh_choice,
 
5141
                  diagnostic_scalar_field
 
5142
               }|
 
5143
               element aliased {
 
5144
                  generic_aliased_field
 
5145
               }
 
5146
            )
 
5147
         }
 
5148
                  
 
5149
# Insert new diagnostic scalar fields here using the template:
 
5150
#        element scalar_field {
 
5151
#            attribute rank { "0" },
 
5152
#            attribute name { "NewFieldName" },
 
5153
#            (
 
5154
#               element diagnostic {
 
5155
#                  internal_algorithm,
 
5156
#                  velocity_mesh_choice,
 
5157
#                  diagnostic_scalar_field
 
5158
#               }|
 
5159
#               element aliased {
 
5160
#                  generic_aliased_field
 
5161
#               }
 
5162
#            )
 
5163
#        }
 
5164
      )
 
5165
   )
 
5166
 
 
5167
# This is the choice of additional vector field to be solved for
 
5168
vector_field_choice =
 
5169
   (
 
5170
# The first is a generic field, which may be used for any user-defined field
 
5171
# that FLUIDITY knows nothing about, or a generic diagnostic
 
5172
# Prognostic vector fields are not possible (other than velocity and those known fields below).
 
5173
      (
 
5174
         ## Generic field variable (vector)
 
5175
         element vector_field {
 
5176
            attribute rank { "1" },
 
5177
            attribute name { xsd:string },
 
5178
            ## Field type
 
5179
            (
 
5180
               element prescribed {
 
5181
                  mesh_choice,
 
5182
                  prescribed_vector_field
 
5183
               }|
 
5184
               element aliased {
 
5185
                  generic_aliased_field
 
5186
               }|
 
5187
               element diagnostic {
 
5188
                  vector_diagnostic_algorithms,
 
5189
                  velocity_mesh_choice,
 
5190
                  python_diagnostic_field_code?,
 
5191
                  diagnostic_vector_field
 
5192
               }
 
5193
            )
 
5194
         }|
 
5195
#
 
5196
# -- List of fields that are primarily prognostic,
 
5197
#    but can be aliased.
 
5198
# -- The list is in order of most frequently used.
 
5199
#
 
5200
         ## Prescribed vector fields below this
 
5201
         element ___Prognostic_fields_below___ {
 
5202
            empty
 
5203
         }|
 
5204
 
 
5205
#
 
5206
# -- List of fields that are primarily prescribed,
 
5207
#    but can be aliased. An example is Maximum bed shear stress.
 
5208
# -- The list is in order of most frequently used.
 
5209
#
 
5210
         ## Prescribed vector fields below this
 
5211
         element ___Prescribed_fields_below___ {
 
5212
            empty
 
5213
         }|
 
5214
 
 
5215
         ## Gradient of a scalar field evaluated using the C gradient
 
5216
         ## matrix constructed using finite elements.
 
5217
         ## Field must be in this material_phase.
 
5218
         element vector_field {
 
5219
            attribute rank { "1" },
 
5220
            attribute name { "FiniteElementGradient" },
 
5221
            (
 
5222
               element diagnostic {
 
5223
                  internal_algorithm,
 
5224
                  attribute field_name { string },
 
5225
                  mesh_choice,
 
5226
                  element integrate_gradient_by_parts {
 
5227
                     empty
 
5228
                  }?,
 
5229
                  diagnostic_gradient_vector_field
 
5230
               }|
 
5231
               element aliased {
 
5232
                  generic_aliased_field
 
5233
               }
 
5234
            )
 
5235
         }|
 
5236
 
 
5237
         ## Gradient of a scalar field evaluated using the transpose
 
5238
         ## of the C^T divergence matrix constructed using finite
 
5239
         ## elements.
 
5240
         ## Field must be in this material_phase.
 
5241
         element vector_field {
 
5242
            attribute rank { "1" },
 
5243
            attribute name { "FiniteElementDivergenceTransposed" },
 
5244
            (
 
5245
               element diagnostic {
 
5246
                  internal_algorithm,
 
5247
                  attribute field_name { string },
 
5248
                  mesh_choice,
 
5249
                  element integrate_divergence_by_parts {
 
5250
                     empty
 
5251
                  }?,
 
5252
                  diagnostic_gradient_vector_field
 
5253
               }|
 
5254
               element aliased {
 
5255
                  generic_aliased_field
 
5256
               }
 
5257
            )
 
5258
         }|
 
5259
         
 
5260
         ## Relative vorticity field - curl of the velocity field
 
5261
         element vector_field {
 
5262
            attribute rank { "1" },
 
5263
            attribute name { "Vorticity" },
 
5264
            (
 
5265
               element diagnostic {
 
5266
                  internal_algorithm,
 
5267
                  ### Relative vorticity
 
5268
                  #element algorithm {
 
5269
                  #   attribute name { "curl" },
 
5270
                  #   attribute material_phase_support { "single" },
 
5271
                  #   attribute source_field_name { "Velocity" }
 
5272
                  #},
 
5273
                  element mesh {
 
5274
                     attribute name { "VelocityMesh" }
 
5275
                  },
 
5276
                  diagnostic_vector_field
 
5277
               }|
 
5278
               element aliased {
 
5279
                  generic_aliased_field
 
5280
               }
 
5281
            )
 
5282
         }|        
 
5283
         ## Planetary vorticity
 
5284
         ##
 
5285
         ## Limitations:
 
5286
         ##  - Requires geometry dimension of 3.
 
5287
         element vector_field {
 
5288
            attribute rank { "1" },
 
5289
            attribute name { "PlanetaryVorticity" },
 
5290
            (
 
5291
               element diagnostic {
 
5292
                  internal_algorithm,
 
5293
                  velocity_mesh_choice,
 
5294
                  diagnostic_vector_field
 
5295
               }|
 
5296
               element aliased {
 
5297
                  generic_aliased_field
 
5298
               }
 
5299
            )
 
5300
         }|
 
5301
         ## Absolute vorticity:
 
5302
         ##
 
5303
         ##   f + curl u
 
5304
         ##
 
5305
         ## Limitations:
 
5306
         ##  - Requires a geometry dimension of 3.
 
5307
         element vector_field {
 
5308
            attribute rank { "1" },
 
5309
            attribute name { "AbsoluteVorticity" },
 
5310
            attribute depends { "Velocity" },
 
5311
            (
 
5312
               element diagnostic {
 
5313
                  internal_algorithm,
 
5314
                  velocity_mesh_choice,
 
5315
                  diagnostic_vector_field
 
5316
               }|
 
5317
               element aliased {
 
5318
                  generic_aliased_field
 
5319
               }
 
5320
            )
 
5321
         }|
 
5322
         
 
5323
         ## Gradient of a scalar field evaluated using the transpose
 
5324
         ## of the C^T matrix constructed using control volumes.
 
5325
         ## Field must be in this material_phase.
 
5326
         element vector_field {
 
5327
            attribute rank { "1" },
 
5328
            attribute name { "ControlVolumeDivergenceTransposed" },
 
5329
            (
 
5330
               element diagnostic {
 
5331
                  internal_algorithm,
 
5332
                  attribute field_name { string },
 
5333
                  velocity_mesh_choice,
 
5334
                  diagnostic_cv_gradient_vector_field
 
5335
               }|
 
5336
               element aliased {
 
5337
                  generic_aliased_field
 
5338
               }
 
5339
            )
 
5340
         }|
 
5341
         ## Full velocity in an
 
5342
         ## inner element SGS treatment of momentum
 
5343
         ##
 
5344
         ## Limitations:
 
5345
         ##  - Requires a geometry dimension of 3.
 
5346
         ##  - Requires inner element active for momentum
 
5347
         element vector_field {
 
5348
            attribute rank { "1" },
 
5349
            attribute name { "InnerElementFullVelocity" },
 
5350
            (
 
5351
               element diagnostic {
 
5352
                  internal_algorithm,
 
5353
                  element mesh {
 
5354
                     attribute name {  "InnerElementMesh" }
 
5355
                  },
 
5356
                  diagnostic_vector_field
 
5357
               }|
 
5358
               element aliased {
 
5359
                  generic_aliased_field
 
5360
               }
 
5361
            )
 
5362
         }|
 
5363
         ## Vorticity of the full velocity in an
 
5364
         ## inner element SGS treatment of momentum
 
5365
         ##
 
5366
         ## Limitations:
 
5367
         ##  - Requires a geometry dimension of 3.
 
5368
         ##  - Requires inner element active for momentum
 
5369
         element vector_field {
 
5370
            attribute rank { "1" },
 
5371
            attribute name { "InnerElementFullVorticity" },
 
5372
            (
 
5373
               element diagnostic {
 
5374
                  internal_algorithm,
 
5375
                  element mesh {
 
5376
                     attribute name {  "InnerElementMesh" }
 
5377
                  },
 
5378
                  diagnostic_vector_field
 
5379
               }|
 
5380
               element aliased {
 
5381
                  generic_aliased_field
 
5382
               }
 
5383
            )
 
5384
         }|
 
5385
         ## Vorticity of the SGS velocity in an
 
5386
         ## inner element SGS treatment of momentum
 
5387
         ##
 
5388
         ## Limitations:
 
5389
         ##  - Requires a geometry dimension of 3.
 
5390
         ##  - Requires inner element active for momentum
 
5391
         element vector_field {
 
5392
            attribute rank { "1" },
 
5393
            attribute name { "InnerElementVorticity" },
 
5394
            (
 
5395
               element diagnostic {
 
5396
                  internal_algorithm,
 
5397
                  element mesh {
 
5398
                     attribute name {  "InnerElementMesh" }
 
5399
                  },
 
5400
                  diagnostic_vector_field
 
5401
               }|
 
5402
               element aliased {
 
5403
                  generic_aliased_field
 
5404
               }
 
5405
            )
 
5406
         }|
 
5407
         ## The continuous solution mapped to a discontinuous mesh
 
5408
         ##
 
5409
         ## Limitations:
 
5410
         ##  - Requires a geometry dimension of 3.
 
5411
         ##  - Requires inner element active for momentum
 
5412
         element vector_field {
 
5413
            attribute rank { "1" },
 
5414
            attribute name { "DgMappedVelocity" },
 
5415
            (
 
5416
               element diagnostic {
 
5417
                  internal_algorithm,
 
5418
                  element mesh {
 
5419
                     attribute name {  "InnerElementMesh" }
 
5420
                  },
 
5421
                  diagnostic_vector_field
 
5422
               }|
 
5423
               element aliased {
 
5424
                  generic_aliased_field
 
5425
               }
 
5426
            )
 
5427
         }|
 
5428
         ## Vorticity of the DG mapped Velocity
 
5429
         ## Note vorticity is actually calculated over a DG field
 
5430
         ##
 
5431
         ## Limitations:
 
5432
         ##  - Requires a geometry dimension of 3.
 
5433
         ##  - Requires inner element active for momentum
 
5434
         element vector_field {
 
5435
            attribute rank { "1" },
 
5436
            attribute name { "DgMappedVorticity" },
 
5437
            (
 
5438
               element diagnostic {
 
5439
                  internal_algorithm,
 
5440
                  element mesh {
 
5441
                     attribute name {  "InnerElementMesh" }
 
5442
                  },
 
5443
                  diagnostic_vector_field
 
5444
               }|
 
5445
               element aliased {
 
5446
                  generic_aliased_field
 
5447
               }
 
5448
            )
 
5449
         }|
 
5450
         ## Solid Velocity field.  Used to generate the momentum source 
 
5451
         element vector_field {
 
5452
            attribute rank { "1" },
 
5453
            attribute replaces {"UTRAF,VTRAF,WTRAF"},
 
5454
            attribute name { "SolidVelocity" },
 
5455
            (
 
5456
               element diagnostic {
 
5457
                  internal_algorithm,
 
5458
                  mesh_choice,
 
5459
                  diagnostic_vector_field
 
5460
               }
 
5461
            )
 
5462
         }|
 
5463
         ## Same as Solid Velocity field but it is on the Particle mesh.
 
5464
         ## It is used to map the velocities coming from an external program like
 
5465
         ## FEMDEM or DEM to the fluid mesh. 
 
5466
         element vector_field {
 
5467
            attribute rank { "1" },
 
5468
            attribute name { "ParticleVector" },
 
5469
            (
 
5470
               element diagnostic {
 
5471
                  internal_algorithm,
 
5472
                  mesh_choice,
 
5473
                  diagnostic_vector_field
 
5474
               }
 
5475
            )
 
5476
         }|
 
5477
         ## Same as Solid Velocity field but it is on the Particle mesh.
 
5478
         ## It is used to map the velocities coming from an external program like
 
5479
         ## FEMDEM or DEM to the fluid mesh. 
 
5480
         element vector_field {
 
5481
            attribute rank { "1" },
 
5482
            attribute name { "ParticleForce" },
 
5483
            (
 
5484
               element diagnostic {
 
5485
                  internal_algorithm,
 
5486
                  mesh_choice,
 
5487
                  diagnostic_vector_field
 
5488
               }
 
5489
            )
 
5490
         }|
 
5491
 
 
5492
         ## Same as Solid Velocity field but it is on the Particle mesh.
 
5493
         ## It is used to map the velocities coming from an external program like
 
5494
         ## FEMDEM or DEM to the fluid mesh. 
 
5495
         element vector_field {
 
5496
            attribute rank { "1" },
 
5497
            attribute name { "SolidForce" },
 
5498
            (
 
5499
               element diagnostic {
 
5500
                  internal_algorithm,
 
5501
                  velocity_mesh_choice,
 
5502
                  diagnostic_vector_field
 
5503
               }
 
5504
            )
 
5505
         }|
 
5506
         element vector_field {
 
5507
            attribute rank { "1" },
 
5508
            attribute name { "VelocityPlotForSolids" },
 
5509
            (
 
5510
               element diagnostic {
 
5511
                  internal_algorithm,
 
5512
                  velocity_mesh_choice,
 
5513
                  diagnostic_vector_field
 
5514
               }
 
5515
            )
 
5516
         }|
 
5517
         ## Same as Solid Velocity field but it is on the Particle mesh.
 
5518
         ## It is used to map the velocities coming from an external program like
 
5519
         ## FEMDEM or DEM to the fluid mesh. 
 
5520
         element vector_field {
 
5521
            attribute rank { "1" },
 
5522
            attribute name { "FunctionalGradient" },
 
5523
            (
 
5524
               element diagnostic {
 
5525
                  internal_algorithm,
 
5526
                  velocity_mesh_choice,
 
5527
                  diagnostic_vector_field
 
5528
               }
 
5529
            )
 
5530
         }|
 
5531
         ## LinearMomentum field.
 
5532
         ##  p = \rho*u 
 
5533
         ## (where p is the linear momentum, \rho the density and u the velocity)
 
5534
         element vector_field {
 
5535
             attribute rank { "1" },
 
5536
             attribute name { "LinearMomentum" },
 
5537
             (
 
5538
                element diagnostic {
 
5539
                   internal_algorithm,
 
5540
                   velocity_mesh_choice,
 
5541
                   diagnostic_vector_field
 
5542
                }|
 
5543
                element aliased {
 
5544
                   generic_aliased_field
 
5545
                }
 
5546
             )
 
5547
         }|
 
5548
         ## Calculate the control volume auxiliary gradient for a particular field.
 
5549
         ## The related field must be a scalar field in this material_phase.
 
5550
         element vector_field {
 
5551
            attribute rank { "0" },
 
5552
            attribute name { "ControlVolumeAuxiliaryGradient" },
 
5553
            (
 
5554
               element diagnostic {
 
5555
                  internal_algorithm,
 
5556
                  velocity_mesh_choice,
 
5557
                  attribute gradient_of_field { string },
 
5558
                  diagnostic_vector_field
 
5559
               }|
 
5560
               element aliased {
 
5561
                  generic_aliased_field
 
5562
               }
 
5563
            )
 
5564
         }|
 
5565
         ## Calculate the dg (Bassi Rebay) auxiliary gradient for a particular field.
 
5566
         ## The related field must be a scalar field in this material_phase.
 
5567
         element vector_field {
 
5568
            attribute rank { "0" },
 
5569
            attribute name { "DGAuxiliaryGradient" },
 
5570
            (
 
5571
               element diagnostic {
 
5572
                  internal_algorithm,
 
5573
                  velocity_mesh_choice,
 
5574
                  attribute gradient_of_field { string },
 
5575
                  diagnostic_vector_field
 
5576
               }|
 
5577
               element aliased {
 
5578
                  generic_aliased_field
 
5579
               }
 
5580
            )
 
5581
         }|
 
5582
         ## Experimental geostrophic source field to be used in combination with
 
5583
         ## a free surface. Does not solve a vertical balance yet.
 
5584
         element vector_field {
 
5585
            attribute rank { "1" },
 
5586
            attribute name { "GeostrophicSource" },
 
5587
            (
 
5588
               element diagnostic {
 
5589
                  internal_algorithm,
 
5590
                  mesh_choice,
 
5591
                  diagnostic_vector_field
 
5592
               }
 
5593
            )
 
5594
         }|
 
5595
 
 
5596
         ## Absolute Difference between two vector fields.
 
5597
         ##
 
5598
         ## Both fields must be in this material_phase.
 
5599
         ## Assumes both fields are on the same mesh as the AbsoluteDifference field.
 
5600
         element vector_field {
 
5601
            attribute rank { "1" },
 
5602
            attribute name { "AbsoluteDifference" },
 
5603
            (
 
5604
               element diagnostic {
 
5605
                  internal_algorithm,
 
5606
                  attribute field_name_a { string },
 
5607
                  attribute field_name_b { string },
 
5608
                  mesh_choice,
 
5609
                  diagnostic_vector_field
 
5610
               }|
 
5611
               element aliased {
 
5612
                  generic_aliased_field
 
5613
               }
 
5614
            )
 
5615
         }|
 
5616
 
 
5617
         ## Absolute Difference between two vector fields.
 
5618
         ##
 
5619
         ## Both fields must be in this material_phase.
 
5620
         ## Assumes both fields are on the same mesh as the AbsoluteDifference field.
 
5621
         element vector_field {
 
5622
            attribute rank { "1" },
 
5623
            attribute name { "VectorAbsoluteDifference" },
 
5624
            (
 
5625
               element diagnostic {
 
5626
                  internal_algorithm,
 
5627
                  attribute field_name_a { string },
 
5628
                  attribute field_name_b { string },
 
5629
                  mesh_choice,
 
5630
                  diagnostic_vector_field
 
5631
               }|
 
5632
               element aliased {
 
5633
                  generic_aliased_field
 
5634
               }
 
5635
            )
 
5636
         }|
 
5637
         
 
5638
         ## Bed Shear Stress = density*drag_coeff*|u|*u
 
5639
         ##
 
5640
         ## at the moment this assumes the density and drag coefficients are constants.
 
5641
         ## This diagnostic vector field is only calculated over surface elements/nodes, 
 
5642
         ## interior nodes will have zero value.
 
5643
         element vector_field {
 
5644
             attribute rank { "1" },
 
5645
             attribute name { "BedShearStress" },
 
5646
             (
 
5647
                element diagnostic {
 
5648
                   internal_algorithm,
 
5649
                   velocity_mesh_choice,
 
5650
                   diagnostic_vector_field_bed_shear_stress
 
5651
                }|
 
5652
                element aliased {
 
5653
                   generic_aliased_field
 
5654
                }
 
5655
             )
 
5656
         }|
 
5657
         ## Max Bed Shear Stress.
 
5658
         ##
 
5659
         ## Note that you need BedShearStress turned on for this to work.
 
5660
         element vector_field {
 
5661
             attribute rank { "1" },
 
5662
             attribute name { "MaxBedShearStress" },
 
5663
             (
 
5664
                element diagnostic {
 
5665
                   internal_algorithm,
 
5666
                   velocity_mesh_choice
 
5667
                   #diagnostic_vector_field_max_bed_shear_stress
 
5668
                }|
 
5669
                element aliased {
 
5670
                   generic_aliased_field
 
5671
                }
 
5672
             ),
 
5673
            ## This is the time after which the max operator is
 
5674
            ## applied to the bed shear stress.
 
5675
            element spin_up_time {
 
5676
               real
 
5677
            }
 
5678
         }|
 
5679
 
 
5680
         ## Displacement
 
5681
         element vector_field {
 
5682
             attribute rank { "1" },
 
5683
             attribute name { "Displacement" },
 
5684
             (
 
5685
                element diagnostic {
 
5686
                   internal_algorithm,
 
5687
                   velocity_mesh_choice,
 
5688
                   diagnostic_vector_field
 
5689
                }|
 
5690
                element aliased {
 
5691
                   generic_aliased_field
 
5692
                }
 
5693
             )
 
5694
         }|
 
5695
         ## Galerkin projection of one field onto another mesh.
 
5696
         ##
 
5697
         ## The field must be in this material_phase.
 
5698
         ## 
 
5699
         ## NOTE: you need the solver options if the mesh
 
5700
         ## of this field is continuous.
 
5701
         element vector_field {
 
5702
            attribute rank { "1" },
 
5703
            attribute name { "GalerkinProjection" },
 
5704
            (
 
5705
               element diagnostic {
 
5706
                  internal_algorithm,
 
5707
                  element source_field_name { string },
 
5708
                  mesh_choice,
 
5709
                  ## Lump the mass matrix of the galerkin projection
 
5710
                  ## less accurate but faster and might give smoother result.                  
 
5711
                  element lump_mass {
 
5712
                     empty
 
5713
                  }?,                  
 
5714
                  element solver {
 
5715
                  linear_solver_options_sym
 
5716
                  }?,
 
5717
                  diagnostic_vector_field
 
5718
               }|
 
5719
               element aliased {
 
5720
                  generic_aliased_field
 
5721
               }
 
5722
            )
 
5723
         }|
 
5724
         ## Compute the imbalanced component of velocity,
 
5725
         ## that is,
 
5726
         ## u - u_bal
 
5727
         ## where u_bal is the velocity that puts the state in geostrophic
 
5728
         ## balance.
 
5729
         ## Note: if your VelocityMesh is continuous, then the solver option
 
5730
         ## is necessary.
 
5731
         element vector_field {
 
5732
            attribute rank { "1" },
 
5733
            attribute name { "ImbalancedVelocity" },
 
5734
            (
 
5735
               element diagnostic {
 
5736
                  internal_algorithm,
 
5737
                  velocity_mesh_choice,
 
5738
                  element solver {
 
5739
                  linear_solver_options_sym
 
5740
                  }?,
 
5741
                  diagnostic_vector_field
 
5742
               }|
 
5743
               element aliased {
 
5744
                  generic_aliased_field
 
5745
               }
 
5746
            )
 
5747
         }|
 
5748
         ## Compute the balanced component of velocity,
 
5749
         ## that is, the velocity that puts the state in geostrophic
 
5750
         ## balance.
 
5751
         ## This diagnostic depends on ImbalancedVelocity.
 
5752
         element vector_field {
 
5753
            attribute rank { "1" },
 
5754
            attribute name { "BalancedVelocity" },
 
5755
            (
 
5756
               element diagnostic {
 
5757
                  internal_algorithm,
 
5758
                  velocity_mesh_choice,
 
5759
                  diagnostic_vector_field
 
5760
               }|
 
5761
               element aliased {
 
5762
                  generic_aliased_field
 
5763
               }
 
5764
            )
 
5765
         }
 
5766
 
 
5767
# Insert new diagnostic vector field here using the template:
 
5768
#        element vector_field {
 
5769
#            attribute rank { "1" },
 
5770
#            attribute name { "NewFieldName" },
 
5771
#            (
 
5772
#               element diagnostic {
 
5773
#                  internal_algorithm,
 
5774
#                  mesh_choice,
 
5775
#                  diagnostic_vector_field
 
5776
#               }|
 
5777
#               element aliased {
 
5778
#                  generic_aliased_field
 
5779
#               }
 
5780
#            )
 
5781
#        }
 
5782
      )
 
5783
   )  
 
5784
 
 
5785
# This is the choice of additional tensor fields
 
5786
tensor_field_choice =
 
5787
   (
 
5788
# The first is a generic field, which may be used for any user-defined field
 
5789
# that FLUIDITY knows nothing about, or a generic diagnostic
 
5790
# Prognostic tensor fields are not possible.
 
5791
      (
 
5792
         ## Generic field variable (tensor)
 
5793
         element tensor_field {
 
5794
            attribute rank { "2" },
 
5795
            attribute name { xsd:string },
 
5796
            ## Field type
 
5797
            (
 
5798
               element prescribed {
 
5799
                  mesh_choice,
 
5800
                  prescribed_tensor_field
 
5801
               }|
 
5802
               element aliased {
 
5803
                  generic_aliased_field
 
5804
               }|
 
5805
               element diagnostic {
 
5806
                  tensor_diagnostic_algorithms,
 
5807
                  velocity_mesh_choice,
 
5808
                  python_diagnostic_field_code?,
 
5809
                  diagnostic_tensor_field
 
5810
               }
 
5811
            )
 
5812
         }|
 
5813
#
 
5814
# -- Second is a list of tensor fields that are primarily prescribed,
 
5815
#    but can be aliased.
 
5816
# -- The list is in order of most frequently used.
 
5817
#
 
5818
         ## Prescribed scalar fields below this
 
5819
         element ___Prescribed_fields_below___ {
 
5820
            empty
 
5821
         }|
 
5822
 
 
5823
         ## MaterialViscosity field:
 
5824
         ##
 
5825
         ## Field for the viscosity of this material.
 
5826
         ## Required if using a diagnostic bulk viscosity
 
5827
         ## in a multimaterial simulation.
 
5828
         element tensor_field {
 
5829
            attribute rank { "2" },
 
5830
            attribute name { "MaterialViscosity" },
 
5831
            (
 
5832
               element prescribed {
 
5833
                  mesh_choice,
 
5834
                  prescribed_tensor_field
 
5835
               }|
 
5836
               element aliased {
 
5837
                  generic_aliased_field
 
5838
               }
 
5839
            )
 
5840
         }|
 
5841
 
 
5842
         element tensor_field {
 
5843
            attribute rank { "2" },
 
5844
            attribute name { "MaterialElasticity" },
 
5845
            (
 
5846
               element prescribed {
 
5847
                  mesh_choice,
 
5848
                  prescribed_tensor_field
 
5849
               }|
 
5850
               element aliased {
 
5851
                  generic_aliased_field
 
5852
               }
 
5853
            )
 
5854
         }|
 
5855
 
 
5856
#
 
5857
# Insert new prescribed tensor fields here using the template:
 
5858
#        element tensor_field {
 
5859
#            attribute rank { "2" },
 
5860
#            attribute name { "NewFieldName" },
 
5861
#            (
 
5862
#               element prescribed {
 
5863
#                  mesh_choice,
 
5864
#                  prescribed_tensor_field
 
5865
#               }|
 
5866
#               element aliased {
 
5867
#                  generic_aliased_field
 
5868
#               }
 
5869
#            )
 
5870
#        }|
 
5871
#
 
5872
# -- Last is a list of fields that are primarily diagnostic,
 
5873
#    but can be aliased.
 
5874
# -- The list is in order of most frequently used.
 
5875
#
 
5876
         ## Diagnostic tensor fields below this
 
5877
         element ___Diagnostic_Fields_Below___ {
 
5878
            empty
 
5879
         }|
 
5880
         ## From a field on a mesh, diagnose the anisotropic
 
5881
         ## interpolation weight that would give the mesh back.
 
5882
         ## It is computed as:
 
5883
         ## \Eps = M^-1 |H|
 
5884
         element tensor_field {
 
5885
            attribute rank { "2" },
 
5886
            attribute name { "FieldTolerance" },
 
5887
            (
 
5888
               element diagnostic {
 
5889
                  internal_algorithm,
 
5890
                  element source_field_name { string },
 
5891
                  velocity_mesh_choice,
 
5892
                  diagnostic_tensor_field
 
5893
               }|
 
5894
               element aliased {
 
5895
                  generic_aliased_field
 
5896
               }
 
5897
            )
 
5898
         }
 
5899
 
 
5900
# Insert new diagnostic tensor field here using the template:
 
5901
#        element tensor_field {
 
5902
#            attribute name { "NewFieldName" },
 
5903
#            (
 
5904
#               element diagnostic {
 
5905
#                  internal_algorithm,
 
5906
#                  mesh_choice,
 
5907
#                  diagnostic_tensor_field
 
5908
#               }|
 
5909
#               element aliased {
 
5910
#                  generic_aliased_field
 
5911
#               }
 
5912
#            )
 
5913
#        }
 
5914
      )
 
5915
   )
 
5916
 
 
5917
mesh_info =
 
5918
   (
 
5919
      ## Read mesh from file.
 
5920
      element from_file {
 
5921
         (
 
5922
            ## Triangle mesh format.
 
5923
            ##
 
5924
            ## Enter the base name without the .edge .ele, .face or
 
5925
            ## .node extensions, and without process numbers.
 
5926
            element format {
 
5927
              attribute name { "triangle" },
 
5928
              # string_value elements are used only for backwards compatibility - any new format choices should NOT have these
 
5929
              element string_value {
 
5930
                 "triangle"
 
5931
              },
 
5932
              comment
 
5933
            }|
 
5934
            ## Read the mesh from a vtu. Note that the mesh will have no surface
 
5935
            ## or region IDs.
 
5936
            element format {
 
5937
              attribute name { "vtu" },
 
5938
              comment
 
5939
            }|
 
5940
            ## CGNS mesh format (not yet implemented)
 
5941
            element format {
 
5942
               attribute name { "cgns" },
 
5943
               # string_value elements are used only for backwards compatibility - any new format choices should NOT have these
 
5944
               element string_value {
 
5945
                  "cgns"
 
5946
               },
 
5947
               comment
 
5948
            }
 
5949
         ),
 
5950
         attribute file_name { xsd:string },
 
5951
         from_file_mesh_stat_options,
 
5952
         comment
 
5953
      }|
 
5954
      ## Make mesh from existing mesh. The existing mesh cannot itself
 
5955
      ## be made from an existing mesh (i.e. it must be read from a
 
5956
      ## file).
 
5957
      element from_mesh {
 
5958
         mesh_choice,
 
5959
         element mesh_shape {
 
5960
            element polynomial_degree {
 
5961
               integer
 
5962
            }
 
5963
         }?,
 
5964
         element mesh_continuity {
 
5965
            element string_value{
 
5966
               "continuous" | "discontinuous"
 
5967
            }
 
5968
         }?,
 
5969
         ## Make mesh periodic
 
5970
         element periodic_boundary_conditions {
 
5971
            attribute name { xsd:string },
 
5972
            ## List of boundary ids that are aliased to
 
5973
            element physical_boundary_ids {
 
5974
               integer_vector
 
5975
            },
 
5976
            ## List of boundary ids that are aliased
 
5977
            element  aliased_boundary_ids {
 
5978
               integer_vector
 
5979
            },
 
5980
            ## Python code which takes coordinate of an aliased
 
5981
            ## boundary node and returns the coordinate of a physical
 
5982
            ## boundary node
 
5983
            element coordinate_map {
 
5984
               python_code
 
5985
            }
 
5986
         }*,
 
5987
         ## Extrude a horizontal (1D or 2D) mesh in the vertical
 
5988
         element extrude {
 
5989
            ## Depth over which to extrude
 
5990
            ## top will be at z=0
 
5991
            ## bottom will be at z=-bottom_depth
 
5992
            element bottom_depth {
 
5993
               real
 
5994
            },
 
5995
            ## Constant or function to specify the depth of the
 
5996
            ## layers. The function is a function of all coordinates
 
5997
            ## (so in 2+1D: x,y and z) to specify a layer depth that
 
5998
            ## varies both in the horizontal as in the vertical.
 
5999
            element sizing_function {
 
6000
               input_choice_real
 
6001
            },
 
6002
            ## surface_id to assign to the top of the extruded mesh
 
6003
            element top_surface_id {
 
6004
               integer
 
6005
            }?,
 
6006
            ## surface_id to assign to the bottom of the extruded mesh
 
6007
            element bottom_surface_id {
 
6008
               integer
 
6009
            }?
 
6010
         }?,
 
6011
         derived_mesh_stat_options,
 
6012
         comment
 
6013
      }
 
6014
   )
 
6015
 
 
6016
# Options for inclusion/exclusion of mesh statistics from the .stat file
 
6017
include_mesh_in_stat =
 
6018
   (
 
6019
      ## Include this mesh in the .stat file
 
6020
      element include_in_stat {
 
6021
         comment
 
6022
      }
 
6023
   )
 
6024
exclude_mesh_from_stat =
 
6025
   (
 
6026
      ## Exclude this mesh from the .stat file
 
6027
      element exclude_from_stat {
 
6028
         comment
 
6029
      }
 
6030
   )
 
6031
 
 
6032
# Diagnostic statistics options for meshed, with enabled by default
 
6033
mesh_stat_options_enabled_default = include_mesh_in_stat
 
6034
mesh_stat_options_enabled_default |= exclude_mesh_from_stat
 
6035
 
 
6036
# Diagnostic statistics options for meshed, with disabled by default
 
6037
mesh_stat_options_disabled_default = exclude_mesh_from_stat
 
6038
mesh_stat_options_disabled_default |= include_mesh_in_stat
 
6039
 
 
6040
from_file_mesh_stat_options =
 
6041
   (
 
6042
      ## Specify what is added to .stat files
 
6043
      element stat {
 
6044
         mesh_stat_options_enabled_default
 
6045
      }
 
6046
   )
 
6047
derived_mesh_stat_options =
 
6048
   (
 
6049
      ## Specify what is added to .stat files
 
6050
      element stat {
 
6051
         mesh_stat_options_disabled_default
 
6052
      }
 
6053
   )
 
6054
 
 
6055
linear_solver_options_asym =
 
6056
   (
 
6057
      ## Iterative (Krylov) method to solve the linear discretised equation
 
6058
      ## Given are the most frequently used methods. The solution is done
 
6059
      ## by the PETSc library. Many more methods are provided.
 
6060
      ##
 
6061
      (
 
6062
         ## GMRES
 
6063
         ##
 
6064
         ## Your safest bet for non-symmetric systems.
 
6065
         element iterative_method {
 
6066
            attribute name { "gmres" },
 
6067
            ## Restart value for gmres iteration
 
6068
            ## Higher values give better convergence but require more memory.
 
6069
            ## Suggested value: 30
 
6070
            element restart {
 
6071
               integer
 
6072
            }
 
6073
         }|
 
6074
         ## Conjugate gradient method
 
6075
         ##
 
6076
         ## Only works for symmetric systems.
 
6077
         element iterative_method {
 
6078
            attribute name { "cg" }
 
6079
         }|
 
6080
         ## Direct method
 
6081
         ##
 
6082
         ## This is for non-iterative methods
 
6083
         ## Only makes sense in combination with preconditioners that do a complete solve, e.g. lu.
 
6084
         element iterative_method {
 
6085
            attribute name { "preonly" }
 
6086
         }|
 
6087
         ## Richardson iteration
 
6088
         ##
 
6089
         ## Only apply preconditioner each iteration, no krylov acceleration
 
6090
         element iterative_method {
 
6091
            attribute name { "richardson" }
 
6092
         }|
 
6093
         ## Other methods
 
6094
         ##
 
6095
         ## Any method provided by the PETSc library
 
6096
         ## http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/KSP/KSPType.html
 
6097
         ## (available methods may depend on the PETSc library installed on your system)
 
6098
         element iterative_method {
 
6099
            attribute name { xsd:string }
 
6100
         }
 
6101
      ),
 
6102
      ## Preconditioner to be used in combination with the iterative method.
 
6103
      (
 
6104
         ## Succesive Over-Relaxation
 
6105
         ##
 
6106
         ## This includes SSOR (symmetric sor)
 
6107
         element preconditioner {
 
6108
            attribute name { "sor" }
 
6109
         }|
 
6110
         ## The Eisenstat method
 
6111
         ##
 
6112
         ## This preconditioner is equivalent to SOR but only uses
 
6113
         ## half the number of flops,
 
6114
         ## i.e. same convergence rate but twice as fast per
 
6115
         ## iteration. Because it computes
 
6116
         ## a different preconditioned residual the convergence in
 
6117
         ## practice may be quite different though.
 
6118
         ##
 
6119
         ## It does not work in parallel!
 
6120
         element preconditioner {
 
6121
            attribute name { "eisenstat" }
 
6122
         }|
 
6123
         ## Incomplete LU decomposition
 
6124
         element preconditioner {
 
6125
            attribute name { "ilu" }
 
6126
         }|
 
6127
         ## LU direct solver
 
6128
         ##
 
6129
         ## This performs a complete, direct solve of the equation and should only be used in combination with preonly as iterative method.
 
6130
         element preconditioner {
 
6131
            attribute name { "lu" }
 
6132
         }|
 
6133
         ## Fluidity`s own multigrid method
 
6134
         ##
 
6135
         ## Especially suited for ill-conditioned, large aspect ratio problems.
 
6136
         element preconditioner {
 
6137
            attribute name { "mg" }
 
6138
         }|
 
6139
         ## Prometheus multigrid method
 
6140
         element preconditioner {
 
6141
            attribute name { "prometheus" }
 
6142
         }|
 
6143
         ## Hypre preconditioners (includes boomeramg)
 
6144
         element preconditioner {
 
6145
            attribute name { "hypre" },
 
6146
            (
 
6147
               ## BoomerAMG multigrid method
 
6148
               element hypre_type {
 
6149
                  attribute name { "boomeramg" }
 
6150
               }|
 
6151
               ## Other Hypre preconditioners
 
6152
               element hypre_type {
 
6153
                  attribute name { string }
 
6154
               }
 
6155
            )
 
6156
         }|
 
6157
         ## Complete solve
 
6158
         ##
 
6159
         ## This only makes sense for solves where a different approximated preconditioner
 
6160
         ## matrix is provided. For instance when solving pressure with the 
 
6161
         ## option full_schur_complement and using a masslumped schur complement
 
6162
         ## as preconditioner matrix.
 
6163
         ##
 
6164
         ## NOTE: If you are using a krylov method (cg/gmres) for this preconditioner 
 
6165
         ## solve you either need to set your tolerances much stricter for it
 
6166
         ## than in the outer solve (so that the preconditioner is close to an
 
6167
         ## exact matrix inversion), or use fgmres in the outer solve.
 
6168
         element preconditioner {
 
6169
            attribute name { "ksp" },
 
6170
            (
 
6171
                ## Solver options for the full solve done by this preconditioner
 
6172
                element solver {
 
6173
                   pc_ksp_solver_options
 
6174
                }
 
6175
            )
 
6176
         }|
 
6177
         ## Other preconditioners
 
6178
         ##
 
6179
         ## Any preconditioner provided by the PETSc library
 
6180
         ## http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/PC/PCType.html
 
6181
         ## (available preconditiors may depend on the PETSc library installed on your system)
 
6182
         element preconditioner {
 
6183
            attribute name { string }
 
6184
         }
 
6185
      ),
 
6186
      generic_solver_options
 
6187
   )
 
6188
   
 
6189
linear_solver_options_sym =
 
6190
   (
 
6191
      ## Iterative (Krylov) method to solve the linear discretised equation
 
6192
      ## Given are the most frequently used methods. The solution is done
 
6193
      ## by the PETSc library. Many more methods are provided.
 
6194
      ##
 
6195
      (
 
6196
         ## Conjugate gradient method
 
6197
         ##
 
6198
         ## Only works for symmetric systems.
 
6199
         element iterative_method {
 
6200
            attribute name { "cg" }
 
6201
         }|
 
6202
         ## GMRES
 
6203
         ##
 
6204
         ## Your safest bet for non-symmetric systems.
 
6205
         element iterative_method {
 
6206
            attribute name { "gmres" },
 
6207
            ## Restart value for gmres iteration
 
6208
            ## Higher values give better convergence but require more memory.
 
6209
            ## Suggested value: 30
 
6210
            element restart {
 
6211
               integer
 
6212
            }
 
6213
         }|
 
6214
         ## Direct method
 
6215
         ##
 
6216
         ## This is for non-iterative methods
 
6217
         ## Only makes sense in combination with preconditioners that do a complete solve, e.g. lu.
 
6218
         element iterative_method {
 
6219
            attribute name { "preonly" }
 
6220
         }|
 
6221
         ## Richardson iteration
 
6222
         ##
 
6223
         ## Only apply preconditioner each iteration, no krylov acceleration
 
6224
         element iterative_method {
 
6225
            attribute name { "richardson" }
 
6226
         }|
 
6227
         ## Other methods
 
6228
         ##
 
6229
         ## Any method provided by the PETSc library
 
6230
         ## http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/KSP/KSPType.html
 
6231
         ## (available methods may depend on the PETSc library installed on your system)
 
6232
         element iterative_method {
 
6233
            attribute name { xsd:string }
 
6234
         }
 
6235
      ),
 
6236
      ## Preconditioner to be used in combination with the iterative method.
 
6237
      (
 
6238
         ## Succesive Over-Relaxation
 
6239
         ##
 
6240
         ## This includes SSOR (symmetric sor)
 
6241
         element preconditioner {
 
6242
            attribute name { "sor" }
 
6243
         }|
 
6244
         ## The Eisenstat method
 
6245
         ##
 
6246
         ## This preconditioner is equivalent to SOR but only uses
 
6247
         ## half the number of flops,
 
6248
         ## i.e. same convergence rate but twice as fast per
 
6249
         ## iteration. Because it computes
 
6250
         ## a different preconditioned residual the convergence in
 
6251
         ## practice may be quite different though.
 
6252
         ## It does not work in parallel!
 
6253
         element preconditioner {
 
6254
            attribute name { "eisenstat" }
 
6255
         }|
 
6256
         ## Incomplete LU decomposition
 
6257
         element preconditioner {
 
6258
            attribute name { "ilu" }
 
6259
         }|
 
6260
         ## Incomplete Cholesky decomposition (only works for symmetric matrices)
 
6261
         element preconditioner {
 
6262
            attribute name { "icc" }
 
6263
         }|
 
6264
         ## LU direct solver
 
6265
         ##
 
6266
         ## This performs a complete, direct solve of the equation and should only be used in combination with preonly as iterative method.
 
6267
         element preconditioner {
 
6268
            attribute name { "lu" }
 
6269
        }|
 
6270
         ## Fluidity`s own multigrid method
 
6271
         ##
 
6272
         ## Especially suited for ill-conditioned, large aspect ratio problems.
 
6273
         element preconditioner {
 
6274
            attribute name { "mg" },
 
6275
            ## apply vertical lumping from the full mesh to the surface mesh
 
6276
            ## as the first coarsening step instead of the default
 
6277
            ## aggregation method.
 
6278
            element vertical_lumping {
 
6279
               ## Does additional smoothing by solving the equation but with
 
6280
               ## a dirichilet boundary condition on top given by the last iteration
 
6281
               ## of the multigrid cycle. May be quite expensive per iteration
 
6282
               ## but improves the solution quite a lot for difficult meshes.
 
6283
               element internal_smoother {
 
6284
                  empty
 
6285
               }?
 
6286
            }?
 
6287
         }|
 
6288
         ## Prometheus multigrid method
 
6289
         element preconditioner {
 
6290
            attribute name { "prometheus" }
 
6291
         }|
 
6292
         ## Hypre preconditioners (includes boomeramg)
 
6293
         element preconditioner {
 
6294
            attribute name { "hypre" },
 
6295
            (
 
6296
               ## BoomerAMG multigrid method
 
6297
               element hypre_type {
 
6298
                  attribute name { "boomeramg" }
 
6299
               }|
 
6300
               ## Other Hypre preconditioners
 
6301
               element hypre_type {
 
6302
                  attribute name { string }
 
6303
               }
 
6304
            )
 
6305
         }|
 
6306
         ## Complete solve
 
6307
         ##
 
6308
         ## This only makes sense for solves where a different approximated preconditioner
 
6309
         ## matrix is provided. For instance when solving pressure with the 
 
6310
         ## option full_schur_complement and using a masslumped schur complement
 
6311
         ## as preconditioner matrix.
 
6312
         ##
 
6313
         ## NOTE: If you are using a krylov method (cg/gmres) for this preconditioner 
 
6314
         ## solve you either need to set your tolerances much stricter for it
 
6315
         ## than in the outer solve (so that the preconditioner is close to an
 
6316
         ## exact matrix inversion), or use fgmres in the outer solve.
 
6317
         element preconditioner {
 
6318
            attribute name { "ksp" },
 
6319
            (
 
6320
                ## Solver options for the full solve done by this preconditioner
 
6321
                element solver {
 
6322
                   pc_ksp_solver_options
 
6323
                }
 
6324
            )
 
6325
         }|
 
6326
         ## Other preconditioners
 
6327
         ##
 
6328
         ## Any preconditioner provided by the PETSc library
 
6329
         ## http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/PC/PCType.html
 
6330
         ## (available preconditiors may depend on the PETSc library installed on your system)
 
6331
         element preconditioner {
 
6332
            attribute name { string }
 
6333
         }
 
6334
      ),
 
6335
      generic_solver_options
 
6336
   )
 
6337
 
 
6338
# this is a copy linear_solver_options_sym, but with preconditioner "ksp"
 
6339
# removed to avoid infinite recursion
 
6340
pc_ksp_solver_options =
 
6341
   (
 
6342
      ## Iterative (Krylov) method to solve the linear discretised equation
 
6343
      ## Given are the most frequently used methods. The solution is done
 
6344
      ## by the PETSc library. Many more methods are provided.
 
6345
      ##
 
6346
      (
 
6347
         ## Conjugate gradient method
 
6348
         ##
 
6349
         ## Only works for symmetric systems.
 
6350
         element iterative_method {
 
6351
            attribute name { "cg" }
 
6352
         }|
 
6353
         ## GMRES
 
6354
         ##
 
6355
         ## Your safest bet for non-symmetric systems.
 
6356
         element iterative_method {
 
6357
            attribute name { "gmres" },
 
6358
            ## Restart value for gmres iteration
 
6359
            ## Higher values give better convergence but require more memory.
 
6360
            ## Suggested value: 30
 
6361
            element restart {
 
6362
               integer
 
6363
            }
 
6364
         }|
 
6365
         ## Direct method
 
6366
         ##
 
6367
         ## This is for non-iterative methods
 
6368
         ## Only makes sense in combination with preconditioners that do a complete solve, e.g. lu.
 
6369
         element iterative_method {
 
6370
            attribute name { "preonly" }
 
6371
         }|
 
6372
         ## Richardson iteration
 
6373
         ##
 
6374
         ## Only apply preconditioner each iteration, no krylov acceleration
 
6375
         element iterative_method {
 
6376
            attribute name { "richardson" }
 
6377
         }|
 
6378
         ## Other methods
 
6379
         ##
 
6380
         ## Any method provided by the PETSc library
 
6381
         ## http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/KSP/KSPType.html
 
6382
         ## (available methods may depend on the PETSc library installed on your system)
 
6383
         element iterative_method {
 
6384
            attribute name { xsd:string }
 
6385
         }
 
6386
      ),
 
6387
      ## Preconditioner to be used in combination with the iterative method.
 
6388
      (
 
6389
         ## Succesive Over-Relaxation
 
6390
         ##
 
6391
         ## This includes SSOR (symmetric sor)
 
6392
         element preconditioner {
 
6393
            attribute name { "sor" }
 
6394
         }|
 
6395
         ## The Eisenstat method
 
6396
         ##
 
6397
         ## This preconditioner is equivalent to SOR but only uses
 
6398
         ## half the number of flops,
 
6399
         ## i.e. same convergence rate but twice as fast per
 
6400
         ## iteration. Because it computes
 
6401
         ## a different preconditioned residual the convergence in
 
6402
         ## practice may be quite different though.
 
6403
         ## It does not work in parallel!
 
6404
         element preconditioner {
 
6405
            attribute name { "eisenstat" }
 
6406
         }|
 
6407
         ## Incomplete LU decomposition
 
6408
         element preconditioner {
 
6409
            attribute name { "ilu" }
 
6410
         }|
 
6411
         ## Incomplete Cholesky decomposition (only works for symmetric matrices)
 
6412
         element preconditioner {
 
6413
            attribute name { "icc" }
 
6414
         }|
 
6415
         ## LU direct solver
 
6416
         ##
 
6417
         ## This performs a complete, direct solve of the equation and should only be used in combination with preonly as iterative method.
 
6418
         element preconditioner {
 
6419
            attribute name { "lu" }
 
6420
        }|
 
6421
         ## Fluidity`s own multigrid method
 
6422
         ##
 
6423
         ## Especially suited for ill-conditioned, large aspect ratio problems.
 
6424
         element preconditioner {
 
6425
            attribute name { "mg" },
 
6426
            ## apply vertical lumping from the full mesh to the surface mesh
 
6427
            ## as the first coarsening step instead of the default
 
6428
            ## aggregation method.
 
6429
            element vertical_lumping {
 
6430
               ## Does additional smoothing by solving the equation but with
 
6431
               ## a dirichilet boundary condition on top given by the last iteration
 
6432
               ## of the multigrid cycle. May be quite expensive per iteration
 
6433
               ## but improves the solution quite a lot for difficult meshes.
 
6434
               element internal_smoother {
 
6435
                  empty
 
6436
               }?
 
6437
            }?
 
6438
         }|
 
6439
         ## Prometheus multigrid method
 
6440
         element preconditioner {
 
6441
            attribute name { "prometheus" }
 
6442
         }|
 
6443
         ## Hypre preconditioners (includes boomeramg)
 
6444
         element preconditioner {
 
6445
            attribute name { "hypre" },
 
6446
            (
 
6447
               ## BoomerAMG multigrid method
 
6448
               element hypre_type {
 
6449
                  attribute name { "boomeramg" }
 
6450
               }|
 
6451
               ## Other Hypre preconditioners
 
6452
               element hypre_type {
 
6453
                  attribute name { string }
 
6454
               }
 
6455
            )
 
6456
         }|
 
6457
         ## Other preconditioners
 
6458
         ##
 
6459
         ## Any preconditioner provided by the PETSc library
 
6460
         ## http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/PC/PCType.html
 
6461
         ## (available preconditiors may depend on the PETSc library installed on your system)
 
6462
         element preconditioner {
 
6463
            attribute name { string }
 
6464
         }
 
6465
      ),
 
6466
      generic_solver_options
 
6467
   )
 
6468
 
 
6469
generic_solver_options =
 
6470
   (
 
6471
      ## Relative error
 
6472
      ##
 
6473
      ## The solver finishes if the preconditioned error becomes smaller than the original preconditioned error times this value.
 
6474
      ## Suggested value: 1.0e-7
 
6475
      element relative_error {
 
6476
         real
 
6477
      },
 
6478
      ## Absolute error bound
 
6479
      ##
 
6480
      ## The solver finishes if the preconditioned error becomes smaller than this value.
 
6481
      element absolute_error {
 
6482
         real
 
6483
      }?,
 
6484
      ## Maximum number of iterations allowed in the linear solver
 
6485
      ## before giving up.
 
6486
      element max_iterations {
 
6487
         integer
 
6488
      },
 
6489
      ## Switch on to not use an initial guess from a previous solve but
 
6490
      ## start with a zero vector. Note that some of the solves always
 
6491
      ## start at zero in which case this switch will have no effect (see the log output).
 
6492
      element start_from_zero {
 
6493
         empty
 
6494
      }?,
 
6495
      ## Remove Null-space from residual after applying preconditioner.
 
6496
      ## This often leads to better convergence rates, when compared to
 
6497
      ## imposing a reference_node to pin the solution.
 
6498
      element remove_null_space {
 
6499
         empty
 
6500
      }?,
 
6501
      ## Miscellaneous PETSc options
 
6502
      ##
 
6503
      ## Any options not included above can be set using the PETSc option syntax
 
6504
      ## For example: -ksp_dtol 1e5 -ksp_monitor_draw
 
6505
      element petsc_options {
 
6506
         string
 
6507
      }?,
 
6508
      (
 
6509
         ## Solver failures are always treated as fatal errors. The
 
6510
         ## model stops at the end of the time step in order to allow
 
6511
         ## for the latest output to be written.
 
6512
         element never_ignore_solver_failures {
 
6513
            empty
 
6514
         }|
 
6515
         ## Allow for an initial period in which solver failures
 
6516
         ## caused by non-convergence in the maximum number of
 
6517
         ## iterations are ignored.
 
6518
         element ignore_non_convergence_during_spin_up {
 
6519
            ## As long as current_time < spin_up_time, solver failures
 
6520
            ## due to non-convergence in the maximum number of
 
6521
            ## iterations are ignored. This might be used for spinning
 
6522
            ## up the model. As there is no guarantee we're actually
 
6523
            ## solving the flow equations to any accuracy, the results
 
6524
            ## in this period should not be trusted.
 
6525
            element spin_up_time {
 
6526
               real
 
6527
            }
 
6528
         }|
 
6529
         ## Ignore all solver failures. This is a dangerous option
 
6530
         ## that should only be used in exceptional cases.
 
6531
         element ignore_all_solver_failures {
 
6532
            empty
 
6533
         }
 
6534
      ),
 
6535
      ## Extra diagnostics to help debug solver problems
 
6536
      element diagnostics {
 
6537
         ## Print out the norm of vectors and matrices before the
 
6538
         ## solve, and that of the solution vector afterwards.
 
6539
         ## Norms are printed at verbosity level 2, so run fluidity with -v2 or -v3
 
6540
         element print_norms {
 
6541
            empty
 
6542
         }?,
 
6543
         ## Options to give extra information for each iteration of the
 
6544
         ## the solve. Some of those may really slow down your computation!
 
6545
         element monitors {
 
6546
            ## Prints the preconditioned residual for each iteration of the solve.
 
6547
            ## This is the error estimation PETSc uses during the solve.
 
6548
            element preconditioned_residual {
 
6549
               empty
 
6550
            }?,
 
6551
            ## Prints the "true" residual for each iteration of the solve,
 
6552
            ## i.e. PETSc computes the L2-norm of r=A-bx. This may mean
 
6553
            ## PETSc has to do extra computations.
 
6554
            element true_residual {
 
6555
               empty
 
6556
            }?,
 
6557
            ## Draws a graph over the convergence of the preconditioned residual
 
6558
            ## during the solve. This option only works for systems where PETSc
 
6559
            ## has been linked with the X library.
 
6560
            element preconditioned_residual_graph {
 
6561
               empty
 
6562
            }?,
 
6563
            ## Prints the error by computing the difference with the provided
 
6564
            ## exact solution each time step.
 
6565
            element true_error {
 
6566
               ## Give the field name of the field that contains the exact
 
6567
               ## solution to be compared with each iteration
 
6568
               attribute exact_solution_field {
 
6569
                  string
 
6570
               }
 
6571
            }?
 
6572
         }
 
6573
      }
 
6574
   )
 
6575
 
 
6576
 
 
6577
input_choice_tensor_field =
 
6578
   (
 
6579
      (
 
6580
         ## An isotropic tensor, i.e.
 
6581
         ## one with no directional variation.
 
6582
         ## Can be represented as a scalar real.
 
6583
         element isotropic {
 
6584
            input_choice_real
 
6585
         }|
 
6586
         ## A symmetric tensor, i.e.
 
6587
         ## A^T = A
 
6588
         element anisotropic_symmetric {
 
6589
            input_choice_real_dim_symmetric_tensor
 
6590
         }|
 
6591
         ## A general asymmetric tensor.
 
6592
         element anisotropic_asymmetric {
 
6593
            input_choice_real_dim_tensor
 
6594
         }
 
6595
      )
 
6596
   )
 
6597
 
 
6598
constitutive_laws =
 
6599
   (
 
6600
      (
 
6601
         ## Constitutive laws for fluids
 
6602
         element constitutive_law {
 
6603
            attribute name { "fluid" }
 
6604
         }|
 
6605
         ## Constitutive laws for solids
 
6606
         element constitutive_law {
 
6607
            attribute name { "solid" }
 
6608
         }
 
6609
      )
 
6610
   )
 
6611
   
 
6612
region_ids = 
 
6613
   ( 
 
6614
      ## Optional region ids to associate different values
 
6615
      ## to different regions of the mesh.
 
6616
      ## Leave unselected if you`re not using multiple regions or
 
6617
      ## region_ids.
 
6618
      ## Currently only works with triangle files created by gmsh2triangle.
 
6619
      element region_ids {
 
6620
         integer_vector
 
6621
      }?
 
6622
   )
 
6623
 
 
6624
temporal_control_volume_options =
 
6625
   (
 
6626
      ## Temporal discretisation options that are only relevant if a control volume or mixed control volume - continuous galerkin spatial discretisation is selected for this field.
 
6627
      element control_volumes {
 
6628
         ## Number of iterations within an advection solve.
 
6629
         ## This increases the accuracy of the face values and ensures that
 
6630
         ## the pivoted solution is cancelled out.
 
6631
         ## Defaults to 1 if unselected.
 
6632
         element number_advection_iterations {
 
6633
            attribute replaces { "INT(ABS(NDISOT)/10)" },
 
6634
            integer,
 
6635
            ## Cut short advection_iterations if the specified tolerance
 
6636
            ## is reached.
 
6637
            ## This only works for pure control volume discretisations.
 
6638
            element tolerance {
 
6639
               real,
 
6640
               (
 
6641
                  ## Select the norm with which you want the tolerance to be tested.
 
6642
                  ##
 
6643
                  ## The infinity norm.
 
6644
                  element infinity_norm {
 
6645
                    empty
 
6646
                  }|
 
6647
                  ## Select the norm with which you want the tolerance to be tested.
 
6648
                  ##
 
6649
                  ## The l2 norm.
 
6650
                  element l2_norm {
 
6651
                    empty
 
6652
                  }|
 
6653
                  ## Select the norm with which you want the tolerance to be tested.
 
6654
                  ##
 
6655
                  ## The l2 norm evaluated on a control volume mesh.
 
6656
                  element cv_l2_norm {
 
6657
                    empty
 
6658
                  }
 
6659
               )               
 
6660
            }?
 
6661
         }?,
 
6662
         (
 
6663
            ## Use timestep subcycling to solve this equation.
 
6664
            ## Specify the maximum courant number per subcycle.
 
6665
            ## This only works for pure control volume discretisations.
 
6666
            element maximum_courant_number_per_subcycle {
 
6667
               real,
 
6668
               field_based_cfl_number_options
 
6669
            }|
 
6670
            ## Use timestep subcycling to solve this equation.
 
6671
            ## Specify the number of subcycles.
 
6672
            ## This only works for pure control volume discretisations.
 
6673
            element number_advection_subcycles {
 
6674
               integer
 
6675
            }
 
6676
         )?,
 
6677
         ## Only works if a control volume or mixed control volume -
 
6678
         ## continuous galerkin spatial discretisation is selected.
 
6679
         ## If not active then the theta specified above will be used.
 
6680
         ## Otherwise use variable limited theta on individual faces.
 
6681
         element limit_theta {
 
6682
            attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 1,3,5,7,9 (odd)" },
 
6683
            empty
 
6684
         }?,
 
6685
         ## Only works if a control volume or mixed control volume -
 
6686
         ## continuous galerkin spatial discretisation is selected.
 
6687
         ## Time discretisation of upwind discretisation off which the
 
6688
         ## higher order solution is pivotted.
 
6689
         ##  - pivot_theta = 1 - implicit pivot (default if not set and 
 
6690
         ##                      best choice if not intentionally modifying
 
6691
         ##                      scheme to be explicit)
 
6692
         ##  - pivot_theta = 0 - explicit pivot
 
6693
         element pivot_theta {
 
6694
            real
 
6695
         }?
 
6696
      }
 
6697
   )
 
6698
 
 
6699
temporal_discontinuous_galerkin_options = 
 
6700
   (
 
6701
      ## This enables DG-specific timestepping options, such as
 
6702
      ## explicit advection subcycling. 
 
6703
      element discontinuous_galerkin {
 
6704
         (
 
6705
            ## Use timestep subcycling to solve this equation.
 
6706
            ## Specify the maximum courant number per subcycle.
 
6707
            element maximum_courant_number_per_subcycle {
 
6708
               real
 
6709
            }|
 
6710
            ## Use timestep subcycling to solve this equation.
 
6711
            ## Specify the number of subcycles.
 
6712
            element number_advection_subcycles {
 
6713
               integer
 
6714
            }
 
6715
         )?
 
6716
      }
 
6717
   )
 
6718
 
 
6719
legacy_mixed_cv_cg_options = 
 
6720
   (
 
6721
      ## Use a mixed control volume - continuous galerkin
 
6722
      ## discretisation.
 
6723
      ##
 
6724
      ## This uses a control volume discretisation of the advective
 
6725
      ## terms and a continuous galerkin representation of the
 
6726
      ## diffusion, source and absorption terms.
 
6727
      ## Clearly, in terms of discretisation this does the same thing
 
6728
      ## as a pure control volume discretisation if diffusion terms
 
6729
      ## are zero.
 
6730
      ## However it still follows a partially legacy code path.
 
6731
      element legacy_mixed_cv_cg {
 
6732
         attribute replaces { "NDISOT >= 10, DISOTT = -7, TLUMP = .TRUE." },
 
6733
         spatial_control_volume_options,
 
6734
         
 
6735
         ## Allows legacy options to be set.
 
6736
         ## BE WARNED: this probably means you're using inconsistent discretisations
 
6737
         ## on different terms - make sure you're happy with what your code path is doing
 
6738
         ## before selecting this.
 
6739
         element legacy_disott {
 
6740
            attribute replaces { "DISOTT" },
 
6741
            integer
 
6742
         }?
 
6743
      }
 
6744
   )
 
6745
 
 
6746
pure_cv_options = 
 
6747
   (
 
6748
      ## Use a pure control volume discretisations.
 
6749
      ## Follows a new control volume code path.
 
6750
      element control_volumes {
 
6751
         spatial_control_volume_options,
 
6752
         (
 
6753
            ## Use the gradient of the field constructed using the
 
6754
            ## basis functions of the parent finite element mesh to
 
6755
            ## form the divergence.
 
6756
            ##
 
6757
            ## DOES NOT CURRENTLY WORK WITH ROBIN OR WEAK DIRICHLET BOUNDARY CONDITIONS!
 
6758
            ##
 
6759
            ## Based on schemes in Handbook of Numerical Analysis,
 
6760
            ## P.G. Ciarlet, J.L. Lions eds, vol 7, pp 713-1020
 
6761
            element diffusion_scheme {
 
6762
              attribute name{"ElementGradient"}
 
6763
            }|
 
6764
            ## Use an auxiliary gradient equation to find the gradient of the field.
 
6765
            ##
 
6766
            ## DOES NOT CURRENTLY WORK WITH ROBIN BOUNDARY CONDITIONS!
 
6767
            ##
 
6768
            ## Based on scheme proposed in Bassi, F. & Rebay, S., A
 
6769
            ## high-order accurate discontinuous finite element method
 
6770
            ## for the numerical solution of the compressible
 
6771
            ## Navier-Stokes equations, Journal Of Computational
 
6772
            ## Physics, 1997, 131, 267-279
 
6773
            element diffusion_scheme {
 
6774
              attribute name{"BassiRebay"}
 
6775
            }
 
6776
         )
 
6777
      }
 
6778
   )
 
6779
 
 
6780
coupled_cv_options = 
 
6781
   (
 
6782
      ## Use a pure control volume discretisations with face value
 
6783
      ## restrictions between different fields in different material_phases.
 
6784
      ##
 
6785
      ## THIS DOES NOT WORK WITH DIFFUSION!
 
6786
      ##
 
6787
      ## Follows a new control volume code path.
 
6788
      element coupled_cv {
 
6789
         coupled_spatial_control_volume_options,
 
6790
         ## Set the maximum and minimum bounds for the sum up to and including this field.
 
6791
         ## This defines the limiter used to enforce boundedness on this field.
 
6792
         element parent_sum {
 
6793
            element target_maximum {
 
6794
              real
 
6795
            },
 
6796
            element target_minimum {
 
6797
              real
 
6798
            }
 
6799
         }
 
6800
      }
 
6801
   )
 
6802
 
 
6803
spatial_control_volume_options = standard_control_volume_options
 
6804
spatial_control_volume_options |= compressive_control_volume_options
 
6805
 
 
6806
standard_control_volume_options = 
 
6807
   (
 
6808
      ## First Order Upwind face value discretisation
 
6809
      ##  face_value = donor_value, 
 
6810
      ## where
 
6811
      ##  donor_value = income*val_1 + (1.-income)*val_2, 
 
6812
      ## where val_i is the value on the ith node neighbouring the face and
 
6813
      ## income = [0, 1] depending on whether the flow is coming from node 1 or 2
 
6814
      ## First order upwinding is monotonic so no limiting is ever required
 
6815
      element face_value {
 
6816
        attribute name { "FirstOrderUpwind" },
 
6817
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 0,1" },
 
6818
        empty
 
6819
      }|
 
6820
      ## Trapezoidal face value discretisation
 
6821
      ##  face_value = 0.5*(val_1 + val_2), 
 
6822
      ## where
 
6823
      ##  val_i is the value on the ith node neighbouring the face
 
6824
      ##
 
6825
      ## Trapezoidal discretisation is unbounded so limiting is compulsory
 
6826
      element face_value {
 
6827
        attribute name { "Trapezoidal" },
 
6828
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 2,3" },
 
6829
        limiter_options
 
6830
      }|
 
6831
      ## Finite Element face value discretisation
 
6832
      ##  face_value = finite element interpolation from surrounding nodes
 
6833
      ##
 
6834
      ## Finite element discretisation may become unbounded so limiting is often necessary.
 
6835
      element face_value {
 
6836
        attribute name { "FiniteElement" },
 
6837
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 4,5,6,7" },
 
6838
        limiter_options?
 
6839
      }
 
6840
   )
 
6841
   
 
6842
coupled_spatial_control_volume_options = coupled_control_volume_options
 
6843
coupled_spatial_control_volume_options |= compressive_control_volume_options
 
6844
 
 
6845
# coupled control volume options are the same as the standard ones (annoyingly copied and pasted)
 
6846
# except that firstorderupwind gets limiter options
 
6847
coupled_control_volume_options = 
 
6848
   (
 
6849
      ## First Order Upwind face value discretisation
 
6850
      ##  face_value = donor_value, 
 
6851
      ## where
 
6852
      ##  donor_value = income*val_1 + (1.-income)*val_2, 
 
6853
      ## where val_i is the value on the ith node neighbouring the face and
 
6854
      ## income = [0, 1] depending on whether the flow is coming from node 1 or 2
 
6855
      ## First order upwinding is monotonic so no limiting is ever required
 
6856
      element face_value {
 
6857
        attribute name { "FirstOrderUpwind" },
 
6858
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 0,1" },
 
6859
        limiter_options?
 
6860
      }|
 
6861
      ## Trapezoidal face value discretisation
 
6862
      ##  face_value = 0.5*(val_1 + val_2), 
 
6863
      ## where
 
6864
      ##  val_i is the value on the ith node neighbouring the face
 
6865
      ##
 
6866
      ## Trapezoidal discretisation is unbounded so limiting is compulsory
 
6867
      element face_value {
 
6868
        attribute name { "Trapezoidal" },
 
6869
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 2,3" },
 
6870
        limiter_options
 
6871
      }|
 
6872
      ## Finite Element face value discretisation
 
6873
      ##  face_value = finite element interpolation from surrounding nodes
 
6874
      ##
 
6875
      ## Finite element discretisation may become unbounded so limiting is often necessary.
 
6876
      element face_value {
 
6877
        attribute name { "FiniteElement" },
 
6878
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 4,5,6,7" },
 
6879
        limiter_options?
 
6880
      }
 
6881
   )
 
6882
   
 
6883
compressive_control_volume_options = 
 
6884
   (
 
6885
      ## HyperC face value discretisation
 
6886
      ##
 
6887
      ## face_value calculated from upper bound of explicit TVD zone of NVD diagram
 
6888
      ## Normally used for MaterialVolumeFraction fields
 
6889
      element face_value {
 
6890
        attribute name { "HyperC" },
 
6891
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 8,9" },
 
6892
        upwind_value_options?,
 
6893
        cv_face_cfl_number_options
 
6894
      }|
 
6895
      ## UltraC face value discretisation
 
6896
      ##
 
6897
      ## face_value calculated from extended upper bound of
 
6898
      ## explicit TVD zone of NVD diagram assuming
 
6899
      ## values bounded by target_maximum and target_minimum.
 
6900
      element face_value {
 
6901
        attribute name { "UltraC" },
 
6902
        attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 8,9, with ULTRAC = TRUE from solidity_options.inp" },
 
6903
        ## Specifiy the upper bound which UltraC will use to
 
6904
        ## calculate the maximum flux.
 
6905
        element target_maximum {
 
6906
            real
 
6907
        },
 
6908
        ## Specifiy the lower bound which UltraC will use to
 
6909
        ## calculate the minimum flux.
 
6910
        element target_minimum {
 
6911
            real
 
6912
        },
 
6913
        upwind_value_options?,
 
6914
        cv_face_cfl_number_options
 
6915
      }|
 
6916
      ## **UNDER TESTING**
 
6917
      ##
 
6918
      ## PotentialUltraC face value discretisation
 
6919
      ##
 
6920
      ## face_value calculated from extended upper bound of
 
6921
      ## explicit TVD zone of NVD diagram if potential
 
6922
      ## value of field is sufficient (as specified by
 
6923
      ## target_maximum) to ensure the correct front advection
 
6924
      ## velocity.
 
6925
      ##
 
6926
      ## If not then either switch to HyperC or use a modified flux
 
6927
      ## based on the potential function.
 
6928
      element face_value {
 
6929
        attribute name { "PotentialUltraC" },
 
6930
        ## Specifiy the upper bound which PotentialUltraC will use
 
6931
        ## to calculate the maximum flux if the potential function
 
6932
        ## value is sufficient to maintain the correct front
 
6933
        ## advection velocity.
 
6934
        element target_maximum {
 
6935
            real
 
6936
        },
 
6937
        ## Specifiy the lower bound which PotentialUltraC will use to calculate the minimum flux.
 
6938
        element target_minimum {
 
6939
            real
 
6940
        },
 
6941
        (
 
6942
            ## Select what PotentialUltraC should do if the
 
6943
            ## potential function value does not reach the required
 
6944
            ## value specified by the target_maximum.
 
6945
            ##
 
6946
            ## Switch to using HyperC face values.  This ensures
 
6947
            ## that the advection velocity is correct however may
 
6948
            ## create isolated regions beneath the target_maximum.
 
6949
            element switch_to_hyperc {
 
6950
              empty
 
6951
            }|
 
6952
            ## Select what PotentialUltraC should do if the
 
6953
            ## potential function value does not reach the required
 
6954
            ## value specified by the target_maximum.
 
6955
            ##
 
6956
            ## Modify the maximum nodal values (both downwind and
 
6957
            ## upwind) so that the fluxes are at their maximum
 
6958
            ## possible without affecting the front advection
 
6959
            ## velocity.
 
6960
            element use_potential_flux {
 
6961
              empty
 
6962
            }
 
6963
        ),
 
6964
        upwind_value_options?,
 
6965
        cv_face_cfl_number_options
 
6966
      }
 
6967
   )
 
6968
 
 
6969
#Select the type of dynamic control to be used
 
6970
#Note: DEM and FEMDEM require the respective libraries
 
6971
#to be compiled.
 
6972
input_solid_dynamics_choice =         
 
6973
   (
 
6974
      ## Obtain values from point and radius file.
 
6975
      ##
 
6976
      ## First line of file is free to use (for comments)
 
6977
      ## Second line must contain the number of particles
 
6978
      ## Third and fourth line are again for comments. 
 
6979
      ## Following lines include 10 columns, corresponding to 
 
6980
      ## the particle's x, y, and z positions, followed by the radius, then
 
6981
      ## velocities in x, y, and z directions, followed by angular velocities
 
6982
      ## in the x, y, and z directions.
 
6983
      element dynamic_type {
 
6984
         attribute name {"from_input_file"},
 
6985
         attribute file_name {xsd:string}
 
6986
      }|
 
6987
      ## Two python scripts must be provided. The script is cycled over each particle.
 
6988
      ## One script for particle position (output is tuple of position coords)
 
6989
      ## Second script is for particle radius (output is tuple of position coords)
 
6990
      ## Third script is for particle translational velocity.
 
6991
      ## Fourth script is for particle angular velocity. (Note: particles 
 
6992
      ## have a no slip boundary condition at the surface, so this angular velocity
 
6993
      ## WILL matter to the flow.)
 
6994
      ## Python functions should be of the form:
 
6995
      ##  def val(X, t):
 
6996
      ##    Function code
 
6997
      ##    return # Return value
 
6998
      ## where X is a tuple of length geometry dimension.
 
6999
      ##    X[0] contains the number of the particle (in real format)
 
7000
      element dynamic_type {
 
7001
         attribute name {"python_script"}
 
7002
      }|
 
7003
      element dynamic_type {
 
7004
         attribute name {"use_simple_dynamics"},
 
7005
         element set_bottom{real},
 
7006
         element set_xmin{real},
 
7007
         element set_ymin{real},
 
7008
         element set_zmin{real},
 
7009
         element set_xmax{real},
 
7010
         element set_ymax{real},
 
7011
         element set_zmax{real}
 
7012
      }|
 
7013
      ## Using y3D to model dynamics. Filename of input file for y3D must
 
7014
      ## be specified.
 
7015
      element dynamic_type {
 
7016
         attribute name {"use_y3D"},
 
7017
         attribute file_name {xsd:string}
 
7018
      }|
 
7019
      ## Using femdem 2D to model dynamics. Filename of input file must
 
7020
      ## be specified.
 
7021
      element dynamic_type {
 
7022
         attribute name {"use_2Dfemdem"},
 
7023
         attribute file_name {xsd:string}
 
7024
      }|
 
7025
      ## Using femdem 3D to model dynamics. Filename of input file must
 
7026
      ## be specified.
 
7027
      element dynamic_type {
 
7028
         attribute name {"use_3Dfemdem"},
 
7029
         attribute file_name {xsd:string},
 
7030
         element quad2lin {
 
7031
            attribute file_name {xsd:string}
 
7032
         }
 
7033
      }         
 
7034
   )
 
7035
 
 
7036
cap_option =
 
7037
   (
 
7038
      ## Cap the min and max values of this field when using
 
7039
      ## it as a volume fraction to work out bulk material
 
7040
      ## properties.
 
7041
      ## No capping used if not selected.
 
7042
      element cap_values {
 
7043
         ## Set the upper bound on the field.
 
7044
         ## Defaults to huge(0.0)*epsilon(0.0) if not set.
 
7045
         element upper_cap {
 
7046
            real
 
7047
         }?,
 
7048
         ## Set the lower bound on the field.
 
7049
         ## Defaults to -huge(0.0)*epsilon(0.0) if not set.
 
7050
         element lower_cap {
 
7051
            real
 
7052
         }?
 
7053
      }
 
7054
   )
 
7055
 
 
7056
surface_tension_option =
 
7057
   (
 
7058
      element surface_tension {
 
7059
        ## Surface tension coefficient
 
7060
        element surface_tension_coefficient {
 
7061
          real
 
7062
        },
 
7063
        ## The equilibrium contact angle (in radians) with the boundaries identified by the surface ids
 
7064
        element equilibrium_contact_angle {
 
7065
          real,
 
7066
          ## Surface ids:
 
7067
          element surface_ids {
 
7068
              integer_vector
 
7069
          }
 
7070
        }?
 
7071
      }
 
7072
   )
 
7073
 
 
7074
limiter_options =
 
7075
  (
 
7076
      ## Limit the face value to satisfy a boundedness criterion.
 
7077
      element limit_face_value{
 
7078
        (
 
7079
          sweby_limiter|
 
7080
          ultimate_limiter
 
7081
        )
 
7082
      }
 
7083
  )
 
7084
 
 
7085
sweby_limiter = 
 
7086
  ## See "High-Resolution Schemes Using Flux Limiters for
 
7087
  ## Hyperblic Conservation-Laws", P. K. Sweby, 1984, Siam
 
7088
  ## Journal on Numerical Analysis, 21, 995-1011
 
7089
  element limiter {
 
7090
    attribute replaces { "MOD(INT(ABS(NDISOT)/1),10) = 2,3,4,5" },
 
7091
    attribute name {"Sweby"},
 
7092
    slope_options?,
 
7093
    upwind_value_options?
 
7094
  }
 
7095
 
 
7096
ultimate_limiter =
 
7097
  ## See "The Ultimate Conservative Difference Scheme Applied
 
7098
  ## to Unsteady One-Dimensional Advection", B. P. Leonard,
 
7099
  ## 1991, Computer Methods in Applied Mechanics and
 
7100
  ## Engineering, 88, 17-74
 
7101
  element limiter {
 
7102
    attribute name {"Ultimate"},
 
7103
    field_based_cfl_number_options,
 
7104
    upwind_value_options?
 
7105
  }
 
7106
 
 
7107
slope_options =
 
7108
   (
 
7109
      ## Control the upper and lower slopes of the NVD limiter
 
7110
      element slopes {
 
7111
         ## Defaults to Sweby, 1984 limiter (= 1.0) if unselected
 
7112
         element lower {
 
7113
            real
 
7114
         }?,
 
7115
         ## Defaults to Sweby, 1984 limiter (= 2.0) if unselected
 
7116
         element upper {
 
7117
            real
 
7118
         }?
 
7119
      }
 
7120
   )
 
7121
 
 
7122
upwind_value_options =
 
7123
   (
 
7124
      (
 
7125
         ## Select the method to be used for calculating the upwind value.
 
7126
         ## If not selected will default to project_upwind_value_from_point for
 
7127
         ## simplex element meshes and to a locally_bound_upwind_value for cube
 
7128
         ## element meshes.
 
7129
         ##
 
7130
         ## This method projects the upwind value from a point in the element just
 
7131
         ## upwind of the node pair straddling the face.  It is otherwise known as 
 
7132
         ## anisotropic limiting.
 
7133
         ## This is only available on simplex meshes as it involes a search around
 
7134
         ## the donor node to find the upwind element.
 
7135
         element project_upwind_value_from_point {
 
7136
            attribute replaces { "NDISOT > 0 on simplex meshes" },
 
7137
            ## When the donor node is on a domain boundary reflect the projection
 
7138
            ## back into the mesh.
 
7139
            element reflect_off_domain_boundaries {
 
7140
               empty
 
7141
            }?,
 
7142
            ## Constrain the projected value to be between the min and max of the
 
7143
            ## element values which it was found from.
 
7144
            element bound_projected_value_locally {
 
7145
               empty
 
7146
            }?,
 
7147
            ## Store the locations of the elements where the upwind values
 
7148
            ## are projected from for each node pair.
 
7149
            ## This inserts an integer csr matrix into state so is memory expensive but
 
7150
            ## saves a significant amount of time (searching around the neighbouring elements).
 
7151
            ## This is unsafe for moving meshes but should be ok for adaptive meshes.
 
7152
            element store_upwind_elements {
 
7153
               attribute replaces { "ABS(NDISOT) >= 1000" },
 
7154
               ## Store the quadrature locations within the elements
 
7155
               ## where the upwind values
 
7156
               ## are projected from for each node pair.
 
7157
               ## This inserts a real block csr matrix into state so is even more memory
 
7158
               ## expensive than just storing the upwind elements and
 
7159
               ## only saves a comparitively
 
7160
               ## marginal amount of time (as actually searching the
 
7161
               ## neighbouring elements is the
 
7162
               ## slowest bit, finding the quadrature is relatively easy).
 
7163
               element store_upwind_quadrature {
 
7164
                  attribute replaces { "ABS(NDISOT) >= 1000" },
 
7165
                  empty
 
7166
               }?
 
7167
            }?
 
7168
         }|
 
7169
         ## Select the method to be used for calculating the upwind value.
 
7170
         ## If not selected will default to project_upwind_value_from_point for
 
7171
         ## simplex element meshes and to a locally_bound_upwind_value for cube
 
7172
         ## element meshes.
 
7173
         ##
 
7174
         ## Projects the value of the advected variable from the downwind or donor node
 
7175
         ## using the interpolated gradient at the donor node in the
 
7176
         ## direction of the vector
 
7177
         ## connecting the node pair straddling the face.
 
7178
         ## This is available on all meshes (except if bounding the values).
 
7179
         element project_upwind_value_from_gradient {
 
7180
            (
 
7181
               ## Select which node to project from:
 
7182
               ## Project from the downwind node (Jasak et al., 1999) so that:
 
7183
               ## upwind_value = downwind_value - 2*gradient.vector
 
7184
               element project_from_downwind_value {
 
7185
                  comment
 
7186
               }|
 
7187
               ## Select which node to project from:
 
7188
               ## Project from the donor node so that:
 
7189
               ## upwind_value = donor_value - gradient.vector
 
7190
               element project_from_donor_value {
 
7191
                  comment
 
7192
               }
 
7193
            ),
 
7194
            ## When the donor node is on a domain boundary reflect the projection
 
7195
            ## back into the mesh.
 
7196
            element reflect_off_domain_boundaries {
 
7197
               empty
 
7198
            }?,
 
7199
            ## Constrain the projected value to be between the min and max of the
 
7200
            ## element values which surround it.
 
7201
            ## This is only available on simplex meshes as it involes a search around
 
7202
            ## the donor node to find the upwind element.
 
7203
            element bound_projected_value_locally {
 
7204
               ## Store the locations of the elements closest to the project value.
 
7205
               ## This inserts an integer csr matrix into state so is
 
7206
               ## memory expensive but
 
7207
               ## saves a significant amount of time (searching around
 
7208
               ## the neighbouring elements).
 
7209
               ## This is unsafe for moving meshes but should be ok for adaptive meshes.
 
7210
               element store_upwind_elements {
 
7211
                  comment
 
7212
               }?
 
7213
            }?
 
7214
         }|
 
7215
         ## Select the method to be used for calculating the upwind value.
 
7216
         ## If not selected will default to project_upwind_value_from_point for
 
7217
         ## simplex element meshes and to a locally_bound_upwind_value for cube
 
7218
         ## element meshes.
 
7219
         ##
 
7220
         ## Chooses an upwind value by selecting the maximum or minimum of the neighbouring
 
7221
         ## nodes depending on the local slope of the donor and downwind values.
 
7222
         ## Otherwise known as isotropic limiting.
 
7223
         ## This is available on all meshes.
 
7224
         element locally_bound_upwind_value {
 
7225
            attribute replaces { "all cube elements, NDISOT < 0 on simplex elements" },
 
7226
            empty
 
7227
         }|
 
7228
         ## Select the method to be used for calculating the upwind value.
 
7229
         ## If not selected will default to project_upwind_value_from_point for
 
7230
         ## simplex element meshes and to a locally_bound_upwind_value for cube
 
7231
         ## element meshes.
 
7232
         ##
 
7233
         ## Chooses an upwind value by selecting the value at the node most directy
 
7234
         ## upwind from the vector connecting the donor and downwind nodes.
 
7235
         ## This is available on all meshes.
 
7236
         element pseudo_structured_upwind_value {
 
7237
            empty
 
7238
         }
 
7239
      )
 
7240
   )
 
7241
 
 
7242
field_based_cfl_number_options =
 
7243
   (
 
7244
      (
 
7245
         ## Select the Courant Number definition to be used.
 
7246
         ##
 
7247
         ## This uses the control volume definition of the CFL Number.
 
7248
         element courant_number {
 
7249
            attribute name { "ControlVolumeCFLNumber" },
 
7250
            empty
 
7251
         }|
 
7252
         ## ***UNDER TESTING***
 
7253
         ##
 
7254
         ## Select the Courant Number definition to be used.
 
7255
         ##
 
7256
         ## This uses the control volume definition of the CFL Number.
 
7257
         element courant_number {
 
7258
            attribute name { "CVMaterialDensityCFLNumber" },
 
7259
            empty
 
7260
         }|
 
7261
         ## Select the Courant Number definition to be used.
 
7262
         ##
 
7263
         ## This uses the finite element approximation of the CFL Number.
 
7264
         element courant_number {
 
7265
            attribute name { "CFLNumber" },
 
7266
            empty
 
7267
         }|
 
7268
         ## Select the Courant Number definition to be used.
 
7269
         element courant_number {
 
7270
            attribute name { string },
 
7271
            empty
 
7272
         }
 
7273
      )
 
7274
   )
 
7275
 
 
7276
cv_face_cfl_number_options =
 
7277
   (
 
7278
      (
 
7279
         ## Select the Courant Number definition to be used in the slope of
 
7280
         ## the NVD diagram upper bound.
 
7281
         ## This uses the finite difference definition of the CFL Number
 
7282
         ## consistent with the 1D version of HyperC (Leonard, 1981).
 
7283
         ## This is the default that reproduces old behaviour.
 
7284
         ## All others are under testing or construction.
 
7285
         element courant_number {
 
7286
            attribute name { "FiniteDifferenceCFLNumber" },
 
7287
            empty
 
7288
         }|
 
7289
         ## Select the Courant Number definition to be used in the slope of
 
7290
         ## the NVD diagram upper bound.
 
7291
         ## This uses the control volume definition of the CFL Number.
 
7292
         element courant_number {
 
7293
            attribute name { "ControlVolumeCFLNumber" },
 
7294
            empty
 
7295
         }|
 
7296
         ## ***UNDER TESTING***
 
7297
         ##
 
7298
         ## Select the Courant Number definition to be used in the slope of
 
7299
         ## the NVD diagram upper bound.
 
7300
         ## This uses a control volume definition of the CFL Number
 
7301
         ## that incorporates the MaterialDensity.
 
7302
         ## Requires a MaterialDensity field in this material_phase!
 
7303
         element courant_number {
 
7304
            attribute name { "CVMaterialDensityCFLNumber" },
 
7305
            empty
 
7306
         }|
 
7307
         ## ***UNDER TESTING***
 
7308
         ##
 
7309
         ## Select the Courant Number definition to be used in the slope of
 
7310
         ## the NVD diagram upper bound.
 
7311
         ## This uses the finite element approximation of the CFL Number.
 
7312
         element courant_number {
 
7313
            attribute name { "CFLNumber" },
 
7314
            empty
 
7315
         }|
 
7316
         ## ***UNDER TESTING***
 
7317
         ##
 
7318
         ## Select the Courant Number definition to be used in the slope of
 
7319
         ## the NVD diagram upper bound.
 
7320
         element courant_number {
 
7321
            attribute name { string },
 
7322
            empty
 
7323
         }
 
7324
      )
 
7325
   )
 
7326
 
 
7327
timestep_cfl_number_options =
 
7328
   (
 
7329
      (
 
7330
         ## Select the Courant Number definition to be used for adaptive timestepping.
 
7331
         ## This uses the finite element approximation of the CFL Number.
 
7332
         element courant_number {
 
7333
            attribute name { "CFLNumber" },
 
7334
              ## Select the mesh on which you wish to evaluate the CFLNumber.
 
7335
              velocity_mesh_choice
 
7336
         }|
 
7337
         ## Select the Courant Number definition to be used for adaptive timestepping.
 
7338
         ## This uses the control volume definition of the CFL Number.
 
7339
         element courant_number {
 
7340
            attribute name { "ControlVolumeCFLNumber" },
 
7341
              ## Select the mesh on which you wish to evaluate the ControlVolumeCFLNumber.
 
7342
              velocity_mesh_choice
 
7343
         }
 
7344
      )
 
7345
   )
 
7346
 
 
7347
mixing_stats =
 
7348
   (
 
7349
      ## Enable to include in the .stat file the fractions of the
 
7350
      ## scalar field contained in
 
7351
      ## bins specified by the user. This allows mixing of the field to be quantified.
 
7352
      ## Replaces and expands upon the old heaviside.dat file
 
7353
      element include_mixing_stats{
 
7354
         attribute name { xsd:string },
 
7355
         attribute replaces { "heaviside.dat file" },
 
7356
         (
 
7357
            ## Select whether to evaluate the volume fraction over the finite element
 
7358
            ## (continuous galerkin) or within the control volume (control_volumes).
 
7359
            ##
 
7360
            ## NOTE: continuous_galerkin only works with linear tets
 
7361
            ##
 
7362
            ## NOTE: continuous_galerkin is not fully validated yet
 
7363
            element continuous_galerkin {
 
7364
               ## if select normalise the volume fractions will be
 
7365
               ## divided by the total volume of the domain
 
7366
               element normalise {
 
7367
                  empty
 
7368
               }?
 
7369
            }|
 
7370
            ## Select whether to evaluate the volume fraction over the finite element
 
7371
            ## (continuous galerkin) or within the control volume (control_volumes).
 
7372
            element control_volumes {
 
7373
               ## if select normalise the volume fractions will be divided by the total volume of the domain  
 
7374
               element normalise {
 
7375
                  empty
 
7376
               }?
 
7377
            }
 
7378
         ),
 
7379
         ## The values of the bounds of the bins 
 
7380
         ## e.g. the values 0 1 2 3 will return 4 bins 
 
7381
         ## and the fraction of the field in each bin with,
 
7382
         ## 0<=field<1, 1<=field<2, 2<=field<3, 3<=field, 
 
7383
         ## will be calculated. 
 
7384
         element mixing_bin_bounds { 
 
7385
            real_vector 
 
7386
         },
 
7387
         ## Define the tolerance beneath the specified bins that should be included.
 
7388
         ## Defaults to zero at machine tolerance (epsilon(0.0)) if not selected.
 
7389
         element tolerance {
 
7390
            real
 
7391
         }?
 
7392
      }
 
7393
   )
 
7394
 
 
7395
cv_stats =
 
7396
   (
 
7397
      ## Include statistics evaluated on the control volume mesh.
 
7398
      element include_cv_stats {
 
7399
         empty
 
7400
      }
 
7401
   )
 
7402
 
 
7403
# Options for inclusion of calculations of surface integrals in the .stat file   
 
7404
surface_integral_stats_base.surface_integral =
 
7405
   (
 
7406
      attribute name { xsd:string },
 
7407
      ## Surface IDs defining the surface over which to integrate. If disabled, integrates over the whole surface.
 
7408
      element surface_ids {
 
7409
         integer_vector
 
7410
      }?,
 
7411
      ## Enable to normalise the integral by dividing by the surface area
 
7412
      element normalise {
 
7413
         comment
 
7414
      }?
 
7415
   )
 
7416
surface_integral_stats_scalar =
 
7417
   (
 
7418
      ## Surface integral calculations. The following integral types are available:
 
7419
      ##  value: Integrates the field
 
7420
      ##  gradient_normal: Integrates the normal component of the gradient of the field
 
7421
      element surface_integral {
 
7422
         surface_integral_stats_scalar.surface_integral
 
7423
      }
 
7424
   )
 
7425
surface_integral_stats_scalar.surface_integral = surface_integral_stats_base.surface_integral
 
7426
surface_integral_stats_scalar.surface_integral &=
 
7427
   (
 
7428
      attribute type { "value" | "gradient_normal" }
 
7429
   )
 
7430
surface_integral_stats_vector =
 
7431
   (
 
7432
      ## Surface integral calculations. The following integral types are available:
 
7433
      ##  normal: Integrates the normal component of the field
 
7434
      element surface_integral {
 
7435
         surface_integral_stats_vector.surface_integral
 
7436
      }
 
7437
   )
 
7438
surface_integral_stats_vector.surface_integral = surface_integral_stats_base.surface_integral
 
7439
surface_integral_stats_vector.surface_integral &=
 
7440
   (
 
7441
      attribute type { "normal" }
 
7442
   )
 
7443
 
 
7444
velocity_equation_choice =
 
7445
   (
 
7446
      ## Select the equation used to solve for velocity.
 
7447
      ## LinearMomentum is the norm and works for all discretisation types.
 
7448
      element equation {
 
7449
         attribute name { "LinearMomentum" }
 
7450
      }|
 
7451
      ## Select the equation used to solve for velocity.
 
7452
      ## Boussinesq only works for continuous_galerkin and discontinuous_galerkin.
 
7453
      element equation {
 
7454
         attribute name { "Boussinesq" }
 
7455
      }|
 
7456
      ## Select the equation used to solve for velocity.
 
7457
      ## Drainage only works for continuous_galerkin and discontinuous_galerkin.
 
7458
      element equation {
 
7459
         attribute name { "Drainage" }
 
7460
      }
 
7461
   )
 
7462
 
 
7463
scalar_equation_choice =
 
7464
   (
 
7465
      (
 
7466
         ## Select the equation used to solve for this field.
 
7467
         ## Advection Diffusion is the norm for scalar fields.
 
7468
         ## Works for all discretisation types.
 
7469
         element equation { 
 
7470
            attribute name { "AdvectionDiffusion" }
 
7471
         }|
 
7472
         ## ***UNDER TESTING***
 
7473
         ##
 
7474
         ## Select the equation used to solve for this field.
 
7475
         ## Conservation of Mass equation - requires the selection of a Density field.
 
7476
         ## ONLY WORKS FOR CONTROL VOLUME DISCRETISATIONS WITHOUT A
 
7477
         ## DIFFUSIVITY, SOURCE OR ABSORPTION.
 
7478
         element equation { 
 
7479
            attribute name { "ConservationOfMass" },
 
7480
            (
 
7481
               ## Select density to use in the Conservation of Mass Equation
 
7482
               ## Use the MaterialDensity - useful for multimaterial simulations
 
7483
               ## Clearly this requires a MaterialDensity field to be present
 
7484
               element density {
 
7485
                  attribute name { "MaterialDensity" }
 
7486
               }|
 
7487
               ## Select density to use in the Conservation of Mass Equation
 
7488
               ## Use the bulk Density
 
7489
               ## Clearly this requires a Density field to be present
 
7490
               element density {
 
7491
                  attribute name { "Density" }
 
7492
               }|
 
7493
               ## Select density to use in the Conservation of Mass Equation
 
7494
               element density {
 
7495
                  attribute name { string }
 
7496
               }
 
7497
            )
 
7498
         }|
 
7499
         ## ***UNDER TESTING***
 
7500
         ##
 
7501
         ## Select the equation used to solve for this field.
 
7502
         ## Reduced Conservation of Mass equation - requires the selection of a Density field.
 
7503
         ##
 
7504
         ## ONLY WORKS FOR CONTROL VOLUME DISCRETISATIONS WITHOUT A
 
7505
         ## DIFFUSIVITY, SOURCE OR ABSORPTION.
 
7506
         ##
 
7507
         ## This equation is very similar to a standard conservation of mass equation
 
7508
         ## except that the time discretisation uses only a single time level of density.
 
7509
         ## This enables consistency between the
 
7510
         ## MaterialVolumeFraction (ReducedConservationOfMass) and
 
7511
         ## MaterialDensity (Advection) equations in compressible multimaterial simulations.
 
7512
         element equation { 
 
7513
            attribute name { "ReducedConservationOfMass" },
 
7514
            (
 
7515
               ## Select density to use in the Reduced Conservation of Mass Equation
 
7516
               ## Use the MaterialDensity - useful for multimaterial simulations
 
7517
               ## Clearly this requires a MaterialDensity field to be present
 
7518
               element density {
 
7519
                  attribute name { "MaterialDensity" }
 
7520
               }|
 
7521
               ## Select density to use in the Reduced Conservation of Mass Equation
 
7522
               ## Use the bulk Density
 
7523
               ## Clearly this requires a Density field to be present
 
7524
               element density {
 
7525
                  attribute name { "Density" }
 
7526
               }|
 
7527
               ## Select density to use in the Reduced Conservation of Mass Equation
 
7528
               element density {
 
7529
                  attribute name { string }
 
7530
               }
 
7531
            )
 
7532
         }|
 
7533
         ## ***UNDER TESTING***
 
7534
         ##
 
7535
         ## Select the equation used to solve for this field.
 
7536
         ## Internal Energy equation - requires the selection of a Density field.
 
7537
         ## ONLY WORKS FOR CONTROL VOLUME DISCRETISATIONS WITHOUT A
 
7538
         ## DIFFUSIVITY, SOURCE OR ABSORPTION.
 
7539
         ## Solve the internal energy equation for this field.
 
7540
         ## Requires pressure and velocity fields to be present.
 
7541
         ## Uses a nonconservative time discretisation.
 
7542
         element equation {
 
7543
            attribute name { "InternalEnergy" },
 
7544
            (
 
7545
               ## Select density to use in the Internal Energy Equation
 
7546
               ## Use the MaterialDensity - useful for multimaterial simulations
 
7547
               ## Clearly this requires a MaterialDensity field to be present
 
7548
               ## Whatever field is selected must be present.
 
7549
               element density {
 
7550
                  attribute name { "MaterialDensity" }
 
7551
               }|
 
7552
               ## Select density to use in the Internal Energy Equation
 
7553
               ## Use the bulk Density
 
7554
               ## Clearly this requires a Density field to be present
 
7555
               ## Whatever field is selected must be present.
 
7556
               element density {
 
7557
                  attribute name { "Density" }
 
7558
               }|
 
7559
               ## Select density to use in the Internal Energy Equation
 
7560
               ## Whatever field is selected must be present.
 
7561
               element density {
 
7562
                  attribute name { string }
 
7563
               }
 
7564
            )
 
7565
         }|
 
7566
         ## Option to solve for electrical potential from
 
7567
         ## electrokinetic, electrochemical or electrothermal sources 
 
7568
         element equation { 
 
7569
            attribute name { "ElectricalPotential" }
 
7570
         }
 
7571
      )
 
7572
   )
 
7573
 
 
7574
inner_element_scalar = 
 
7575
   (
 
7576
      ## Inner element sub-grid scale model (Candy and Pain)
 
7577
      ## Requires continuous galerkin selected above.
 
7578
      element inner_element {
 
7579
         attribute replaces { "NSUBTLOC, NSUBNTLOC" },
 
7580
         ## Inner element solution of the scalar field.
 
7581
         element scalar_field {
 
7582
            attribute rank { "0" },
 
7583
            attribute name { "InnerElement" },
 
7584
            element prognostic {
 
7585
               element mesh {
 
7586
                  attribute name {  "InnerElementMesh" }
 
7587
               },
 
7588
               prognostic_scalar_output_options,
 
7589
               prognostic_scalar_stat_options,
 
7590
               prognostic_detector_options
 
7591
            }
 
7592
         }
 
7593
      }
 
7594
   )
 
7595
      
 
7596
inner_element_velocity =
 
7597
   (
 
7598
      ## Inner element sub-grid scale model (Candy and Pain)
 
7599
      ## Requires continuous galerkin selected above.
 
7600
      element inner_element {
 
7601
         attribute replaces { "NSUBVLOC, NSUBNVLOC" },
 
7602
         ## SGS velocity in an inner element SGS treatment of momentum
 
7603
         ##
 
7604
         ## Limitations:
 
7605
         ##  - Requires a geometry dimension of 3.
 
7606
         ##  - Requires inner element active for momentum
 
7607
         element vector_field {
 
7608
            attribute rank { "1" },
 
7609
            attribute name { "InnerElement" },
 
7610
            element prognostic {
 
7611
               element mesh {
 
7612
                  attribute name {  "InnerElementMesh" }
 
7613
               },
 
7614
               prognostic_vector_output_options,
 
7615
               prognostic_vector_stat_options,
 
7616
               vector_convergence_options
 
7617
            }
 
7618
         },
 
7619
         ## A filter for the sub-grid scale equations
 
7620
         ## Add diffusion to matrix D of the Inner Element model
 
7621
         element use_filter {
 
7622
            ## Strength of the diffusion term
 
7623
            ## Suggested value: 0.01
 
7624
            element strength {
 
7625
               real
 
7626
            },
 
7627
            empty
 
7628
         }?,
 
7629
         element use_quadratic_pressure {
 
7630
            attribute replaces { "PREOPT=PREOPT+1000" }
 
7631
         }?,
 
7632
         element apply_full_discontinuous_Galerkin {
 
7633
            attribute replaces { "PREOPT=PREOPT+10000" }
 
7634
         }?
 
7635
      }?
 
7636
   )
 
7637
forcing =
 
7638
  (
 
7639
    ## Add forcing from ocean data
 
7640
    ## If you enable this you MUST enable the /geometry/ocean_boundaries option too
 
7641
    element ocean_forcing{
 
7642
        ## The netCDF data file downloaded from ERA-40 reanalysis
 
7643
        element input_file {
 
7644
           attribute file_name {xsd:string} 
 
7645
        },
 
7646
        element mesh_choice {
 
7647
            velocity_mesh_choice
 
7648
        },
 
7649
        element surface_stress {
 
7650
            empty
 
7651
        }?,
 
7652
        element temperature_flux {
 
7653
            empty
 
7654
        }?,
 
7655
        element salinity_flux {
 
7656
            empty
 
7657
        }?,
 
7658
        element solar_radiation {
 
7659
            empty
 
7660
        }?
 
7661
    }
 
7662
  )
 
7663
 
 
7664
biology =
 
7665
   (
 
7666
      ## Model of biological processes in the ocean.
 
7667
      element ocean_biology{
 
7668
         ## A simple model of phytoplankton, zooplankton, general nutrient and detritus. 
 
7669
         element pznd {
 
7670
            (
 
7671
               ## Python code specifying the source and sink relationships 
 
7672
               ## between the biological tracers. This is usually achieved by 
 
7673
               ## importing fluidity.ocean_biology and calling a scheme from there. 
 
7674
               element source_and_sink_algorithm {
 
7675
                  python_code
 
7676
               }|
 
7677
               ## Do not calculate sources and sinks. 
 
7678
               ## This option is generally only useful for testing. 
 
7679
               element disable_sources_and_sinks {
 
7680
                  empty
 
7681
               }
 
7682
             ),
 
7683
#            ## Phytoplankton
 
7684
#            element scalar_field {
 
7685
#               attribute rank { "0" },
 
7686
#               attribute name { "Phytoplankton" },
 
7687
#               (
 
7688
#                  element prognostic {
 
7689
#                     velocity_mesh_choice,
 
7690
#                     prognostic_scalar_field
 
7691
#                  }|
 
7692
#                  element prescribed {
 
7693
#                     velocity_mesh_choice,
 
7694
#                     prescribed_scalar_field
 
7695
#                  }
 
7696
#               )
 
7697
#            },
 
7698
#            ## Zooplankton
 
7699
#            element scalar_field {
 
7700
#               attribute rank { "0" },
 
7701
#               attribute name { "Zooplankton" },
 
7702
#               (
 
7703
#                  element prognostic {
 
7704
#                     velocity_mesh_choice,
 
7705
#                     prognostic_scalar_field
 
7706
#                  }|
 
7707
#                  element prescribed {
 
7708
#                     velocity_mesh_choice,
 
7709
#                     prescribed_scalar_field
 
7710
#                  }
 
7711
#               )
 
7712
#            },
 
7713
#            ## Nutrient
 
7714
#            element scalar_field {
 
7715
#               attribute rank { "0" },
 
7716
#               attribute name { "Nutrient" },
 
7717
#               (
 
7718
#                  element prognostic {
 
7719
#                     velocity_mesh_choice,
 
7720
#                     prognostic_scalar_field
 
7721
#                  }|
 
7722
#                  element prescribed {
 
7723
#                     velocity_mesh_choice,
 
7724
#                     prescribed_scalar_field
 
7725
#                  }
 
7726
#               )
 
7727
#            },
 
7728
#            ## Detritus
 
7729
#            element scalar_field {
 
7730
#               attribute rank { "0" },
 
7731
#               attribute name { "Detritus" },
 
7732
#               (
 
7733
#                  element prognostic {
 
7734
#                     velocity_mesh_choice,
 
7735
#                     prognostic_scalar_field
 
7736
#                  }|
 
7737
#                  element prescribed {
 
7738
#                     velocity_mesh_choice,
 
7739
#                     prescribed_scalar_field
 
7740
#                  }
 
7741
#               )
 
7742
#            },
 
7743
            ## Photosynthetically Active Radiation (PAR)
 
7744
            element scalar_field {
 
7745
               attribute rank { "0" },
 
7746
               attribute name { "PhotosyntheticRadiation" },
 
7747
               (
 
7748
                  element prognostic {
 
7749
                     velocity_mesh_choice,
 
7750
                     prognostic_photosynthetic_radiation
 
7751
                  }|
 
7752
                  element prescribed {
 
7753
                     velocity_mesh_choice,
 
7754
                     prescribed_scalar_field
 
7755
                  }
 
7756
               )
 
7757
            }
 
7758
         }
 
7759
      }
 
7760
   )
 
7761
 
 
7762
 
 
7763
prognostic_photosynthetic_radiation =
 
7764
   (
 
7765
      ## PAR equation.
 
7766
      element equation { 
 
7767
         attribute name { "PhotosyntheticRadiation" }
 
7768
      },
 
7769
      ## Spatial discretisation options
 
7770
      element spatial_discretisation {
 
7771
         (
 
7772
            ## Discontinuous galerkin formulation. You can also use this
 
7773
            ## formulation with a continuous field in which case a simple
 
7774
            ## galerkin formulation will result. 
 
7775
            element discontinuous_galerkin {
 
7776
               empty
 
7777
            }
 
7778
         )
 
7779
      },
 
7780
      (
 
7781
         ## Solver
 
7782
         element solver {
 
7783
            linear_solver_options_asym
 
7784
         }
 
7785
      ),
 
7786
      ## Coefficients of absorption of photosynthetically active
 
7787
      ## radiation for water and phytoplankton.
 
7788
      element absorption_coefficients {
 
7789
         ## Photosynthetically active radiation absorption coefficient for water.
 
7790
         element water {
 
7791
            real
 
7792
         },
 
7793
         ## Photosynthetically active radiation absorption coefficient for water.
 
7794
         element phytoplankton {
 
7795
            real
 
7796
         }
 
7797
      },
 
7798
      ## Boundary conditions
 
7799
      element boundary_conditions {
 
7800
         attribute replaces { "boundary, TTPER1 TTPER2 TTPERI" },
 
7801
         attribute name { string },
 
7802
         ## Surface id:
 
7803
         element surface_ids {
 
7804
            integer_vector
 
7805
         },
 
7806
         ## Type
 
7807
         (
 
7808
            element type {
 
7809
               attribute name { "dirichlet" },
 
7810
               ## Apply the dirichlet bc weakly.  Only available with
 
7811
               ## discontinuous_galerkin, control_volume and
 
7812
               ## legacy_mixed_cv_cg spatial_discretisations.
 
7813
               ##
 
7814
               ## If not selected boundary conditions are applied strongly.
 
7815
               element apply_weakly {
 
7816
                 empty
 
7817
               },
 
7818
               input_choice_real
 
7819
            }|
 
7820
            element type {
 
7821
               attribute name { "neumann" },
 
7822
               input_choice_real
 
7823
            }|
 
7824
            element type {
 
7825
               attribute name { "robin" },
 
7826
               element order_zero_coefficient {
 
7827
                  input_choice_real
 
7828
               },
 
7829
               element order_one_coefficient {
 
7830
                  input_choice_real
 
7831
               }
 
7832
            }
 
7833
         )
 
7834
      }+,
 
7835
      prognostic_scalar_output_options,
 
7836
      prognostic_scalar_stat_options,
 
7837
      scalar_convergence_options,
 
7838
      prognostic_detector_options,
 
7839
      scalar_steady_state_options,
 
7840
      adaptivity_options_scalar_field,
 
7841
      ## Set the priority of this field
 
7842
      ## This determines the order in which scalar_fields are solved for:
 
7843
      ##  - higher numbers have the highest priority
 
7844
      ##  - lower numbers (including negative) have the lowest priority
 
7845
      ##  - default if not set is 0
 
7846
      element priority {
 
7847
         integer
 
7848
      }?
 
7849
   )
 
7850
 
 
7851
recalculation_options =
 
7852
   (
 
7853
      ## Prevent this field from being recalculated at every timestep.
 
7854
      ## This is cheaper especially if you are enforcing discrete properties on the field.
 
7855
      element do_not_recalculate {
 
7856
        empty
 
7857
      }
 
7858
   )
 
7859
 
 
7860
discrete_properties_algorithm_scalar =
 
7861
   (
 
7862
      ## Select discrete properties to enforce on the field
 
7863
      ## either after being prescribed or interpolated
 
7864
      element enforce_discrete_properties {
 
7865
        ## Update this field using the lagrangian multiplier
 
7866
        ## calculated in the solenoidal projection of a
 
7867
        ## scalar field.
 
7868
        ##
 
7869
        ## Note this field must be specified as the update field
 
7870
        ## underneath that vector field too.
 
7871
        ##
 
7872
        ## Note also this only really makes sense for coupled
 
7873
        ## fields like velocity and pressure.
 
7874
        element solenoidal_lagrange_update {
 
7875
          empty
 
7876
        }?
 
7877
      }
 
7878
   )
 
7879
 
 
7880
discrete_properties_algorithm_vector =
 
7881
   (
 
7882
      ## Select discrete properties to enforce on the field
 
7883
      ## either after being prescribed or interpolated
 
7884
      element enforce_discrete_properties {
 
7885
        solenoidal_options?
 
7886
      }
 
7887
   )
 
7888
 
 
7889
interpolation_algorithm_disabled =
 
7890
   (
 
7891
      ## Disable interpolation
 
7892
      element no_interpolation {
 
7893
        comment
 
7894
      }
 
7895
   )
 
7896
 
 
7897
interpolation_algorithm_scalar =
 
7898
    (
 
7899
      ## Basis function interpolation.
 
7900
      ## The standard algorithm. It is quick
 
7901
      ## and bounded, but non-conservative and dissipative.
 
7902
      ## All other algorithms require construction of a supermesh.
 
7903
      element consistent_interpolation {
 
7904
        empty
 
7905
      }|
 
7906
      ## Galerkin projection. By default, conservative, non-dissipative and
 
7907
      ## non-bounded. The most accurate choice, in the sense of minimising
 
7908
      ## the L2 norm of the residual
 
7909
      element galerkin_projection {
 
7910
        galerkin_projection_scalar
 
7911
      }
 
7912
    )
 
7913
    
 
7914
interpolation_algorithm_scalar_full = interpolation_algorithm_scalar
 
7915
interpolation_algorithm_scalar_full |= interpolation_algorithm_disabled
 
7916
    
 
7917
interpolation_algorithm_vector =
 
7918
    (
 
7919
      ## Basis function interpolation.
 
7920
      ## The standard algorithm. It is quick
 
7921
      ## and bounded, but non-conservative and dissipative.
 
7922
      ## All other algorithms require construction of a supermesh.
 
7923
      element consistent_interpolation {
 
7924
        consistent_interpolation_vector
 
7925
      }|
 
7926
      ## Galerkin projection. By default, conservative, non-dissipative and
 
7927
      ## non-bounded. The most accurate choice, in the sense of minimising
 
7928
      ## the L2 norm of the residual
 
7929
      element galerkin_projection {
 
7930
        galerkin_projection_vector
 
7931
      }
 
7932
    )
 
7933
 
 
7934
consistent_interpolation_vector = 
 
7935
    (
 
7936
      balanced_interpolation?
 
7937
    )
 
7938
    
 
7939
galerkin_projection_vector =
 
7940
    (
 
7941
      continuous_discontinuous_projection,
 
7942
      balanced_interpolation?,
 
7943
      supermesh_free?,
 
7944
      supermesh_conservation?
 
7945
    )
 
7946
 
 
7947
galerkin_projection_scalar =
 
7948
    (
 
7949
      continuous_discontinuous_projection,
 
7950
      supermesh_free?,
 
7951
      supermesh_conservation?
 
7952
    )
 
7953
 
 
7954
continuous_discontinuous_projection =
 
7955
    (
 
7956
      ## Continuous field Galerkin projection.
 
7957
      ## If the field you are interpolating is continuous, then
 
7958
      ## a linear solver is required to invert the mass matrix.
 
7959
      element continuous {
 
7960
        (
 
7961
          ## Use a bounded Galerkin projection. Conservative, bounded in the
 
7962
          ## limit, and minimally dissipative. This algorithm starts with the
 
7963
          ## Galerkin projection and dissipates it until it achieves
 
7964
          ## boundedness.
 
7965
          ## If it does not converge, it may not be exactly bounded.
 
7966
          ## Note well: this only works for linear fields.
 
7967
          element bounded {
 
7968
            attribute name {"Diffuse"},
 
7969
            ## The number of dissipation iterations attempted to bound the
 
7970
            ## Galerkin projection.
 
7971
            element boundedness_iterations {
 
7972
              integer,
 
7973
              ## Specify the tolerance to which boundedness is to be tested.
 
7974
              ## Defaults to computer precision if unspecified.
 
7975
              element tolerance {
 
7976
                real
 
7977
              }?
 
7978
            },
 
7979
            ## If the bounds on this field are known then they can be set here.
 
7980
            ## These can either further constrain the limits worked out by the
 
7981
            ## lumped version of the projection (i.e. to make sure that errors 
 
7982
            ## don't accumulate with succesive interpolations) or if apply_globally
 
7983
            ## is set they are just made to be bounded within the bounds globally
 
7984
            ## (i.e. anything between those bounds is not smoothed).
 
7985
            element bounds {
 
7986
              element upper_bound {
 
7987
                real,
 
7988
                ## If this is set the upper_bound is used everywhere.
 
7989
                ## If left unset the upper_bound is only used to constrain
 
7990
                ## the smoothed bounds calculated by the code
 
7991
                element apply_globally {
 
7992
                  empty
 
7993
                }?,
 
7994
                ## This field is to be considered as being coupled to another field
 
7995
                ## such that the sum of the two fields is constrained to be less than
 
7996
                ## the upper_bound specified above.
 
7997
                ## 
 
7998
                ## The relationships between fields are worked out according to their
 
7999
                ## priority ordering.
 
8000
                ##
 
8001
                ## This method is akin to the coupled_cv advection method.
 
8002
                element coupled {
 
8003
                  empty
 
8004
                }?
 
8005
              }?,
 
8006
              element lower_bound {
 
8007
                real,
 
8008
                ## If this is set the upper_bound is used everywhere.
 
8009
                ## If left unset the upper_bound is only used to constrain
 
8010
                ## the smoothed bounds calculated by the code
 
8011
                element apply_globally {
 
8012
                  empty
 
8013
                }?
 
8014
              }?
 
8015
            }?,
 
8016
            ## If, after performing all the boundedness_iterations, the field
 
8017
            ## is still not bounded then perform surgery to redistribute the
 
8018
            ## deviations to nodes that have less than their bounds.
 
8019
            element repair_deviations {
 
8020
              empty
 
8021
            }?
 
8022
          }|
 
8023
          ## Use a bounded Galerkin projection. Conservative, bounded in the
 
8024
          ## limit, and hopefully minimally dissipative. This algorithm starts with the
 
8025
          ## Galerkin projection and uses the optimisation library Algencan to bound
 
8026
          ## it by minimising a functional within constraints on boundedness and conservation.
 
8027
          ## Note well: this only works for linear fields.
 
8028
          element bounded {
 
8029
            attribute name {"Algencan"},
 
8030
            (
 
8031
              element functional {
 
8032
                attribute name {"L2"},
 
8033
                element weight {
 
8034
                  real
 
8035
                }?
 
8036
              }|
 
8037
              element functional {
 
8038
                attribute name {"LumpedMassL2"},
 
8039
                element weight {
 
8040
                  real
 
8041
                }?
 
8042
              }|
 
8043
              element functional {
 
8044
                attribute name {"IntegralL2"},
 
8045
                element weight {
 
8046
                  real
 
8047
                }?
 
8048
              }|
 
8049
              element functional {
 
8050
                attribute name { string },
 
8051
                element weight {
 
8052
                  real
 
8053
                }?
 
8054
              }
 
8055
            ),
 
8056
            ## If the bounds on this field are known then they can be set here.
 
8057
            ## These can either further constrain the limits worked out by the
 
8058
            ## lumped version of the projection (i.e. to make sure that errors 
 
8059
            ## don't accumulate with succesive interpolations) or if apply_globally
 
8060
            ## is set they are just made to be bounded within the bounds globally
 
8061
            ## (i.e. anything between those bounds is not smoothed).
 
8062
            element bounds {
 
8063
              element upper_bound {
 
8064
                real,
 
8065
                ## If this is set the upper_bound is used everywhere.
 
8066
                ## If left unset the upper_bound is only used to constrain
 
8067
                ## the smoothed bounds calculated by the code
 
8068
                element apply_globally {
 
8069
                  empty
 
8070
                }?,
 
8071
                ## This field is to be considered as being coupled to another field
 
8072
                ## such that the sum of the two fields is constrained to be less than
 
8073
                ## the upper_bound specified above.
 
8074
                ## 
 
8075
                ## The relationships between fields are worked out according to their
 
8076
                ## priority ordering.
 
8077
                ##
 
8078
                ## This method is akin to the coupled_cv advection method.
 
8079
                element coupled {
 
8080
                  empty
 
8081
                }?
 
8082
              }?,
 
8083
              element lower_bound {
 
8084
                real,
 
8085
                ## If this is set the upper_bound is used everywhere.
 
8086
                ## If left unset the upper_bound is only used to constrain
 
8087
                ## the smoothed bounds calculated by the code
 
8088
                element apply_globally {
 
8089
                  empty
 
8090
                }?
 
8091
              }?
 
8092
            }?
 
8093
          }
 
8094
        )?,
 
8095
        (
 
8096
          ## Solver options for the linear solve.
 
8097
          ## This method requires the inversion of a mass matrix. Note that
 
8098
          ## conservation properties are affected by the tolerance of the
 
8099
          ## linear solve.
 
8100
          element solver {
 
8101
            linear_solver_options_sym
 
8102
          }|
 
8103
          ## Lump the mass matrix on the left hand side of the galerkin projection.
 
8104
          ## Hence solver options aren't necessary.
 
8105
          element lump_mass_matrix {
 
8106
            empty
 
8107
          }
 
8108
        )
 
8109
      }|
 
8110
      ## Discontinuous field Galerkin projection
 
8111
      ## In this case, no linear solver is required to invert the mass matrix.
 
8112
      element discontinuous {
 
8113
        empty
 
8114
      }
 
8115
    )
 
8116
 
 
8117
solenoidal_options =
 
8118
    ## Constrained divergence-free projection.
 
8119
    ## This adds an additional constraint that ensures that the field
 
8120
    ## is solenoidal, i.e. divergence-free.
 
8121
    ## This is equivalent in cost to a pressure solve.
 
8122
    ## This is expensive, and thus best left until
 
8123
    ## needed.
 
8124
    ##
 
8125
    ## Note well: this only makes sense for nondivergent
 
8126
    ## vector fields, such as incompressible velocity!
 
8127
    element solenoidal {
 
8128
      ## Options for the mass matrix of the field being interpolated
 
8129
      element interpolated_field {
 
8130
        (
 
8131
          element continuous {
 
8132
            ## Lump the mass matrix for the assembly of the projection matrix
 
8133
            ## (not for the initial galerkin projection)
 
8134
            ##
 
8135
            ## Required when using interpolating continuous fields
 
8136
            element lump_mass_matrix {
 
8137
              ## Lump on the submesh.
 
8138
              ## This only works for simplex meshes and is only
 
8139
              ## strictly valid on 2d meshes.
 
8140
              element use_submesh {
 
8141
                empty
 
8142
              }?
 
8143
            }
 
8144
          }|
 
8145
          element discontinuous {
 
8146
            ## Lump the mass matrix for the assembly of the projection matrix
 
8147
            ## (not for the initial galerkin projection)
 
8148
            element lump_mass_matrix {
 
8149
              empty
 
8150
            }?
 
8151
          }
 
8152
        )
 
8153
      },
 
8154
      ## Options for the lagrange multiplier
 
8155
      ##
 
8156
      ## Must be on a continuous mesh!
 
8157
      element lagrange_multiplier {
 
8158
        pressure_mesh_choice,
 
8159
        element spatial_discretisation {
 
8160
          (
 
8161
            element continuous_galerkin {
 
8162
              ## Remove the stabilisation term from the projection operator.
 
8163
              ##
 
8164
              ## Automatic when not using P1P1.
 
8165
              element remove_stabilisation_term {
 
8166
                empty
 
8167
              }?,
 
8168
              ## Integrate the divergence operator by parts.
 
8169
              ##
 
8170
              ## Automatic when projecting a discontinuous field
 
8171
              element integrate_divergence_by_parts {
 
8172
                empty
 
8173
              }?
 
8174
            }|
 
8175
            element control_volumes {
 
8176
              empty
 
8177
            }
 
8178
          )
 
8179
        },
 
8180
        element reference_node {
 
8181
          integer
 
8182
        }?,
 
8183
        (
 
8184
          ## Update a scalar field using the lagrange multiplier from
 
8185
          ## the divergence free projection of this field.  The selected
 
8186
          ## scalar field must have solenoidal selected in its interpolation
 
8187
          ## options too and it must be on the same mesh as used for the
 
8188
          ## solenoidal projection above.
 
8189
          ##
 
8190
          ## Note well: this only really makes sense for scalar fields linked to nondivergent
 
8191
          ## vector fields, such as pressure to incompressible velocity!                  
 
8192
          element update_scalar_field {
 
8193
            attribute name { "Pressure" },
 
8194
            empty
 
8195
          }|
 
8196
          ## Update a scalar field using the lagrange multiplier from
 
8197
          ## the divergence free projection of this field.  The selected
 
8198
          ## scalar field must have solenoidal selected in its interpolation
 
8199
          ## options too and it must be on the same mesh as used for the
 
8200
          ## solenoidal projection above.
 
8201
          ##
 
8202
          ## Note well: this only really makes sense for scalar fields linked to nondivergent
 
8203
          ## vector fields, such as pressure to incompressible velocity!                  
 
8204
          element update_scalar_field {
 
8205
            attribute name { string },
 
8206
            empty
 
8207
          }
 
8208
        )?,
 
8209
        ## Solver options for the linear solve.
 
8210
        ## This method requires the inversion of a projection matrix.
 
8211
        element solver {
 
8212
          linear_solver_options_sym
 
8213
        }
 
8214
      }
 
8215
    }
 
8216
 
 
8217
 
 
8218
balanced_interpolation =
 
8219
    ## Geostrophically-balanced interpolation.
 
8220
    ## During the interpolation, the velocity is split into
 
8221
    ## balanced and imbalanced parts. The imbalanced part is
 
8222
    ## interpolated whereas the balanced part is recovered
 
8223
    ## on the other side of the interpolation from the pressure.
 
8224
    ## This means that if your velocity field is balanced before
 
8225
    ## interpolation, it will be balanced afterwards also.
 
8226
    ##
 
8227
    ## Note well: this only makes sense for velocity.
 
8228
    element balanced_interpolation {
 
8229
      ## The solver options for computing the balanced velocity to subtract.
 
8230
      element solver {
 
8231
        linear_solver_options_sym
 
8232
      }
 
8233
    }
 
8234
    
 
8235
supermesh_free =
 
8236
    ## Enables a supermesh free Galerkin projection. Uses incomplete
 
8237
    ## quadrature, and hence is not conservative.
 
8238
    element supermesh_free {
 
8239
      empty
 
8240
    }
 
8241
 
 
8242
represcribe_before_interpolation =
 
8243
    ## Represcribe the field before interpolation.
 
8244
    ##
 
8245
    ## This means the interpolation will not be conservative from the previous mesh so be careful what you're trying to achieve!
 
8246
    element represcribe_before_interpolation {
 
8247
      empty
 
8248
    }
 
8249
    
 
8250
supermesh_conservation =
 
8251
      ## Options for checking the supermesh conservation properties
 
8252
      element supermesh_conservation {
 
8253
        ## Specify the fraction of the original elemental area/volume
 
8254
        ## to be used to check the conservation of the supermesh.
 
8255
        ##
 
8256
        ## Since all fields are supermeshed together the minimum tolerance
 
8257
        ## specified over all fields will be used.
 
8258
        ##
 
8259
        ## Defaults to 0.001 if unspecified.
 
8260
        ## i.e. 0.1% of the area/volume of an element in the new mesh may
 
8261
        ## be lost without warning or attempts to fix (if compiled with cgal)
 
8262
        ## during the construction of the supermesh between the old
 
8263
        ## and new meshes.
 
8264
        element tolerance {
 
8265
          real
 
8266
        }?,
 
8267
        ## Compute the field integral after the interpolation and print the relative
 
8268
        ## mass loss to the logfile (level 2 verbosity).
 
8269
        ##
 
8270
        ## Note this is a post interpolation step and offers no chance of
 
8271
        ## fixing the conservation error (unlike the tolerance above if compiled
 
8272
        ## with cgal)
 
8273
        element print_field_integral {
 
8274
          ## Relative tolerance with which to test the conservation of the field
 
8275
          ## integral.  If the conservation fails this tolerance a warning is issued
 
8276
          ## (level 0 verbosity) and vtus containing the field are output.
 
8277
          element tolerance {
 
8278
            real
 
8279
          }
 
8280
        }?
 
8281
      }