Changeset 19466
- Timestamp:
- 07/30/15 00:32:51 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/mech/mechanicalproperties.py
r19386 r19466 4 4 from averaging import averaging 5 5 6 def mechanicalproperties(md,vx,vy ):6 def mechanicalproperties(md,vx,vy,**kwargs): 7 7 """ 8 8 MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity … … 29 29 if npy.any(md.flowequation.element_equation!=2): 30 30 print 'Warning: the model has some non SSA elements. These will be treated like SSA elements' 31 32 #unpack kwargs 33 if 'damage' in kwargs: 34 damage=kwargs.pop('damage') 35 if len(damage)!=md.mesh.numberofvertices: 36 raise ValueError('if damage is supplied it should be of size ' + md.mesh.numberofvertices) 37 if npy.ndim(damage)==2: 38 damage=damage.reshape(-1,) 39 else: damage=None 31 40 32 41 if npy.ndim(vx)==2: … … 75 84 location=npy.nonzero(npy.logical_and(second_inv==0,power!=0)) 76 85 nu[location]=10^18 77 elif 'matdamageice' in md.materials.__module__ :86 elif 'matdamageice' in md.materials.__module__ and damage is not None: 78 87 print 'computing damage-dependent properties!' 79 # FIXME might be using damage from a solution, not the initial md.damage.D 80 Zinv=npy.dot(1-md.damage.D[index-1],summation/3.).reshape(-1,) 88 Zinv=npy.dot(1-damage[index-1],summation/3.).reshape(-1,) 81 89 location=npy.nonzero(second_inv) 82 90 nu[location]=Zinv[location]*B_bar[location]/npy.power(second_inv[location],power[location])
Note:
See TracChangeset
for help on using the changeset viewer.