Changeset 21408 for issm/trunk-jpl/test/NightlyRun/test217.py
- Timestamp:
- 11/22/16 02:31:19 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/test217.py
r21060 r21408 1 1 #Test Name: SquareShelfConstrained 2 from MatlabFuncs import * 2 3 3 from model import * 4 from numpy import * 4 from socket import gethostname 5 import numpy as np 5 6 from triangle import * 6 7 from setmask import * … … 15 16 md=parameterize(md,'../Par/SquareShelf.py') 16 17 md=setflowequation(md,'SSA','all') 17 md.cluster=generic('name', oshostname(),'np',3)18 md.cluster=generic('name',gethostname(),'np',3) 18 19 19 20 # redo the parameter file for this special shelf. … … 33 34 34 35 h=1000. 35 md.geometry.thickness=h*ones((md.mesh.numberofvertices ,1))36 md.geometry.thickness=h*ones((md.mesh.numberofvertices)) 36 37 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness 37 38 md.geometry.surface=md.geometry.base+md.geometry.thickness 38 39 39 40 # Initial velocity and pressure 40 md.initialization.vx=zeros((md.mesh.numberofvertices ,1))41 md.initialization.vy=zeros((md.mesh.numberofvertices ,1))42 md.initialization.vz=zeros((md.mesh.numberofvertices ,1))43 md.initialization.pressure=zeros((md.mesh.numberofvertices ,1))41 md.initialization.vx=zeros((md.mesh.numberofvertices)) 42 md.initialization.vy=zeros((md.mesh.numberofvertices)) 43 md.initialization.vz=zeros((md.mesh.numberofvertices)) 44 md.initialization.pressure=zeros((md.mesh.numberofvertices)) 44 45 45 46 # Materials 46 md.initialization.temperature=(273.-20.)*ones((md.mesh.numberofvertices ,1))47 md.initialization.temperature=(273.-20.)*ones((md.mesh.numberofvertices)) 47 48 md.materials.rheology_B=paterson(md.initialization.temperature) 48 md.materials.rheology_n=3.*ones((md.mesh.numberofelements ,1))49 md.materials.rheology_n=3.*ones((md.mesh.numberofelements)) 49 50 50 51 # Boundary conditions: 51 md.stressbalance.spcvx=float(nan)*ones((md.mesh.numberofvertices ,1))52 md.stressbalance.spcvy=float(nan)*ones((md.mesh.numberofvertices ,1))53 md.stressbalance.spcvz=float(nan)*ones((md.mesh.numberofvertices ,1))52 md.stressbalance.spcvx=float(nan)*ones((md.mesh.numberofvertices)) 53 md.stressbalance.spcvy=float(nan)*ones((md.mesh.numberofvertices)) 54 md.stressbalance.spcvz=float(nan)*ones((md.mesh.numberofvertices)) 54 55 55 56 # constrain flanks to 0 normal velocity 56 pos=n umpy.nonzero(numpy.logical_or(md.mesh.x==xmin,md.mesh.x==xmax))57 pos=np.nonzero(np.logical_or.reduce(md.mesh.x==xmin,md.mesh.x==xmax)) 57 58 md.stressbalance.spcvx[pos]=0 58 59 md.stressbalance.spcvz[pos]=float(nan) 59 60 60 61 # constrain grounding line to 0 velocity 61 pos=n umpy.nonzero(md.mesh.y==ymin)62 pos=np.nonzero(md.mesh.y==ymin) 62 63 md.stressbalance.spcvx[pos]=0 63 64 md.stressbalance.spcvy[pos]=0 … … 65 66 # icefront 66 67 nodeonicefront=zeros(md.mesh.numberofvertices) 67 pos=n umpy.nonzero(md.mesh.y==ymax)68 pos=np.nonzero(md.mesh.y==ymax) 68 69 nodeonicefront[pos]=1 69 70 md.mask.ice_levelset=-1+nodeonicefront … … 72 73 73 74 # create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292. 74 # ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3 ;75 # vy_c=ey_c.*md.mesh.y*md.constants.yts ;75 # ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3 76 # vy_c=ey_c.*md.mesh.y*md.constants.yts 76 77 77 78 # Fields and tolerances to track changes
Note:
See TracChangeset
for help on using the changeset viewer.