A direct variational approach to static analysis of discontinua