Skip to content

Commit

Permalink
finished doc, moved figs to large_media refs idaholab#21903
Browse files Browse the repository at this point in the history
  • Loading branch information
Oana Marin authored and oanaoana committed Mar 28, 2023
1 parent 15c8b10 commit 130c4bc
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
Expand Up @@ -9,30 +9,40 @@ The `TransfiniteMeshGenerator` produces two-dimensional meshes from a set of 4 c
!media media/meshgenerators/quad_convention.png style=float:right;width:20%;margin-left:2%; caption=Fig. 1: Convention for the corner vertices order.

Given a set of 4 corners the TransfiniteMeshGenerator constructs by default the straight edges that connect the vertices and fills up the interior with straight lines. The test, [quadrilater_generator.i](test/tests/meshgenerators/transfinite_generator/quadrilater_generator.i),
illustrates the use of the `TransfiniteMeshGenerator` object to construct general quadrilaterals. The convention for the corners numbering should follow Fig. 1, prescribed in the order +(0,0) - (0,1) - (1,1) - (1,0)+. The direction along edges, important in case they are user provided using the DISCRETE option, should follow the direction in Fig. 1.
illustrates the use of the `TransfiniteMeshGenerator` object to construct general quadrilaterals as in Fig. 2. By default the distribution of points along edges is considered equidistant, unless specified otherwise by the user using the parameters `bias_x` or `bias_y`. The core of the algorithm interpolates/fills up the inner domain for any edge type, curved, parametrized, discrete. The current implementation considers all these cases with special attention given to arcs of a circle which are widely encountered in scientific computing applications.

This generator allows any type of curvilinear edges. In Fig. 2 we show a mesh where the bottom edge has an inward arc circle. However, this algorithm generates a mesh for any parametrized edge, or given set of points on an edge. For arcs of a circle, since they are widely encounterened in applications, we customized an approach that requires from an user to specify only the deviation from a straight line in the middle of an edge.
The convention for the corners numbering should follow Fig. 1, prescribed in the order +(0,0) - (0,1) - (1,1) - (1,0)+. The direction along edges, important if the user provides them using the DISCRETE option, should follow the direction of the arrows as in Fig. 1.

The distribution of points on an edge can be either provided as a discrete set of points, using the edge type `DISCRETE`, or as a bias along the edge. The only requirement is that opposite edges have the same number of points.
!media large_media/framework/meshgenerators/transfinite_quadrilateral_sm.png style=float:right;margin:2%;width:30%; caption=Fig. 2: A quadrilateral with one edge on an arc circle.

This generator allows any type of curvilinear edges. In Fig. 2 we show a mesh where the bottom edge has an inward arc circle. However, this algorithm generates a mesh for any parametrized edge, or given set of points on an edge. For arcs of a circle, since they are widely encountered in applications, we customized an approach that requires a user to specify only the deviation from a straight line in the middle of an edge.

!media media/meshgenerators/mesharc.png style=float:right;margin:2%;width:30%; caption=Fig. 2: A quadrilateral with one edge on an arc circle.
The distribution of points on an edge can be either provided as a discrete set of points, using the edge type `DISCRETE`, or as a bias along the edge. The only requirement is that opposite edges have the same number of points.

## Example

!media large_media/framework/meshgenerators/transfinite_arccircle_annular_sm.png style=float:right;margin:2%;width:20%; caption=Fig. 3: A quadrilateral with one edge on an arc circle.


This mesh generator considers 4 types of edges defined in `edge_type`, where `edge` is either left, right, top or bottom.

- `LINE`, constructs a line between provided corner vertices.

- `CIRCARC`, constructs an arc of a circle and requires an additional parameter, named `edge_parameter`. This parameter can be the distance at the middle of an edge between a straight line and the arc of circle desired, as in the test [arccircle_generator.i](test/tests/meshgenerators/transfinite_generator/arcircle_generator.i). The edge is then generated by computing the middle point on the edge. The deviation from a straight line is set by convention to be positive if the arc circle is outward, or negative if inward, in this fashion the user can specify different orientations.
The midpoint could also be obtained from a QUAD8 element as provided by an external mesh generator and inserted as input by the user in the same `edge_parameter`, as in the test [arccircle_midpoint_generator.i](test/tests/meshgenerators/transfinite_generator/arcircle_midpoint_generator.i).


!media large_media/framework/meshgenerators/transfinite_discrete_arccircle_sm.png style=float:right;margin:2%;width:25%; caption=Fig. 4: A quadrilateral with one edge on an arc circle.

- `DISCRETE`, constructs a line along a set of points provided by the user in the order represented by arrows in Fig. 1, a test is available in [discrete_generator.i](test/tests/meshgenerators/transfinite_generator/discrete_generator.i) and illustrated in Fig. 4. This option is the only one that does not support a different point redistribution since it is assumed the user desires those edge points explicitely. Along an edge described by this option the `bias_x` and `bias_y` parameters will have no effect.

- `LINE`, constructs a line between provided corner vertices
- `ARCCIRC`, constructs an arc of a circle and requires an additional parameter, the distance at the middle of an edge between a straight line and the arc of circle desired. The edge is then generated by computing the middle point on the edge, which could be also obtained from a QUAD8 element from a mesh generator (if this capability is desired by a user please address the developers, as it is easy to adjust)
- `DISCRETE`, constructs a line along a set of points provided by the user in the order represented by arrows in Fig. 1, a test is available as [discrete_generator.i](test/tests/meshgenerators/transfinite_generator/discrete_generator.i).
- `PARSED`, constructs a curvilinear edge as provided by a parametrization chosen by the user.
- `PARSED`, constructs a curvilinear edge as provided by a parametrization chosen by the user. The test [parsed_generator.i](test/tests/meshgenerators/transfinite_generator/parsed_generator.i) constructs a stenotic pipe using the parametrization of the top and bottom edges. The only requirement the user needs to take into account is to map the parametrization to the reference interval `[0, 1]`.


Each edge type may require additional parameters specified as `edge_parameter`, unless the edge is a line. For an arc circle and the deviation from a straight line is set by convention to be positive if the arc circle is outward, or negative if inward, as in Fig. 2, see test [arccircle_generator.i](test/tests/meshgenerators/transfinite_generator/arccircle_generator.i)
!media large_media/framework/meshgenerators/transfinite_parsed_bias_sm.png style=float:right;margin:2%;width:30%; caption=Fig. 5: A quadrilateral with one edge on an arc circle.

Since opposite sides need to have the same number of points, we consider top-bottom edges to have `nx` points, and left-right edges `ny` points. By default they are taken to be equidistant, unless the user specifies a distancing via the parameters `bias_x` or `bias_y`. Different point distributions can propagate on curvilinear edges, generating domains as in Fig. 5. Note that the bias across an edge is implemented as propapagted by the parametrization, so for a parametrized edge $x(r),\ y(r)$ the bias is constructed first for the parameter $r$ and propagated as the parametrized edge is generated.

Two opposite sides need to have the same number of points, and we consider top-bottom edges to have `nx` points, and left-right edges `ny` points. By default they are taken to be equidistant, unless the user specifies a distancing via the parameters `bias_x` or `bias_y`.


!syntax parameters /Mesh/TransfiniteMeshGenerator
Expand Down
8 changes: 5 additions & 3 deletions framework/src/meshgenerators/TransfiniteMeshGenerator.C
Expand Up @@ -43,7 +43,7 @@ TransfiniteMeshGenerator::validParams()
params.addRequiredParam<unsigned int>("ny",
"Number of Nodes on vertical edges, including corners");

// each edge has a different paramter according to its type
// each edge has a different parameter according to its type
params.addParam<std::string>("bottom_parameter", "", "Bottom side support parameter");
params.addParam<std::string>("top_parameter", "", "Top side support parameter");
params.addParam<std::string>("left_parameter", "", "Left side support parameter");
Expand All @@ -60,8 +60,6 @@ TransfiniteMeshGenerator::validParams()
"bias_y>=1.0 & bias_y<=2",
"The amount by which to grow (or shrink) the cells in the y-direction.");

// params.addParam<FunctionName>("top_function",
// "Function expression encoding a paramterization of an edge");
params.addClassDescription("Creates a QUAD4 mesh given a set of corner vertices and edge types. "
"The edge type can be either LINE, CIRCARC, DISCRETE or PARSED, with "
"LINE as the default option. "
Expand All @@ -75,6 +73,10 @@ TransfiniteMeshGenerator::validParams()
"distribution can be prescribed "
"via the options bias_x or bias_y for opssiong edges.");

params.addParamNamesToGroup("bottom_type left_type top_type right_type", "Edge types");
params.addParamNamesToGroup("bottom_parameter left_parameter top_parameter right_parameter", "Edge parameter");
params.addParamNamesToGroup("nx ny bias_x bias_y", "Number and distribution of points");

return params;
}

Expand Down
Expand Up @@ -5,13 +5,15 @@
10.0 -1.0 0.0
11.0 5.0 0
4.0 4.0 0'
nx = 8
ny = 5
nx = 10
ny = 7
left_type = DISCRETE
right_type = LINE
top_type = CIRCARC
bottom_type = LINE
left_parameter = '-1.0 -1.0 0
-0.7 -0.7 0.0
-0.5 -0.5 0.0
0.0 0.0 0.0
0.75 0.75 0.0
2.5 2.5 0
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 130c4bc

Please sign in to comment.