next up previous

Exercise 6: Challenges of nonuniform mesh generation.

Now an example of the challenges of nonuniform mesh generation. Obtain the program sweep2.c from the Voronoi directory from netlib. Once you have received sweep2.c, extract it and compile it. Run sweep2 with the -t option on the complete set of x,y grid points in mesh.pts. This will output the triangle connectivities needed for the finite element calculation. Look at the mesh you've created with GridDraw. You should notice that you have triangles that have been created outside (inside) the contours of interest. This is because, while the triangles are outside the contour, they are inside the convex hull of the point set, which is the property that sweep2 uses to create the triangulation. Now write a program which extracts the triangles outside (or inside) the region of interest using the GB (or other) algorithm. There are other ways to extract the extra triangles. See if you can figure out a more computationally efficient method (for some problems, the process of extracting unwanted elements can take a significant amount of time). Once the extraneous triangles are removed, save the connectivities for later input into the finite element solver.