Shear criteria in granite and migmatite deformed in the magmatic and solid states