  Many problems of theoretical and practical interest involve finding a convex
or concave function. For instance, optimization problems such as finding the
projection on the convex functions in $H^k(\Omega)$, or some problems in
economics.
  In the continuous setting and assuming smoothness, the convexity constraints
may be given locally by asking the Hessian matrix to be positive semidefinite,
but in making discrete approximations two difficulties arise: the continuous
solutions may be not smooth, and an adequate discrete version of the Hessian
must be given.
  In this paper we propose a finite element description of the Hessian, and
prove convergence under very general conditions, even when the continuous
solution is not smooth, working on any dimension, and requiring a linear number
of constraints in the number of nodes.
  Using semidefinite programming codes, we show concrete examples of
approximations to optimization problems.
