Implementation of Hamilton-Jacobi and level set equations on triangulated domains