1 | #Test Name: ISMIPCFS
|
---|
2 | import numpy as np
|
---|
3 | from model import *
|
---|
4 | from socket import gethostname
|
---|
5 | from triangle import *
|
---|
6 | from setmask import *
|
---|
7 | from parameterize import *
|
---|
8 | from setflowequation import *
|
---|
9 | from solve import *
|
---|
10 |
|
---|
11 | """
|
---|
12 | This test is a test from the ISMP - HOM Intercomparison project.
|
---|
13 | Pattyn and Payne 2006
|
---|
14 | """
|
---|
15 |
|
---|
16 | L_list = [80000]
|
---|
17 | results = []
|
---|
18 |
|
---|
19 | for L in L_list:
|
---|
20 | md = triangle(model(), "../Exp/Square_{}.exp".format(L), L / 10.) #size 3 * L
|
---|
21 | md = setmask(md, '', '') #ice sheet test
|
---|
22 | md = parameterize(md, '../Par/ISMIPC.py')
|
---|
23 | md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / L) * np.sin(md.mesh.y * 2. * np.pi / L)))
|
---|
24 | md.extrude(10, 1.)
|
---|
25 |
|
---|
26 | #Add spc on the borders
|
---|
27 | pos = np.where(np.logical_or.reduce((md.mesh.x == 0., md.mesh.x == np.max(md.mesh.x), md.mesh.y == 0., md.mesh.y == np.max(md.mesh.y))))
|
---|
28 | md.stressbalance.spcvx[pos] = 0.
|
---|
29 | md.stressbalance.spcvy[pos] = 0.
|
---|
30 | if (L == 5000.):
|
---|
31 | md.stressbalance.spcvx[pos] = 15.66
|
---|
32 | md.stressbalance.spcvy[pos] = -0.1967
|
---|
33 | elif (L == 10000.):
|
---|
34 | md.stressbalance.spcvx[pos] = 16.04
|
---|
35 | md.stressbalance.spcvy[pos] = -0.1977
|
---|
36 | elif (L == 20000.):
|
---|
37 | md.stressbalance.spcvx[pos] = 16.53
|
---|
38 | md.stressbalance.spcvy[pos] = -1.27
|
---|
39 | elif (L == 40000.):
|
---|
40 | md.stressbalance.spcvx[pos] = 17.23
|
---|
41 | md.stressbalance.spcvy[pos] = -3.17
|
---|
42 | elif (L == 80000.):
|
---|
43 | md.stressbalance.spcvx[pos] = 16.68
|
---|
44 | md.stressbalance.spcvy[pos] = -2.69
|
---|
45 | elif (L == 160000.):
|
---|
46 | md.stressbalance.spcvx[pos] = 16.03
|
---|
47 | md.stressbalance.spcvy[pos] = -1.27
|
---|
48 |
|
---|
49 | md = setflowequation(md, 'FS', 'all')
|
---|
50 |
|
---|
51 | #Compute the stressbalance
|
---|
52 | md.cluster = generic('name', gethostname(), 'np', 8)
|
---|
53 | md = solve(md, 'Stressbalance')
|
---|
54 |
|
---|
55 | #Plot the results and save them
|
---|
56 | vx = md.results.StressbalanceSolution.Vx
|
---|
57 | vy = md.results.StressbalanceSolution.Vy
|
---|
58 | vz = md.results.StressbalanceSolution.Vz
|
---|
59 | results.append(md.results.StressbalanceSolution)
|
---|
60 |
|
---|
61 | # plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer #all', md.mesh.numberoflayers)
|
---|
62 |
|
---|
63 | #Fields and tolerances to track changes
|
---|
64 | field_names = ['Vx80km', 'Vy80km', 'Vz80km']
|
---|
65 | field_tolerances = [1e-12, 1e-12, 1e-12]
|
---|
66 | field_values = []
|
---|
67 | for result in results:
|
---|
68 | field_values = field_values + [result.Vx, result.Vy, result.Vz]
|
---|