I wonder if there is any method to compute variational problems subject to certain shape constraints (e.g., convexity, monotonicity, etc.). The literature I found on this topic (which I am no expert in) seem to focus on existence and regularities of the solution.

For example: denote the collection of convex functions on $[-1,1]$ by $\mathcal{C}$. Given a fixed $f \in \mathcal{C}\cap L^2$, compute

$\sup\{|Lf-Lg|: \|f-g\|_2 \leq \epsilon, g \in \mathcal{C}\cap L^2\}$,

where $L$ is some linear functional. To be concrete, let's consider $Lf=f(0)$. When $\epsilon$ is small, $g$ is like a perturbation of $f$, but since $g$ needs to be convex, the perturbation cannot be arbitrary. Even some asymptotic result would be enlightening.