Changeset 17395
- Timestamp:
- 03/08/14 15:01:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/mech/mechanicalproperties.py
r15844 r17395 2 2 from GetNodalFunctionsCoeff import GetNodalFunctionsCoeff 3 3 from results import results 4 from averaging import averaging 4 5 5 6 def mechanicalproperties(md,vx,vy): … … 28 29 if npy.any(md.flowequation.element_equation!=2): 29 30 print 'Warning: the model has some non SSA elements. These will be treated like SSA elements' 31 32 if npy.ndim(vx)==2: 33 vx=vx.reshape(-1,) 34 if npy.ndim(vy)==2: 35 vy=vy.reshape(-1,) 30 36 31 37 #initialization 32 38 numberofelements=md.mesh.numberofelements 39 numberofvertices=md.mesh.numberofvertices 33 40 index=md.mesh.elements 34 41 summation=npy.array([[1],[1],[1]]) … … 54 61 nu=npy.zeros((numberofelements,)) 55 62 B_bar=npy.dot(md.materials.rheology_B[index-1],summation/3.).reshape(-1,) 56 power=( md.materials.rheology_n-1.)/(2.*md.materials.rheology_n)63 power=((md.materials.rheology_n-1.)/(2.*md.materials.rheology_n)).reshape(-1,) 57 64 second_inv=(ux**2.+vy**2.+((uy+vx)**2.)/4.+ux*vy).reshape(-1,) 58 65 … … 66 73 location=npy.nonzero(npy.logical_and(second_inv==0,power==0)) 67 74 nu[location]=B_bar[location] 75 location=npy.nonzero(npy.logical_and(second_inv==0,power!=0)) 76 nu[location]=10^18 68 77 elif 'matdamageice' in md.materials.__module__: 69 78 Zinv=npy.dot(md.materials.rheology_Z[index-1],summation/3.).reshape(-1,)
Note:
See TracChangeset
for help on using the changeset viewer.