[14134] | 1 | import numpy
|
---|
| 2 | from model import *
|
---|
| 3 | from triangle import *
|
---|
| 4 | from setmask import *
|
---|
| 5 | from parameterize import *
|
---|
| 6 | from setflowequation import *
|
---|
| 7 | from EnumDefinitions import *
|
---|
| 8 | from solve import *
|
---|
| 9 | from MatlabFuncs import *
|
---|
[14212] | 10 | from PythonFuncs import *
|
---|
[14134] | 11 |
|
---|
| 12 | """
|
---|
| 13 | This test is a test from the ISMP-HOM Intercomparison project.
|
---|
| 14 | Pattyn and Payne 2006
|
---|
| 15 | """
|
---|
| 16 |
|
---|
| 17 | L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
|
---|
| 18 | results=[]
|
---|
| 19 |
|
---|
| 20 | for 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)))
|
---|
[14134] | 29 | md.diagnostic.spcvx[pos]=0.
|
---|
| 30 | md.diagnostic.spcvy[pos]=0.
|
---|
| 31 | if (L==5000.):
|
---|
| 32 | md.diagnostic.spcvx[pos]=15.66
|
---|
| 33 | md.diagnostic.spcvy[pos]=-0.1967
|
---|
| 34 | elif (L==10000.):
|
---|
| 35 | md.diagnostic.spcvx[pos]=16.04
|
---|
| 36 | md.diagnostic.spcvy[pos]=-0.1977
|
---|
| 37 | elif (L==20000.):
|
---|
| 38 | md.diagnostic.spcvx[pos]=16.53
|
---|
| 39 | md.diagnostic.spcvy[pos]=-1.27
|
---|
| 40 | elif (L==40000.):
|
---|
| 41 | md.diagnostic.spcvx[pos]=17.23
|
---|
| 42 | md.diagnostic.spcvy[pos]=-3.17
|
---|
| 43 | elif (L==80000.):
|
---|
| 44 | md.diagnostic.spcvx[pos]=16.68
|
---|
| 45 | md.diagnostic.spcvy[pos]=-2.69
|
---|
| 46 | elif (L==160000.):
|
---|
| 47 | md.diagnostic.spcvx[pos]=16.03
|
---|
| 48 | md.diagnostic.spcvy[pos]=-1.27
|
---|
| 49 |
|
---|
[15565] | 50 | md=setflowequation(md,'FS','all')
|
---|
[14134] | 51 |
|
---|
| 52 | #Compute the diagnostic
|
---|
| 53 | md.cluster=generic('name',oshostname(),'np',8)
|
---|
| 54 | md=solve(md,DiagnosticSolutionEnum())
|
---|
| 55 |
|
---|
| 56 | #Plot the results and save them
|
---|
| 57 | vx=md.results.DiagnosticSolution.Vx
|
---|
| 58 | vy=md.results.DiagnosticSolution.Vy
|
---|
| 59 | vz=md.results.DiagnosticSolution.Vz
|
---|
| 60 | results.append(md.results.DiagnosticSolution)
|
---|
| 61 |
|
---|
| 62 | # plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.mesh.numberoflayers)
|
---|
| 63 |
|
---|
| 64 | #Fields and tolerances to track changes
|
---|
| 65 | field_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 | ]
|
---|
| 73 | field_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 | ]
|
---|
| 81 | field_values=[]
|
---|
| 82 | for result in results:
|
---|
| 83 | field_values=field_values+[\
|
---|
| 84 | result.Vx,\
|
---|
| 85 | result.Vy,\
|
---|
| 86 | result.Vz,\
|
---|
| 87 | ]
|
---|