**mesh2d_test**,
a MATLAB program which
calls mesh2d() to generate unstructured meshes in 2D.

Copyright (c) 2009, Darren Engwirda All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

mesh2d, a MATLAB program which generates unstructured meshes in 2D, by Darren Engwirda.

- mesh2d_test.m calls all the tests.
- mesh2d_test.sh runs all the tests.
- mesh2d_test.txt the output file.

**AIRFOIL_EXTERIOR_test** draws a mesh around the outside of an airfoil.
The mesh uses 621 nodes and 1015 elements.

- airfoil_exterior_test.m the source code.
- airfoil.txt the coordinates of 102 points that trace out the shape of the airfoil, in clockwise direction.
- airfoil_exterior_elements.png an image of the elements.
- airfoil_exterior_nodes.png an image of the nodes.
- airfoil_exterior_vertices.png an image of the vertices.

**AIRFOIL_INTERIOR_test** draws a mesh inside an airfoil.
The mesh uses 246 nodes and 369 elements.

- airfoil_interior_test.m the source code.
- airfoil.txt the coordinates of 102 points that trace out the shape of the airfoil, in clockwise direction.
- airfoil_interior_elements.png an image of the elements.
- airfoil_interior_vertices.png an image of the vertices.

**BAFFLE_test** considers a rectangular region containing 13 hexagonal
baffles or obstacles. The mesh uses 512 nodes and 874 elements.

- baffle_test.m the source code.
- baffle_elements.png the elements created when we set a maximum element size of 0.5.
- baffle_nodes.png the nodes created when we set a maximum element size of 0.5.
- baffle_vertices.png the vertices that define the region and the obstacles.

**CIRCLE_test** considers a circular region
with the interior and exterior boundaries each defined by 16 vertices.

- circle_test.m the source code.
- circle_elements.txt the elements.
- circle_elements.png an image of the elements.
- circle_nodes.txt the nodes.
- circle_nodes.png an image of the nodes.
- circle_vertices.png the vertices that define the region.
- circle.xml an XML file defining the mesh.

**CIRCLES_test** considers a circular region with an off-center hole,
with the interior and exterior boundaries each defined by 16 vertices.

- circles_test.m the source code.
- circles_elements.png the elements created when we set a maximum element size of 0.25.
- circles_nodes.png the nodes created when we set a maximum element size of 0.25.
- circles_vertices.png the vertices that define the region and the obstacles.

**ELL_test** demonstrates features of MESH2D for the L-shaped region.

- ell_test.m the source code.
- ell_mesh1.png the mesh created with the simplest input.
- ell_mesh2.png the mesh created when we specify two small segments on the boundary.
- ell_mesh3.png the mesh created when we specify a maximum element size.
- ell_mesh4.png the mesh created when we specify a size function that requests small elements near the reentrant corner.
- ell_mesh5.png the mesh created we call refine() on the first mesh;
- ell_mesh6.png the mesh created when we call smoothmesh() on the second mesh.

- face_test.m demonstrates two example polygonal geometries for input to MESHFACES.
- mesh_collection.m contains a collection of meshing examples.
- mesh_test.m demonstrates the use of MESH2D.

**ICAM_test** demonstrates features of MESH2D for the first floor
of the Wright House.

- icam_test.m the source code.
- icam_nodes.png the nodes created by MESH2D.
- icam_elements.png the elements created by MESH2D.

**OBSTACLE_test** demonstrates features of MESH2D for a channel with
a square obstacle.

- obstacle_test.m the source code.
- obstacle_mesh.png a mesh created for the region.

**RECTANGLE_MINUS_CIRCLE_test** considers a region of a rectangle
minus circular region with the interior and exterior boundaries
each defined by 16 vertices.

- rectangle_minus_circle_test.m the source code.
- rectangle_minus_circle_elements.txt the elements.
- rectangle_minus_circle_elements.png an image of the elements.
- rectangle_minus_circle_nodes.txt the nodes.
- rectangle_minus_circle_nodes.png an image of the nodes.
- rectangle_minus_circle_vertices.png the vertices that define the region.
- rectangle_minus_circle.xml an XML file defining the mesh.

**REFINE_test** demonstrates how the refinement feature of MESH2D
can be controlled with a mask, which specifies that only certain
triangles should be refined, rather than all of them. The masked
triangles are split into 4 subtriangles. Triangles immediately neighboring
such triangles will be split in half. Remaining triangles will be untouched.

- refine_test.m the source code.
- refine_test1.png the initial mesh;
- refine_test2.png the mesh after refining all the triangles whose centroid has a Y coordinate greater than 1/2.
- refine_test3.png the mesh after a second refinement, on all the triangles whose centroid has an X coordinate less than 1/2.

**square_border_test** demonstrates how a constrained mesh can be created
using MESHFACES. In this case, we have a square in a square. We want
to mesh the two resulting regions in such a way that they share the
nodes along the common edges.

- square_border_test.m the source code.
- square_border.png the mesh;

**TWO_FOCI_test** shows how a mesh density function can be created
which enforces a small mesh near either of two foci, while smoothly
enlarging as it moves away from them.

- two_foci_test.m the source code.
- two_foci_1.png the mesh generated by the vertices.
- two_foci_2.png the mesh, controlled by a maximum value of H.
- two_foci_3.png the mesh, controlled by a mesh density function that keeps the mesh small near either focus.