This directory contains codes that were used for the "monotone mean
curvature term" appearing in

  Ian M. Mitchell, "The Flexible, Extensible and Efficient Toolbox of
  Level Set Methods," submitted to the Journal of Scientific Computing
  in February 2007; revised July 2007.

This directory contains Matlab m-files implementing and testing a
monotone scheme proposed by Adam Oberman for approximating the
one-Laplacian in:

  Adam M. Oberman, "A Convergent Monotone Difference Scheme for Motion
  of Level Sets by Mean Curvature," Numerische Mathematik, 99: 365-379
  (2004), DOI: 10.1007/s00211-004-0566-1.

The one-Laplacian is the term used for motion by mean curvature in
level set methods; it is usually approximated by a (potentially
non-monotone) centered finite difference scheme.  Execution of this
code requires version 1.1 of the Toolbox of Level Set Methods by Ian
M. Mitchell, which can be downloaded from

	 http://www.cs.ubc.ca/~mitchell/ToolboxLS

The files perform the following tasks.

1) oneLaplacian: Constructs the stencil and determines the median of
   the neighbors values in the stencil.  Performs tasks corresponding
   to curvatureSecond in the base ToolboxLS, although this code does
   not use centered finite differences.

2) termCurvatureByMedian: The term approximation routine that calls
   oneLaplacian and handles other details of motion by mean curvature.
   Designed to replace termCurvature in the base ToolboxLS.

3) fatteningDemo: Implements the final example from Oberman's paper,
   using either the standard centered finite difference schemes or the
   new monotone scheme.  The results for both schemes are
   qualitatively similar.  Not used in the JSC submission.

4) monotoneTest: Implements the test from Oberman designed to
   demonstrate the dangers of the non-monotone centered finite
   difference scheme.  Either the monotone or non-monotone scheme can
   be applied.  Unfortunately, both schemes show similar maximum
   errors, thus demonstrating the monotonicity may not be all that it
   is cracked up to be.  Not used in the JSC submission.

5) polynomialSymbolic: A script to generate the analytic one-Laplacian
   of the two polynomials used for testing in Oberman's paper.  The
   result has been transferred to polynomialCircleTest and
   polynomialGridTest for computing errors.

6) polynomialCircleTest: Recreates the test of accuracy from Oberman's
   paper.  Applies the test to all points in a unit cube surrounding
   the origin, using only the monotone approximation scheme.  The
   stencil for each mesh node is a collection of points on an exact
   circle surrounding that node, NOT the neighboring grid nodes.  Not
   used in the JSC submission.

7) polynomialGridTest: Recreates the same test on the same grid with
   both the monotone and non-monotone schemes, but this time only grid
   nodes are used in the approximation.  Because there are fewer nodes
   in the stencil and those nodes may not lie precisely on a circle,
   the resulting approximation will be worse.  This test shows the
   errors that will likely be encountered in practice when using the
   schemes to perform motion by mean curvature.  Used to generate
   figure 7 (by changing the constant visualize_stencil to be 1) and
   figure 8 of the JSC submission.

8) polynomialConvergenceBest: Runs polynomialGridTest on a sequence of
   grids.  Used to generate table 2 of the JSC submission.

9) polynomialConvergenceAngle: Like polynomialConvergenceBest, but
   refines only d_\theta while holding d_x fixed.  The results
   indicate that d_\theta is probably the dominant source of error.
   Not used in the JSC submission.

10) polynomialConvergenceDX: Like polynomialConvergenceBest, but
   refines only d_x while holding d_\theta fixed.  The results
   indicate that d_\theta is probably the dominant source of error.
   Not used in the JSC submission.

11) curvatureStarDemo: Essentially a copy of curvatureStarDemo from
    the Toolbox version 1.1.  The visualization has changed: now a
    list of plot times can be specified (rather than plots at equal
    intervals), and the subplots can either be produced in a rough box
    or in a horizontal line.  Used for the top subfigure of figure 9
    of the JSC submission.

12) curvatureStarMedianDemo: Recreates the results of
    curvatureStarDemo using the median approximation.  Used for all
    but the top subfigure of figure 9 of the JSC submission.

13) starDemoFigure: A short script file that shows the parameters used
    to generate the subfigures in figure 9 of the JSC submission.

The examples require the presence of an <addPathToKernel> script
file TWO directories above the one in which this README exists.
Normally this script can be a copy of the script
<Examples/addPathToKernel> from the toolbox download (after it has
been modified to point to your own Toolbox installation).

Questions, comments or bug reports can be sent to mitchell@cs.ubc.ca

Ian Mitchell
University of British Columbia
July 2007
