hsem: boundary function