Top

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.

If you want to use only two subdomains to define an "L" shaped region, you must distort the mesh, as shown in the figure below:
This is because any sides from two different subdomains that touch must be complete sides of each subdomain. You cannot connect half of one side of one subdomain to one side of another. Additionally, the midpoint vertex must be shared between the two subdomains; otherwise the mesh will form incorrectly.

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.

When you are joining subdomains, you should plan on assigning matching numbers of divisions to the connecting sides. For example, if side 4 of subdomain 2 is to connect to side 1 of subdomain 1, then subdomain 2's number of divisions on sides 2 and 4 should match the number of divisions on subdomain 1's sides 1 and 3. If you do not choose the divisions in this manner, the code will automatically assign the number of divisions based on the already existing subdomains.

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.

Previous (About the Mapping Mesh Toolbox)
Next (How to use the Mapping Mesh Toolbox)