An analysis of constrained deformation by slip and twinning in hexagonal close packed metals and alloys