CVT_FIXED2 is a FORTRAN90 library which generates a centroidal Voronoi tessellation (CVT), with some nodes fixed.
The "interesting" routine in the library is CVT_FIXED_ITERATION, which updates an ongoing CVT calculation, but does not adjust certain nodes that have been designated by the user.
The user also supplies a subroutine that samples the domain of interest. If the domain is the unit square, say, then it is enough to return points uniformly distributed in [0,1]. However, the sampling subroutine interface makes it simple to handle regions which are not the unit square, or which have irregular boundaries, or holes, or for which a nonuniform probability density is to be used.
The sample problem illustrates the use of this routine to generate a mesh of points in a region that has two hexagonal holes. The user has set a number of points along the boundary, and on the holes, and these points are not to be moved. More points are to be generated within the region, and these, together with the fixed points, will constitute the mesh. The user also supplies a routine that returns sample points within the double hexagonal hole region.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
CVT_FIXED2 is available in a FORTRAN90 version.
PLOT_POINTS, a FORTRAN90 program which was used to plot the points and mesh.
The CVT_FIXED2_test program can be used to handle the "double hexagonal hole" region. A few lines in source code file "cvt_fixed2_test.f90" must be set so that the appropriate files are read and written, and so that 511 nodes are created by the run. Files you may copy include:
The CVT_FIXED2_test program can be used to handle a second version of the "double hexagonal hole" region which uses half as many fixed nodes. A few lines in source code file "cvt_fixed2_test.f90" must be set so that the appropriate files are read and written, and so that 139 nodes are created by the run. Files you may copy include:
You can go up one level to the FORTRAN90 source codes.