Index: issm/trunk-jpl/src/m/mech/mechanicalproperties.py
===================================================================
--- issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 19466)
+++ issm/trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 21254)
@@ -1,3 +1,3 @@
-import numpy as npy
+import numpy as np
 from GetNodalFunctionsCoeff import GetNodalFunctionsCoeff
 from results import results
@@ -27,5 +27,5 @@
 	#	raise StandardError('only 2D model supported currently')
 
-	if npy.any(md.flowequation.element_equation!=2):
+	if np.any(md.flowequation.element_equation!=2):
 		print 'Warning: the model has some non SSA elements. These will be treated like SSA elements'
 
@@ -35,11 +35,11 @@
             if len(damage)!=md.mesh.numberofvertices:
 		raise ValueError('if damage is supplied it should be of size ' + md.mesh.numberofvertices)
-            if npy.ndim(damage)==2:
+            if np.ndim(damage)==2:
                 damage=damage.reshape(-1,)
         else: damage=None
 
-	if npy.ndim(vx)==2:
+	if np.ndim(vx)==2:
 		vx=vx.reshape(-1,)
-	if npy.ndim(vy)==2:
+	if np.ndim(vy)==2:
 		vy=vy.reshape(-1,)
 	
@@ -48,9 +48,9 @@
 	numberofvertices=md.mesh.numberofvertices
 	index=md.mesh.elements
-	summation=npy.array([[1],[1],[1]])
-	directionsstress=npy.zeros((numberofelements,4))
-	directionsstrain=npy.zeros((numberofelements,4))
-	valuesstress=npy.zeros((numberofelements,2))
-	valuesstrain=npy.zeros((numberofelements,2))
+	summation=np.array([[1],[1],[1]])
+	directionsstress=np.zeros((numberofelements,4))
+	directionsstrain=np.zeros((numberofelements,4))
+	valuesstress=np.zeros((numberofelements,2))
+	valuesstrain=np.zeros((numberofelements,2))
 	
 	#compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
@@ -60,34 +60,34 @@
 	vxlist=vx[index-1]/md.constants.yts
 	vylist=vy[index-1]/md.constants.yts
-	ux=npy.dot((vxlist*alpha),summation).reshape(-1,)
-	uy=npy.dot((vxlist*beta),summation).reshape(-1,)
-	vx=npy.dot((vylist*alpha),summation).reshape(-1,)
-	vy=npy.dot((vylist*beta),summation).reshape(-1,)
+	ux=np.dot((vxlist*alpha),summation).reshape(-1,)
+	uy=np.dot((vxlist*beta),summation).reshape(-1,)
+	vx=np.dot((vylist*alpha),summation).reshape(-1,)
+	vy=np.dot((vylist*beta),summation).reshape(-1,)
 	uyvx=(vx+uy)/2.
 	#clear vxlist vylist
 	
 	#compute viscosity
-	nu=npy.zeros((numberofelements,))
-	B_bar=npy.dot(md.materials.rheology_B[index-1],summation/3.).reshape(-1,)
+	nu=np.zeros((numberofelements,))
+	B_bar=np.dot(md.materials.rheology_B[index-1],summation/3.).reshape(-1,)
 	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,)
 	
 	#some corrections
-	location=npy.nonzero(npy.logical_and(second_inv==0,power!=0))
+	location=np.nonzero(np.logical_and(second_inv==0,power!=0))
 	nu[location]=10^18 	#arbitrary maximum viscosity to apply where there is no effective shear
 	
 	if 'matice' in md.materials.__module__:
-		location=npy.nonzero(second_inv)
+		location=np.nonzero(second_inv)
 		nu[location]=B_bar[location]/(second_inv[location]**power[location])
-		location=npy.nonzero(npy.logical_and(second_inv==0,power==0))
+		location=np.nonzero(np.logical_and(second_inv==0,power==0))
 		nu[location]=B_bar[location]
-		location=npy.nonzero(npy.logical_and(second_inv==0,power!=0))
+		location=np.nonzero(np.logical_and(second_inv==0,power!=0))
 		nu[location]=10^18
 	elif 'matdamageice' in md.materials.__module__ and damage is not None:
 		print 'computing damage-dependent properties!'
-		Zinv=npy.dot(1-damage[index-1],summation/3.).reshape(-1,)
-		location=npy.nonzero(second_inv)
-		nu[location]=Zinv[location]*B_bar[location]/npy.power(second_inv[location],power[location])
-		location=npy.nonzero(npy.logical_and(second_inv==0,power==0))
+		Zinv=np.dot(1-damage[index-1],summation/3.).reshape(-1,)
+		location=np.nonzero(second_inv)
+		nu[location]=Zinv[location]*B_bar[location]/np.power(second_inv[location],power[location])
+		location=np.nonzero(np.logical_and(second_inv==0,power==0))
 		nu[location]=Zinv[location]*B_bar[location]
 		#clear Zinv
@@ -101,12 +101,12 @@
 	
 	#compute principal properties of stress
-	for i in npy.arange(numberofelements):
+	for i in np.arange(numberofelements):
 	
 		#compute stress and strainrate matrices
-		stress=npy.array([ [tau_xx[i], tau_xy[i]], [tau_xy[i], tau_yy[i]] ])
-		strain=npy.array([ [ux[i], uyvx[i]], [uyvx[i], vy[i]] ])
+		stress=np.array([ [tau_xx[i], tau_xy[i]], [tau_xy[i], tau_yy[i]] ])
+		strain=np.array([ [ux[i], uyvx[i]], [uyvx[i], vy[i]] ])
 	
 		#eigenvalues and vectors for stress
-		value,directions=npy.linalg.eig(stress);
+		value,directions=np.linalg.eig(stress);
 		idx=abs(value).argsort()[::-1] # sort in descending order
 		value=value[idx]
@@ -116,5 +116,5 @@
 
 		#eigenvalues and vectors for strain
-		value,directions=npy.linalg.eig(strain);
+		value,directions=np.linalg.eig(strain);
 		idx=abs(value).argsort()[::-1] # sort in descending order
 		value=value[idx]
@@ -133,5 +133,5 @@
 	stress.principalvalue2=valuesstress[:,1]
 	stress.principalaxis2=directionsstress[:,2:4]
-	stress.effectivevalue=1./npy.sqrt(2.)*npy.sqrt(stress.xx**2+stress.yy**2+2.*stress.xy**2)
+	stress.effectivevalue=1./np.sqrt(2.)*np.sqrt(stress.xx**2+stress.yy**2+2.*stress.xy**2)
 	md.results.stress=stress
 	
@@ -144,5 +144,5 @@
 	strainrate.principalvalue2=valuesstrain[:,1]*md.constants.yts 
 	strainrate.principalaxis2=directionsstrain[:,2:4]
-	strainrate.effectivevalue=1./npy.sqrt(2.)*npy.sqrt(strainrate.xx**2+strainrate.yy**2+2.*strainrate.xy**2)
+	strainrate.effectivevalue=1./np.sqrt(2.)*np.sqrt(strainrate.xx**2+strainrate.yy**2+2.*strainrate.xy**2)
 	md.results.strainrate=strainrate
 	
@@ -155,5 +155,5 @@
 	deviatoricstress.principalvalue2=valuesstress[:,1]
 	deviatoricstress.principalaxis2=directionsstress[:,2:4]
-	deviatoricstress.effectivevalue=1./npy.sqrt(2.)*npy.sqrt(stress.xx**2+stress.yy**2+2.*stress.xy**2)
+	deviatoricstress.effectivevalue=1./np.sqrt(2.)*np.sqrt(stress.xx**2+stress.yy**2+2.*stress.xy**2)
 	md.results.deviatoricstress=deviatoricstress
 
