Changeset 17766
- Timestamp:
- 04/18/14 09:32:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
r17763 r17766 32 32 else: 33 33 #Guess where the ice front is 34 vertexonfloatingice=numpy.zeros((md.mesh.numberofvertices,)) 35 pos=numpy.nonzero(numpy.sum(md.mask.groundedice_levelset[md.mesh.elements-1]<0,axis=1) > 0)[0] 36 #vertexonfloatingice[md.mesh.elements[pos].astype(int)-1]=1. 37 vertexonfloatingice[md.mesh.elements[pos]-1]=1. 38 vertexonicefront=numpy.logical_and(md.mesh.vertexonboundary,vertexonfloatingice>0.) 34 vertexonfloatingice=numpy.zeros((md.mesh.numberofvertices,1)) 35 pos=numpy.nonzero(numpy.sum(md.mask.groundedice_levelset[md.mesh.elements-1]<0.,axis=1) >0.)[0] 36 vertexonfloatingice[md.mesh.elements[pos].astype(int)-1]=1. 37 vertexonicefront=numpy.logical_and(numpy.reshape(md.mesh.vertexonboundary,(-1,1)),vertexonfloatingice>0.) 39 38 40 39 # pos=find(md.mesh.vertexonboundary & ~vertexonicefront); … … 43 42 print "SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually." 44 43 45 md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices, ))46 md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices, ))47 md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices, ))44 md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 45 md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 46 md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 48 47 md.stressbalance.referential=float('nan')*numpy.ones((md.mesh.numberofvertices,6)) 49 48 md.stressbalance.loadingforce=0*numpy.ones((md.mesh.numberofvertices,3)) … … 69 68 else: 70 69 pos=numpy.nonzero(md.mesh.vertexonboundary)[0] 71 md.stressbalance.spcvx[pos ]=072 md.stressbalance.spcvy[pos ]=073 md.stressbalance.spcvz[pos ]=070 md.stressbalance.spcvx[pos[:]]=0 71 md.stressbalance.spcvy[pos[:]]=0 72 md.stressbalance.spcvz[pos[:]]=0 74 73 75 74 #Dirichlet Values … … 91 90 #Deal with other boundary conditions 92 91 if numpy.all(numpy.isnan(md.balancethickness.thickening_rate)): 93 md.balancethickness.thickening_rate=numpy.zeros((md.mesh.numberofvertices, ))92 md.balancethickness.thickening_rate=numpy.zeros((md.mesh.numberofvertices,1)) 94 93 print " no balancethickness.thickening_rate specified: values set as zero" 95 94 96 md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices, ))97 md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices, ))98 md.damage.spcdamage=float('nan')*numpy.ones((md.mesh.numberofvertices, ))95 md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 96 md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 97 md.damage.spcdamage=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 99 98 100 99 if isinstance(md.initialization.temperature,numpy.ndarray) and numpy.size(md.initialization.temperature,axis=0)==md.mesh.numberofvertices: 101 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices, ))100 md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices,1)) 102 101 if hasattr(md.mesh,'vertexonsurface'): 103 102 pos=numpy.nonzero(md.mesh.vertexonsurface)[0] 104 103 md.thermal.spctemperature[pos]=md.initialization.temperature[pos] #impose observed temperature on surface 105 104 if not isinstance(md.basalforcings.geothermalflux,numpy.ndarray) or not numpy.size(md.basalforcings.geothermalflux,axis=0)==md.mesh.numberofvertices: 106 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices, ))107 md.basalforcings.geothermalflux[numpy.nonzero(md.mask.groundedice_levelset>0.) [0]]=50.*10.**-3 #50mW/m2105 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices,1)) 106 md.basalforcings.geothermalflux[numpy.nonzero(md.mask.groundedice_levelset>0.)]=50.*10.**-3 #50mW/m2 108 107 else: 109 108 print " no thermal boundary conditions created: no observed temperature found" 110 109 111 110 return md 111
Note:
See TracChangeset
for help on using the changeset viewer.