Numerical simulation of buckling of pretwisted non-circular bars