Index: /issm/trunk-jpl/src/m/mech/mechanicalproperties.py
===================================================================
--- /issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 17394)
+++ /issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 17395)
@@ -2,4 +2,5 @@
 from GetNodalFunctionsCoeff import GetNodalFunctionsCoeff
 from results import results
+from averaging import averaging
 
 def mechanicalproperties(md,vx,vy):
@@ -28,7 +29,13 @@
 	if npy.any(md.flowequation.element_equation!=2):
 		print 'Warning: the model has some non SSA elements. These will be treated like SSA elements'
+
+	if npy.ndim(vx)==2:
+		vx=vx.reshape(-1,)
+	if npy.ndim(vy)==2:
+		vy=vy.reshape(-1,)
 	
 	#initialization
 	numberofelements=md.mesh.numberofelements
+	numberofvertices=md.mesh.numberofvertices
 	index=md.mesh.elements
 	summation=npy.array([[1],[1],[1]])
@@ -54,5 +61,5 @@
 	nu=npy.zeros((numberofelements,))
 	B_bar=npy.dot(md.materials.rheology_B[index-1],summation/3.).reshape(-1,)
-	power=(md.materials.rheology_n-1.)/(2.*md.materials.rheology_n)
+	power=((md.materials.rheology_n-1.)/(2.*md.materials.rheology_n)).reshape(-1,)
 	second_inv=(ux**2.+vy**2.+((uy+vx)**2.)/4.+ux*vy).reshape(-1,)
 	
@@ -66,4 +73,6 @@
 		location=npy.nonzero(npy.logical_and(second_inv==0,power==0))
 		nu[location]=B_bar[location]
+		location=npy.nonzero(npy.logical_and(second_inv==0,power!=0))
+		nu[location]=10^18
 	elif 'matdamageice' in md.materials.__module__:
 		Zinv=npy.dot(md.materials.rheology_Z[index-1],summation/3.).reshape(-1,)
