  In this article, we describe an approach for solving partial differential
equations with general boundary conditions imposed on arbitrarily shaped
boundaries. A function that has a prescribed value on the domain in which a
differential equation is valid and smoothly but rapidly varying values on the
boundary where boundary conditions are imposed is used to modify the original
differential equations. The mathematical derivations are straight forward, and
generically applicable to a wide variety of partial differential equations. To
demonstrate the general applicability of the approach, we provide four
examples: (1) the diffusion equation with both Neumann and Dirichlet boundary
conditions, (2) the diffusion equation with surface diffusion, (3) the
mechanical equilibrium equation, and (4) the equation for phase transformation
with additional boundaries. The solutions for a few of these cases are
validated against corresponding analytical and semi-analytical solutions. The
potential of the approach is demonstrated with five applications:
surface-reaction diffusion kinetics with a complex geometry,
Kirkendall-effect-induced deformation, thermal stress in a complex geometry,
phase transformations affected by substrate surfaces, and a self-propelling
droplet.
