source: issm/trunk-jpl/test/NightlyRun/test1106.py@ 21060

Last change on this file since 21060 was 21060, checked in by Mathieu Morlighem, 9 years ago

CHG: no more enums in python

File size: 2.4 KB
Line 
1#Test Name: ISMIPCFS
2import numpy
3from model import *
4from triangle import *
5from setmask import *
6from parameterize import *
7from setflowequation import *
8from solve import *
9from MatlabFuncs import *
10from PythonFuncs import *
11
12"""
13This test is a test from the ISMP-HOM Intercomparison project.
14Pattyn and Payne 2006
15"""
16
17L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
18results=[]
19
20for L in L_list:
21 md=triangle(model(),"../Exp/Square_%d.exp" % L,L/10.) #size 3*L
22 md=setmask(md,'','') #ice sheet test
23 md=parameterize(md,'../Par/ISMIPC.py')
24 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x.reshape(-1,1)*2.*numpy.pi/L)*numpy.sin(md.mesh.y.reshape(-1,1)*2.*numpy.pi/L)))
25 md.extrude(10,1.)
26
27 #Add spc on the borders
28 pos=numpy.nonzero(logical_or_n(md.mesh.x==0.,md.mesh.x==numpy.max(md.mesh.x),md.mesh.y==0.,md.mesh.y==numpy.max(md.mesh.y)))
29 md.stressbalance.spcvx[pos]=0.
30 md.stressbalance.spcvy[pos]=0.
31 if (L==5000.):
32 md.stressbalance.spcvx[pos]=15.66
33 md.stressbalance.spcvy[pos]=-0.1967
34 elif (L==10000.):
35 md.stressbalance.spcvx[pos]=16.04
36 md.stressbalance.spcvy[pos]=-0.1977
37 elif (L==20000.):
38 md.stressbalance.spcvx[pos]=16.53
39 md.stressbalance.spcvy[pos]=-1.27
40 elif (L==40000.):
41 md.stressbalance.spcvx[pos]=17.23
42 md.stressbalance.spcvy[pos]=-3.17
43 elif (L==80000.):
44 md.stressbalance.spcvx[pos]=16.68
45 md.stressbalance.spcvy[pos]=-2.69
46 elif (L==160000.):
47 md.stressbalance.spcvx[pos]=16.03
48 md.stressbalance.spcvy[pos]=-1.27
49
50 md=setflowequation(md,'FS','all')
51
52 #Compute the stressbalance
53 md.cluster=generic('name',oshostname(),'np',8)
54 md=solve(md,'Stressbalance')
55
56 #Plot the results and save them
57 vx=md.results.StressbalanceSolution.Vx
58 vy=md.results.StressbalanceSolution.Vy
59 vz=md.results.StressbalanceSolution.Vz
60 results.append(md.results.StressbalanceSolution)
61
62# plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.mesh.numberoflayers)
63
64#Fields and tolerances to track changes
65field_names =[\
66 'Vx5km','Vy5km','Vz5km',\
67 'Vx10km','Vy10km','Vz10km',\
68 'Vx20km','Vy20km','Vz20km',\
69 'Vx40km','Vy40km','Vz40km',\
70 'Vx80km','Vy80km','Vz80km',\
71 'Vx160km','Vy160km','Vz160km'
72]
73field_tolerances=[\
74 1e-12,1e-12,1e-11,\
75 1e-12,1e-12,1e-12,\
76 1e-12,1e-12,1e-12,\
77 1e-12,1e-12,1e-12,\
78 1e-12,1e-12,1e-12,\
79 1e-12,1e-11,1e-12,\
80]
81field_values=[]
82for result in results:
83 field_values=field_values+[\
84 result.Vx,\
85 result.Vy,\
86 result.Vz,\
87 ]
Note: See TracBrowser for help on using the repository browser.