Discrete energy method for the analysis of structures with reference to box girder and broad arch bridges