~grm08/fluidity/hilbert-for-pyop2

« back to all changes in this revision

Viewing changes to schemas/visualise_elements.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
start =
 
4
   (
 
5
      element visualise_elements {
 
6
         ## Model output files are named according to the project
 
7
         ## name, e.g. [simulation_name]_0.vtu. Non-standard
 
8
         ## characters in the project name should be avoided.
 
9
         element project_name {
 
10
            anystring
 
11
         },
 
12
         ## Options dealing with the specification of geometry
 
13
         element geometry {
 
14
            ## Dimension of the problem.
 
15
            ## <b>This can only be set once</b>
 
16
            element dimension {
 
17
               attribute replaces {"NDIM"},
 
18
               element integer_value {
 
19
                  attribute rank {"0"},
 
20
                  ("2")
 
21
               }
 
22
            },
 
23
            ## The shape of elements to visualise
 
24
            element element_vertices {
 
25
               integer
 
26
            },
 
27
            ## The degree of elements to visualise
 
28
            element element_degree {
 
29
               integer
 
30
            },
 
31
            element element_family {
 
32
               element string_value {
 
33
                  # Lines is a hint to the gui about the size of the text box.
 
34
                  # It is not an enforced limit on string length.
 
35
               attribute lines { "1" },
 
36
                  ( "lagrange")
 
37
               },
 
38
               comment
 
39
            },
 
40
            ## Quadrature
 
41
            element quadrature {
 
42
               ## Quadrature degree
 
43
               ## 
 
44
               ## note: this specifies the degree of quadrature not
 
45
               ## the number of gauss points
 
46
               element degree {
 
47
                  attribute replaces {"NGI"},
 
48
                  integer
 
49
               }
 
50
            },
 
51
            ## The degree of elements to visualise
 
52
            element visualisation_degree {
 
53
               integer
 
54
            },
 
55
            element mesh {
 
56
               attribute name { xsd:string },
 
57
               mesh_info,
 
58
               element exclude_from_mesh_adaptivity{empty}?
 
59
            }*
 
60
         },
 
61
         element material_phase {
 
62
            attribute name { xsd:string },
 
63
            scalar_field_choice*,
 
64
            vector_field_choice*
 
65
         }?
 
66
      }
 
67
   )
 
68
 
 
69
mesh_info =
 
70
   (
 
71
      ## Read mesh from file.
 
72
      element from_file {
 
73
         (
 
74
            ## Triangle mesh format.
 
75
            ##
 
76
            ## Enter the base name without the .edge .ele, .face or
 
77
            ## .node extensions, and without process numbers.
 
78
            element format {
 
79
              attribute name { "triangle" },
 
80
              # string_value elements are used only for backwards compatibility - any new format choices should NOT have these
 
81
              element string_value {
 
82
                 "triangle"
 
83
              },
 
84
              comment
 
85
            }|
 
86
            ## Read the mesh from a vtu. Note that the mesh will have no surface
 
87
            ## or region IDs.
 
88
            element format {
 
89
              attribute name { "vtu" },
 
90
              comment
 
91
            }|
 
92
            ## CGNS mesh format (not yet implemented)
 
93
            element format {
 
94
               attribute name { "cgns" },
 
95
               # string_value elements are used only for backwards compatibility - any new format choices should NOT have these
 
96
               element string_value {
 
97
                  "cgns"
 
98
               },
 
99
               comment
 
100
            }
 
101
         ),
 
102
         attribute file_name { xsd:string },
 
103
         from_file_mesh_stat_options,
 
104
         comment
 
105
      }|
 
106
      ## Make mesh from existing mesh. The existing mesh cannot itself
 
107
      ## be made from an existing mesh (i.e. it must be read from a
 
108
      ## file).
 
109
      element from_mesh {
 
110
         mesh_choice,
 
111
         element mesh_shape {
 
112
            element polynomial_degree {
 
113
               integer
 
114
            }
 
115
         }?,
 
116
         element mesh_continuity {
 
117
            element string_value{
 
118
               "continuous" | "discontinuous"
 
119
            }
 
120
         }?,
 
121
         ## Make mesh periodic
 
122
         element periodic_boundary_conditions {
 
123
            attribute name { xsd:string },
 
124
            ## List of boundary ids that are aliased to
 
125
            element physical_boundary_ids {
 
126
               integer_vector
 
127
            },
 
128
            ## List of boundary ids that are aliased
 
129
            element  aliased_boundary_ids {
 
130
               integer_vector
 
131
            },
 
132
            ## Python code which takes coordinate of an aliased
 
133
            ## boundary node and returns the coordinate of a physical
 
134
            ## boundary node
 
135
            element coordinate_map {
 
136
               python_code
 
137
            }
 
138
         }*,
 
139
         ## Extrude a horizontal (1D or 2D) mesh in the vertical
 
140
         element extrude {
 
141
            ## Depth over which to extrude
 
142
            ## top will be at z=0
 
143
            ## bottom will be at z=-bottom_depth
 
144
            element bottom_depth {
 
145
               real
 
146
            },
 
147
            ## Constant or function (of z!) to specify the depth of the
 
148
            ## layers.
 
149
            element sizing_function {
 
150
               input_choice_real
 
151
            },
 
152
            ## surface_id to assign to the top of the extruded mesh
 
153
            element top_surface_id {
 
154
               integer
 
155
            }?,
 
156
            ## surface_id to assign to the bottom of the extruded mesh
 
157
            element bottom_surface_id {
 
158
               integer
 
159
            }?
 
160
         }?,
 
161
         derived_mesh_stat_options,
 
162
         comment
 
163
      }
 
164
   )
 
165
 
 
166
# Most common mesh choices
 
167
mesh_choice = 
 
168
   (
 
169
      element mesh {
 
170
         attribute name { xsd:string }
 
171
      }|
 
172
      element mesh {
 
173
         attribute name { "CoordinateMesh" }
 
174
      }|
 
175
      element mesh {
 
176
         attribute name { "VelocityMesh" }
 
177
      }|
 
178
      element mesh {
 
179
         attribute name { "PressureMesh" }
 
180
      }
 
181
   )
 
182
 
 
183
from_file_mesh_stat_options =
 
184
   (
 
185
      ## Specify what is added to .stat files
 
186
      element stat {
 
187
         mesh_stat_options_enabled_default
 
188
      }
 
189
   )
 
190
derived_mesh_stat_options =
 
191
   (
 
192
      ## Specify what is added to .stat files
 
193
      element stat {
 
194
         mesh_stat_options_disabled_default
 
195
      }
 
196
   )
 
197
 
 
198
# Choice of input method, e.g. for boundary conditions
 
199
input_choice_real =
 
200
   (
 
201
      input_choice_real_contents
 
202
   )
 
203
 
 
204
input_choice_real_contents =
 
205
   ## Constant value
 
206
   element constant {
 
207
      real
 
208
   }|
 
209
   ## Python function prescribing real input. Functions should be of the form:
 
210
   ##
 
211
   ##  def val(X, t):
 
212
   ##     # Function code
 
213
   ##     return # Return value
 
214
   ##
 
215
   ## where X is a tuple of length geometry dimension.
 
216
   element python {
 
217
      python_code
 
218
   }
 
219
 
 
220
 
 
221
# This is the choice of additional scalar field to be solved for
 
222
scalar_field_choice =
 
223
   (
 
224
# The first is a generic field, used for any user-defined field that
 
225
# FLUIDITY knows nothing about.  Therefore, this field cannot be diagnostic.
 
226
      element scalar_field {
 
227
         attribute rank { "0" },
 
228
         attribute name { xsd:string },
 
229
         ## Field type
 
230
         (
 
231
            element prescribed {
 
232
               velocity_mesh_choice,
 
233
               prescribed_values_scalar_field
 
234
            }|
 
235
            element diagnostic {
 
236
               velocity_mesh_choice
 
237
            }
 
238
         )
 
239
      }   
 
240
   )
 
241
 
 
242
 
 
243
vector_field_choice =
 
244
   (
 
245
# The first is a generic field, used for any user-defined field that
 
246
# FLUIDITY knows nothing about.  Therefore, this field cannot be diagnostic.
 
247
# Prognostic vector fields are not possible (other than velocity and those known fields below).
 
248
      ## Generic field variable (vector)
 
249
      element vector_field {
 
250
         attribute rank { "1" },
 
251
         attribute name { xsd:string },
 
252
         ## Field type
 
253
         (
 
254
            element prescribed {
 
255
               mesh_choice,
 
256
               prescribed_values_vector_field
 
257
            }|
 
258
            element diagnostic {
 
259
               velocity_mesh_choice
 
260
            }
 
261
         )
 
262
         }
 
263
   )
 
264
 
 
265
prescribed_values_vector_field =
 
266
   (
 
267
      (
 
268
         ## Value for WholeMesh
 
269
         ##
 
270
         ## Only specify one value if not using mesh regions.
 
271
         ## Otherwise select other value option, specify region_ids
 
272
         ## and distinct names.  Then add extra values for other regions.
 
273
         element value {
 
274
            attribute name { "WholeMesh" },
 
275
            input_choice_real_dim_vector
 
276
         }|
 
277
         ## Multiple values are now allowed if using different value assignments
 
278
         ## in different regions of the mesh (specified by region_ids).
 
279
         ## In this case each value requires a distinct name for the options dictionary.
 
280
         element value {
 
281
            attribute name { string },
 
282
            region_ids,
 
283
            input_choice_real_dim_vector
 
284
         }
 
285
      )+
 
286
   )
 
287
 
 
288
 
 
289
velocity_mesh_choice =
 
290
   (
 
291
      (
 
292
         element mesh {
 
293
            attribute name { "VelocityMesh" }
 
294
         }|
 
295
         element mesh {
 
296
            attribute name { "PressureMesh" }
 
297
         }|
 
298
         element mesh {
 
299
            attribute name { "CoordinateMesh" }
 
300
         }|
 
301
         element mesh {
 
302
            attribute name { string }
 
303
         }
 
304
      )
 
305
   )
 
306
 
 
307
 
 
308
prescribed_values_scalar_field =
 
309
   (
 
310
      (
 
311
         ## Value for WholeMesh
 
312
         ## Only specify one value if not using mesh regions.
 
313
         ## Otherwise select other value option, specify region_ids
 
314
         ## and distinct names.  Then add extra values for other regions.
 
315
         element value {
 
316
            attribute name { "WholeMesh" },
 
317
            input_choice_real
 
318
         }|
 
319
         ## Multiple values are now allowed if using different value assignments
 
320
         ## in different regions of the mesh (specified by region_ids).
 
321
         ## In this case each value requires a distinct name for the options dictionary.
 
322
         element value {
 
323
            attribute name { string },
 
324
            region_ids,
 
325
            input_choice_real
 
326
         }
 
327
      )+
 
328
   )
 
329
 
 
330
# Choice of input method, e.g. for boundary conditions
 
331
input_choice_real_dim_vector =
 
332
   (
 
333
      input_choice_real_dim_vector_contents
 
334
   )
 
335
 
 
336
input_choice_real_dim_vector_contents =
 
337
   ## Constant value
 
338
   element constant {
 
339
      real_dim_vector
 
340
   }|
 
341
   ## Python function prescribing dimensional vector input. Functions should be of the form:
 
342
   ##
 
343
   ##  def val(X, t):
 
344
   ##     # Function code
 
345
   ##     return # Return value
 
346
   ##
 
347
   ## where X and the return value are tuples of length geometry dimension.
 
348
   element python {
 
349
      python_code
 
350
   }
 
351
      
 
 
b'\\ No newline at end of file'