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

Last change on this file since 15771 was 15771, checked in by Mathieu Morlighem, 12 years ago

CHG: Diagnostic is now Stressbalance

File size: 2.4 KB
RevLine 
[14134]1import numpy
2from model import *
3from triangle import *
4from setmask import *
5from parameterize import *
6from setflowequation import *
7from EnumDefinitions import *
8from solve import *
9from MatlabFuncs import *
[14212]10from PythonFuncs import *
[14134]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
[14212]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)))
[15771]29 md.stressbalance.spcvx[pos]=0.
30 md.stressbalance.spcvy[pos]=0.
[14134]31 if (L==5000.):
[15771]32 md.stressbalance.spcvx[pos]=15.66
33 md.stressbalance.spcvy[pos]=-0.1967
[14134]34 elif (L==10000.):
[15771]35 md.stressbalance.spcvx[pos]=16.04
36 md.stressbalance.spcvy[pos]=-0.1977
[14134]37 elif (L==20000.):
[15771]38 md.stressbalance.spcvx[pos]=16.53
39 md.stressbalance.spcvy[pos]=-1.27
[14134]40 elif (L==40000.):
[15771]41 md.stressbalance.spcvx[pos]=17.23
42 md.stressbalance.spcvy[pos]=-3.17
[14134]43 elif (L==80000.):
[15771]44 md.stressbalance.spcvx[pos]=16.68
45 md.stressbalance.spcvy[pos]=-2.69
[14134]46 elif (L==160000.):
[15771]47 md.stressbalance.spcvx[pos]=16.03
48 md.stressbalance.spcvy[pos]=-1.27
[14134]49
[15565]50 md=setflowequation(md,'FS','all')
[14134]51
[15771]52 #Compute the stressbalance
[14134]53 md.cluster=generic('name',oshostname(),'np',8)
[15771]54 md=solve(md,StressbalanceSolutionEnum())
[14134]55
56 #Plot the results and save them
[15771]57 vx=md.results.StressbalanceSolution.Vx
58 vy=md.results.StressbalanceSolution.Vy
59 vz=md.results.StressbalanceSolution.Vz
60 results.append(md.results.StressbalanceSolution)
[14134]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.