@@ -122,7 +122,8 @@ Refinement using geometry
122
122
123
123
This section controls refinement using pre-defined geometric shapes. Currently,
124
124
two options are supported: 1. ``box `` -- refines the region inside a hexahedral
125
- block, and 2. ``cylinder `` -- refines the region inside a cylindrical block.
125
+ block, 2. ``cylinder `` -- refines the region inside a cylindrical block, and
126
+ 3. ``udf `` -- refines along an analytical function depending on time and spatial coordinate.
126
127
127
128
.. input_param :: tagging.GeometryRefinement.shapes
128
129
@@ -181,11 +182,21 @@ Example::
181
182
tagging.g2.c1.outer_radius = 300.0
182
183
tagging.g2.c1.inner_radius = 275.0
183
184
185
+ tagging.g3.type = GeometryRefinement
186
+ tagging.g3.shapes = udf0
187
+ tagging.g3.level = 0
188
+ tagging.g3.udf0.type = udf
189
+ tagging.g3.udf0.udf = "if(x > 500, 1.0, 0.0)"
190
+ tagging.g3.udf0.box_lo = 0.0 0.0 0.0
191
+ tagging.g3.udf0.box_hi = 1000.0 1000.0 500.0
184
192
185
- This example defines two different refinement definitions acting on level 0 and
186
- 1 respectively. The refinement at level 0 (``g1 ``) contains two box regions,
187
- whereas the refinement at level 1 (``g2 ``) only contains one cylinder
188
- definition.
193
+
194
+ This example defines three different refinement definitions acting on
195
+ levels 0, 1 and 0 respectively. The first refinement at level 0
196
+ (``g1 ``) contains two box regions, whereas the refinement at level 1
197
+ (``g2 ``) only contains one cylinder definition. The second refinement
198
+ at level 0 (``g3 ``) uses a user defined function (UDF) to specify a
199
+ geometrical refinement region.
189
200
190
201
**Refinement using hexahedral block definitions **
191
202
@@ -212,6 +223,41 @@ The axis and the extents along the axis are defined by two position vectors
212
223
optional ``inner_radius `` can be specified to restrict tagging to an annulus
213
224
between the inner and outer radii.
214
225
226
+ **Refinement using a user specified function **
227
+
228
+ The UDF uses AMReX's Parser class to parse a string in the input file,
229
+ ``udf `` key in the input file. For more information on the AMReX
230
+ Parser and supported functions, consult the `AMReX Parser
231
+ documentation
232
+ <https://amrex-codes.github.io/amrex/docs_html/Basics.html#parser> `_.
233
+ The UDF can be (almost) arbitrarily complex, leveraging standard
234
+ functions, boolean operators, local variables, etc. The following
235
+ assumptions are imposed on the UDF: 1. it must evaluate to 0 (tagging
236
+ off) or 1 (tagging on) (the return value of the UDF is cast to a
237
+ boolean and that is used to set the tags), 2. the allowed variables
238
+ are ``t ``, ``x ``, ``y ``, and ``z ``.
239
+
240
+ .. input_param :: tagging.GeometryRefinement.UDFRefiner.udf
241
+
242
+ **type: ** String, required
243
+
244
+ String specifying the user defined function.
245
+
246
+ .. input_param :: tagging.GeometryRefinement.UDFRefiner.box_lo
247
+
248
+ **type: ** Vector<Real>, optional
249
+
250
+ List of the low corner values for a bounding box where the tagging
251
+ will be active. By default the bounding box will span the entire domain.
252
+
253
+ .. input_param :: tagging.GeometryRefinement.UDFRefiner.box_hi
254
+
255
+ **type: ** Vector<Real>, optional
256
+
257
+ List of the high corner values for a bounding box where the tagging
258
+ will be active. By default the bounding box will span the entire domain.
259
+
260
+
215
261
Refinement using Q-Criterion
216
262
`````````````````````````````````````
217
263
0 commit comments