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

Last change on this file since 25836 was 25836, checked in by Mathieu Morlighem, 4 years ago

merged trunk-jpl and trunk for revision 25834

File size: 3.0 KB
RevLine 
[22267]1#Test Name: FlowbandFSshelf
2import numpy as np
3from model import *
4from solve import *
5from setflowequation import *
6from bamgflowband import *
7from paterson import *
8
[24313]9x = np.arange(1, 3001, 100).T
10h = np.linspace(1000, 300, np.size(x)).T
11b = -917. / 1023. * h
[22267]12
[24313]13md = bamgflowband(model(), x, b + h, b, 'hmax', 80.)
[22267]14
[24313]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
[22267]20#mask
[25836]21md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices))
[22267]22md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0.
[25836]23md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices)) - 0.5
[22267]24
25#materials
[25836]26md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
[22267]27md.materials.rheology_B = paterson(md.initialization.temperature)
[25836]28md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
[22267]29
30#friction
[25836]31md.friction.coefficient = np.zeros((md.mesh.numberofvertices))
[22267]32md.friction.coefficient[np.where(md.mesh.vertexflags(1))] = 20.
[25836]33md.friction.p = np.ones((md.mesh.numberofelements))
34md.friction.q = np.ones((md.mesh.numberofelements))
[22267]35
36#Boundary conditions
[24313]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, ))
[22267]42md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 0.
43md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
[24313]44md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
[22267]45
46#Misc
[24313]47md = setflowequation(md, 'FS', 'all')
[23189]48md.stressbalance.abstol = np.nan
[22267]49#md.stressbalance.reltol = 10**-16
50md.stressbalance.FSreconditioning = 1.
51md.stressbalance.maxiter = 20
52md.flowequation.augmented_lagrangian_r = 10000.
[24313]53md.miscellaneous.name = 'test701'
54md.verbose = verbose('convergence', True)
55md.cluster = generic('np', 2)
56md.groundingline.migration = 'None'
[22267]57
58#Go solve
59field_names = []
60field_tolerances = []
61field_values = []
[24313]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(' ')
[25836]65 print('=====Testing ' + i + ' Full-Stokes Finite element=====')
[24313]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.