source: issm/trunk/test/NightlyRun/test701.py@ 27035

Last change on this file since 27035 was 27035, checked in by Mathieu Morlighem, 3 years ago

merged trunk-jpl and trunk for revision 27033

File size: 3.0 KB
Line 
1#Test Name: FlowbandFSshelf
2import numpy as np
3from model import *
4from solve import *
5from setflowequation import *
6from bamgflowband import *
7from paterson import *
8
9x = np.arange(1, 3001, 100).T
10h = np.linspace(1000, 300, np.size(x)).T
11b = -917. / 1023. * h
12
13md = bamgflowband(model(), x, b + h, b, 'hmax', 80.)
14
15#Geometry #interp1d returns a function to be called on md.mesh.x
16md.geometry.surface = np.interp(md.mesh.x, x, b + h)
17md.geometry.base = np.interp(md.mesh.x, x, b)
18md.geometry.thickness = md.geometry.surface - md.geometry.base
19
20#mask
21md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices))
22md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0.
23md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices)) - 0.5
24
25#materials
26md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
27md.materials.rheology_B = paterson(md.initialization.temperature)
28md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
29
30#friction
31md.friction.coefficient = np.zeros((md.mesh.numberofvertices))
32md.friction.coefficient[np.where(md.mesh.vertexflags(1))] = 20.
33md.friction.p = np.ones((md.mesh.numberofelements))
34md.friction.q = np.ones((md.mesh.numberofelements))
35
36#Boundary conditions
37md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
38md.stressbalance.loadingforce = 0. * np.ones((md.mesh.numberofvertices, 3))
39md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices, ))
40md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices, ))
41md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices, ))
42md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 0.
43md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
44md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
45
46#Misc
47md = setflowequation(md, 'FS', 'all')
48md.stressbalance.abstol = np.nan
49#md.stressbalance.reltol = 10**-16
50md.stressbalance.FSreconditioning = 1.
51md.stressbalance.maxiter = 20
52md.flowequation.augmented_lagrangian_r = 10000.
53md.miscellaneous.name = 'test701'
54md.verbose = verbose('convergence', True)
55md.cluster = generic('np', 2)
56md.groundingline.migration = 'None'
57
58#Go solve
59field_names = []
60field_tolerances = []
61field_values = []
62#md.initialization.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.y)
63for i in ['MINI', 'MINIcondensed', 'TaylorHood', 'LATaylorHood', 'CrouzeixRaviart', 'LACrouzeixRaviart']:
64 print(' ')
65 print('=====Testing ' + i + ' Full-Stokes Finite element=====')
66 md.flowequation.fe_FS = i
67 md = solve(md, 'Stressbalance')
68 field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vel' + i, 'Pressure' + i]
69 field_tolerances = field_tolerances + [9e-5, 9e-5, 9e-5, 1e-10]
70 field_values = field_values + [md.results.StressbalanceSolution.Vx,
71 md.results.StressbalanceSolution.Vy,
72 md.results.StressbalanceSolution.Vel,
73 md.results.StressbalanceSolution.Pressure]
Note: See TracBrowser for help on using the repository browser.