  The present manuscript presents a framework for automating the formulation
and resolution of limit analysis problems in a very general manner. This
framework relies on FEniCS domain-specific language and the representation of
material strength criteria and their corresponding support function in the
conic programming setting. Various choices of finite element discretization,
including discontinuous Galerkin interpolations, are offered by FEniCS,
enabling to formulate lower bound equilibrium elements or upper bound elements
including discontinuities for instance. The numerical resolution of the
corresponding optimization problem is carried out by the interior-point solver
\texttt{Mosek} which takes advantage of the conic representation for yield
criteria. Through various illustrative examples ranging from classical
continuum limit analysis problems to generalized mechanical models such as
plates, shells, strain gradient or Cosserat continua, we show that limit
analysis problems can be formulated using only a few lines of code, discretized
in a very simple manner and solved extremely efficiently. This paper is
accompanied by a FEniCS toolbox implementing the above-mentioned framework.
