source: issm/trunk/test/NightlyRun/test2111.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: 2.6 KB
RevLine 
[22350]1#Test Name: Esa2Dsurface
[24313]2#AIS - - southern hemisphere example for north - south, east - west components of horiz motion
[25836]3from socket import gethostname
[22350]4
5import numpy as np
[25836]6
7from lovenumbers import *
[22350]8from model import *
[25836]9from paterson import *
10from roundmesh import *
[22350]11from solve import *
12
[25836]13
[22350]14#mesh ais: {{{
15md = model()
[24313]16md = triangle(md, '../Exp/Ais.exp', 200000) # max element size
[22350]17# }}}
18#define load: {{{
[25836]19md.esa.deltathickness = np.zeros((md.mesh.numberofelements, 1))
[24313]20disc_radius = 500 # km
[22350]21index = md.mesh.elements
[25836]22x_element = md.mesh.x[index - 1].mean(axis=1) - 1.0e6
23y_element = md.mesh.y[index - 1].mean(axis=1) - 1.0e6
[22350]24rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000 # radial distance in km
[25836]25pos = np.where(rad_dist <= disc_radius)[0]
26md.esa.deltathickness[pos] = -1 # 1 m water withdrawl
[22350]27# }}}
28#love numbers: {{{
[25836]29md.solidearth.lovenumbers = lovenumbers('maxdeg', 10000, 'referenceframe', 'CF')
[22350]30# }}}
31#mask: {{{
[24313]32#make sure wherever there is an ice load, that the mask is set to ice:
[25836]33md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, 1))
34pos = np.where(md.esa.deltathickness)[0]
[24313]35md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
[22350]36
[24313]37#is ice grounded?
[25836]38md.mask.ocean_levelset = -np.ones((md.mesh.numberofvertices, 1))
39pos = np.where(md.mask.ice_levelset <= 0)[0]
40md.mask.ocean_levelset[pos] = 1
[22350]41# }}}
42#geometry: {{{
43di = md.materials.rho_ice / md.materials.rho_water
[25836]44md.geometry.thickness = np.ones((md.mesh.numberofvertices, 1))
45md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, 1))
[22350]46md.geometry.base = md.geometry.surface - md.geometry.thickness
47md.geometry.bed = md.geometry.base
48# }}}
49#materials: {{{
[25836]50md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, 1))
[22350]51md.materials.rheology_B = paterson(md.initialization.temperature)
[25836]52md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, 1))
[22350]53# }}}
54#additional parameters, miscellaneous: {{{
[24313]55md.miscellaneous.name = 'test2111'
56md.esa.degacc = 0.01
57md.esa.hemisphere = -1
[22350]58# }}}
59
60#solve esa: {{{
[24313]61md.esa.requested_outputs = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
62md.cluster = generic('name', gethostname(), 'np', 3)
[22350]63md.verbose = verbose('111111111')
[24313]64md = solve(md, 'Esa')
[22350]65# }}}
66#Fields and tolerances to track changes: {{{
[24313]67field_names = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
68field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
69field_values = [md.results.EsaSolution.EsaUmotion,
70 md.results.EsaSolution.EsaNmotion,
71 md.results.EsaSolution.EsaEmotion,
72 md.results.EsaSolution.EsaXmotion,
73 md.results.EsaSolution.EsaYmotion]
[22350]74# }}}
Note: See TracBrowser for help on using the repository browser.