Top

Completing the mesh

After drawing all subdomains, answering No when asked if you want to add another one, and either reviewing or not reviewing the SD information, you will be prompted for the mesh file base name. If you type `example`, the program will generate files called `example.gen` and `example_mesh.dat`. It will then draw the mesh in the axes, showing all elements, and the Mesh Complete button will appear.

The file `example.gen` is called a mesh generation file. It is passed to the program mesh_3tri which actually defines the mesh (nodal point coordinates and connectivity). The mesh generation file will look something like this:

        2     3
        5     5
        0     0     0     0     0     0     0     0
    0.00000e+00 0.00000e+00 5.00000e-01 0.00000e+00 1.00000e+00 0.00000e+00 1.00000e+00 5.00000e-01
    1.00000e+00 1.00000e+00 5.00000e-01 1.00000e+00 0.00000e+00 1.00000e+00 0.00000e+00 5.00000e-01
        5     8
        1     2     0     0     0     0     0     0
    1.00000e+00 1.00000e+00 1.00000e+00 5.00000e-01 1.00000e+00 0.00000e+00 1.50000e+00 0.00000e+00
    2.00000e+00 0.00000e+00 2.00000e+00 5.00000e-01 2.00000e+00 1.00000e+00 1.50000e+00 1.00000e+00

The first line shows the number of subdomains in the mesh and the number of nodes per element (this number should always be `3`).
There are then 4 lines for each subdomain:
One line with Side 1-3 divs and Side 2-4 divs,
one line with 8 numbers from the join array (described below), and
two lines containing the vertex coordinates. The first of these lines has x and y coordinates of vertices 1 through 4, and the second has x and y coordinates of vertices 5 through 8.

The join array has information about how to connect the subdomains to each other. Each subdomain has a join array with 4 pairs of numbers where each pair corresponds to one side of that subdomain. The first number in each pair is the subdomain number to which the side is joined. The second number is the side number on the other subdomain. Any side that is not joined to another subdomain will have `0 0` for its pair in the join array. The join array for each subdomain must only reference already existing subdomains. Therefore, subdomain 1 should always have 8 zeros as its join array. For example, if you have two subdomains and the third side of the second subdomain is joined to the fourth side of the first subdomain, the join arrays would look like this:
SD#1: `0 0 0 0 0 0 0 0`
SD#2: `0 0 0 0 1 4 0 0`

The meshing program mesh_3tri will use the mesh generation file to form the mesh and will write the mesh file `example_mesh.dat`. That mesh file is then saved to your current directory, and can be loaded into redAnTS using the Import - Mapping choice from the Mesh menu there.

After the mesh file is created, the function MappingMethod is automatically called, so the mesh is already active in the redAnTS GUI. Pressing the Mesh Complete button will close the MappingMeshTool and return you to the redAnTS GUI.

Previous (Drawing a subdomain)
Next (Additional notes)