In #805 and #808, a non-flat rigid edge would also be of interest.
$$f(\boldsymbol{x})$$
It is important to deal with coordinates of the deformed configuration (the rigid edge / surface is fixed in space). This requires the first partial derivatives $\partial f / \partial \boldsymbol{x}_t$ and $\partial f / \partial \boldsymbol{x}_C$.
The corresponding weak-form expression:
$$ \delta W_\text{ext} = \int_{\partial v} \delta u \cdot \lambda (x-x_\text{ext})^+ da $$
with the ramp function
$$ (x)^+ = \frac{x + |x|}{2} $$