Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
521634 | Journal of Computational Physics | 2009 | 12 Pages |
We present a finite difference method for discretizing a Heaviside function H(u(x→)), where u is a level set function u:Rn↦R that is positive on a bounded region Ω⊂RnΩ⊂Rn. 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 ΩΩ. 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 ∂Ω∂Ω 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 ΩΩ, u is smooth in a neighborhood of ∂Ω∂Ω, and the level set u(x)=0u(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)=0u(x)=0 is a manifold.Numerical experiments indicate that dependence on the placement of ΩΩ with respect to the grid is quite small for our algorithms. Specifically, a grid shift results in an O(hp)O(hp) change in the computed solution, where p is the observed rate of convergence.