Finite difference methods for approximating Heaviside functions

  • Authors:
  • John D. Towers

  • Affiliations:
  • MiraCosta College, 3333 Manchester Avenue, Cardiff-by-the-Sea, CA 92007-1516, USA

  • Venue:
  • Journal of Computational Physics
  • Year:
  • 2009

Quantified Score

Hi-index 31.45

Visualization

Abstract

We present a finite difference method for discretizing a Heaviside function H(u(x-)), where u is a level set function u:R^n@?R that is positive on a bounded region @W@?R^n. There are two variants of our algorithm, both of which are adapted from finite difference methods that we proposed for discretizing delta functions in [J.D. Towers, Two methods for discretizing a delta function supported on a level set, J. Comput. Phys. 220 (2007) 915-931; J.D. Towers, Discretizing delta functions via finite differences and gradient normalization, Preprint at http://www.miracosta.edu/home/jtowers/; J.D. Towers, A convergence rate theorem for finite difference approximations to delta functions, J. Comput. Phys. 227 (2008) 6591-6597]. We consider our approximate Heaviside functions as they are used to approximate integrals over @W. We prove that our first approximate Heaviside function leads to second order accurate quadrature algorithms. Numerical experiments verify this second order accuracy. For our second algorithm, numerical experiments indicate at least third order accuracy if the integrand f and @?@W are sufficiently smooth. Numerical experiments also indicate that our approximations are effective when used to discretize certain singular source terms in partial differential equations. We mostly focus on smooth f and u. By this we mean that f is smooth in a neighborhood of @W, u is smooth in a neighborhood of @?@W, and the level set u(x)=0 is a manifold of codimension one. However, our algorithms still give reasonable results if either f or u has jumps in its derivatives. Numerical experiments indicate approximately second order accuracy for both algorithms if the regularity of the data is reduced in this way, assuming that the level set u(x)=0 is a manifold. Numerical experiments indicate that dependence on the placement of @W with respect to the grid is quite small for our algorithms. Specifically, a grid shift results in an O(h^p) change in the computed solution, where p is the observed rate of convergence.