source: issm/trunk/test/NightlyRun/test435.py@ 22758

Last change on this file since 22758 was 22758, checked in by Mathieu Morlighem, 7 years ago

merged trunk-jpl and trunk for revision 22757

File size: 4.2 KB
RevLine 
[22267]1#Test Name: MISMIP3DHO
2import numpy as np
3from model import *
4from socket import gethostname
5from triangle import *
6from setmask import *
7from parameterize import *
8from setflowequation import *
9from solve import *
10
11md = triangle(model(),'../Exp/Square.exp',100000.)
12md = setmask(md,'../Exp/SquareShelf.exp','')
13md = parameterize(md,'../Par/SquareSheetShelf.py')
14md.initialization.vx[:] = 1.
15md.initialization.vy[:] = 1.
16md.geometry.thickness[:] = 500. - md.mesh.x / 10000.
17md.geometry.bed = -100. - md.mesh.x / 1000.
18md.geometry.base = -md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
19md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
20pos = np.where(md.mask.groundedice_levelset >= 0)
21md.geometry.base[pos] = md.geometry.bed[pos]
22md.geometry.surface = md.geometry.base + md.geometry.thickness
23md = md.extrude(4,1.)
24md = setflowequation(md,'HO','all')
25
26#Boundary conditions:
27md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
28md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
29md.stressbalance.spcvx[:] = float('Nan')
30md.stressbalance.spcvy[:] = float('Nan')
31md.stressbalance.spcvz[:] = float('Nan')
32posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)),np.array(np.where(md.mesh.y > 999999.9)))
33posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)),np.array(np.where(md.mesh.y > -0.1)))
34pos = np.unique(np.concatenate((posA,posB)))
35md.stressbalance.spcvy[pos] = 0.
36pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
37md.stressbalance.spcvx[pos2] = 0.
38md.stressbalance.spcvy[pos2] = 0.
39
40md.materials.rheology_B = 1. / ((10**-25)**(1./3.)) * np.ones((md.mesh.numberofvertices,))
41md.materials.rheology_law = 'None'
42md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices,))
43md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
44md.smb.mass_balance[:] = 1.
45md.basalforcings.groundedice_melting_rate[:] = 0.
46md.basalforcings.floatingice_melting_rate[:] = 30.
47md.transient.isthermal = 0
48md.transient.isstressbalance = 1
49md.transient.isgroundingline = 1
50md.transient.ismasstransport = 1
51md.transient.issmb = 1
52md.transient.requested_outputs = ['default','BasalforcingsFloatingiceMeltingRate']
53md.groundingline.migration = 'SubelementMigration'
54md.timestepping.final_time = 30
55md.timestepping.time_step = 10
56
57md.cluster = generic('name',gethostname(),'np',3)
58md = solve(md,'Transient')
59
60#Fields and tolerances to track changes
61field_names = [
62 'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Vz1','Pressure1','FloatingiceMeltingrate1',
63 'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Vz2','Pressure2','FloatingiceMeltingrate2',
64 'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Vz3','Pressure3','FloatingiceMeltingrate3']
65field_tolerances = [
[22520]66 2e-11,5e-12,2e-11,1e-11,7e-10,3e-08,6e-10,1e-13,1e-13,
[22514]67 3e-11,3e-11,9e-10,7e-11,9e-09,2e-07,1e-09,1e-10,1e-13,
[22267]68 1e-9,2e-08,7e-09,2e-7 ,1e-03,8e-04,2e-09,1e-10,1e-13]
69field_values = [
70 md.results.TransientSolution[0].Base,
71 md.results.TransientSolution[0].Surface,
72 md.results.TransientSolution[0].Thickness,
73 md.results.TransientSolution[0].MaskGroundediceLevelset,
74 md.results.TransientSolution[0].Vx,
75 md.results.TransientSolution[0].Vy,
76 md.results.TransientSolution[0].Vz,
77 md.results.TransientSolution[0].Pressure,
78 md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
79 md.results.TransientSolution[1].Base,
80 md.results.TransientSolution[1].Surface,
81 md.results.TransientSolution[1].Thickness,
82 md.results.TransientSolution[1].MaskGroundediceLevelset,
83 md.results.TransientSolution[1].Vx,
84 md.results.TransientSolution[1].Vy,
85 md.results.TransientSolution[1].Vz,
86 md.results.TransientSolution[1].Pressure,
87 md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
88 md.results.TransientSolution[2].Base,
89 md.results.TransientSolution[2].Surface,
90 md.results.TransientSolution[2].Thickness,
91 md.results.TransientSolution[2].MaskGroundediceLevelset,
92 md.results.TransientSolution[2].Vx,
93 md.results.TransientSolution[2].Vy,
94 md.results.TransientSolution[2].Vz,
95 md.results.TransientSolution[2].Pressure,
96 md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate,
97 ]
Note: See TracBrowser for help on using the repository browser.