A numerical method for torsional analysis of structural elements