Optimal Flywheel Design With a General Thickness Form Representation