Planning your mesh
For the purposes of this documentation, the "domain" is the final region
to be meshed, i.e. divided into elements. Each domain must be composed of
one or more subdomains. These subdomains must be built in a particular
manner: they are four-sided regions defined by eight vertices (the
corners and midpoints of each side). The vertices must be defined in a
counterclockwise direction around the subdomain, starting with a corner.
The three vertices of each side do not need to lie along a straight line;
a parabola is fit to them. The midpoint of each side does not have to be
located half-way along the side; it may be located anywhere between 1/4 and
3/4 of the distance between the endpoints, which will produce a mesh with varying element
size. Vertices 1, 2, and 3 define side 1 of the subdomain, vertices 3, 4,
and 5 define side 2, and so on, as shown in the figure below.
If your domain is not a simple four-sided figure, you must define
multiple subdomains to build the domain. The different subdomains must
be joined along their sides. This means that in order for two subdomains
to form one continuous domain, they must share all three nodes of a side.
For example, in order to make an "L" shaped region, you must define
three subdomains, as indicated in the figure below.
In addition to vertex locations, you must also choose the number of
divisions for each subdomain. Sides 1 and 3 and sides 2 and 4 are divided
separately. For example, you may choose 2 divisions for sides 1 and 3, and
4 divisions for sides 2 and 4. This will result in your subdomain having
16 elements (2*4=8 rectangles, each divided into 2 triangular elements), as shown below.
If your domain is relatively simple, it is possible to draw the mesh using the MappingMeshTool with little planning beforehand. However, if your domain becomes more complicated, it is a good idea to sketch the planned domain and plan the vertex locations and number of divisions on each side ahead of time. This will make the actual mesh creation go more smoothly, and with patience you will be able to generate complicated and useful meshes.