Direct calculation of buckling strength of imperfect structures