[22350] | 1 | #Test Name: Esa2Dsurface
|
---|
[24214] | 2 | #Northern hemisphere example for north - south, east - west components of horiz motion
|
---|
[23793] | 3 | #Same as test2111.m except that AIS is assumed to have located in Northern Hemisphere
|
---|
[22350] | 4 |
|
---|
| 5 | import numpy as np
|
---|
| 6 | from model import *
|
---|
| 7 | from socket import gethostname
|
---|
| 8 | from solve import *
|
---|
| 9 | from roundmesh import *
|
---|
| 10 | from love_numbers import *
|
---|
| 11 | from paterson import *
|
---|
| 12 |
|
---|
| 13 | #mesh ais: {{{
|
---|
| 14 | md = model()
|
---|
[23793] | 15 | md = triangle(md, '../Exp/Ais.exp', 200000) # max element size
|
---|
[22350] | 16 | # }}}
|
---|
| 17 | #define load: {{{
|
---|
[24214] | 18 | md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
|
---|
[23793] | 19 | disc_radius = 500 # km
|
---|
[22350] | 20 | index = md.mesh.elements
|
---|
| 21 | x_element = np.mean(md.mesh.x[index - 1], 1) - 1.0e6
|
---|
[22358] | 22 | y_element = np.mean(md.mesh.y[index - 1], 1) + 1.0e6
|
---|
[22350] | 23 | rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000 # radial distance in km
|
---|
[24261] | 24 | md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1 # 1 m water withdrawl
|
---|
[22350] | 25 | # }}}
|
---|
| 26 | #love numbers: {{{
|
---|
[24214] | 27 | nlov = 10000 # horizontal displacements do not work for low degree truncation, e.g., 101
|
---|
[23793] | 28 | md.esa.love_h = np.array(love_numbers('h', 'CF'))
|
---|
[22350] | 29 | md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
|
---|
[23793] | 30 | md.esa.love_l = np.array(love_numbers('l', 'CF'))
|
---|
[22350] | 31 | md.esa.love_l = np.resize(md.esa.love_l, nlov + 1)
|
---|
| 32 | # }}}
|
---|
| 33 | #mask: {{{
|
---|
[23793] | 34 | #make sure wherever there is an ice load, that the mask is set to ice:
|
---|
[24214] | 35 | md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
|
---|
[22350] | 36 | pos = np.where(md.esa.deltathickness)
|
---|
[24261] | 37 | md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
|
---|
[22350] | 38 |
|
---|
[23793] | 39 | #is ice grounded?
|
---|
[24261] | 40 | md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
|
---|
[22350] | 41 | pos = np.where(md.mask.ice_levelset <= 0)
|
---|
| 42 | md.mask.groundedice_levelset[pos] = 1
|
---|
| 43 | # }}}
|
---|
| 44 | #geometry: {{{
|
---|
| 45 | di = md.materials.rho_ice / md.materials.rho_water
|
---|
[24214] | 46 | md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
|
---|
| 47 | md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
|
---|
[22350] | 48 | md.geometry.base = md.geometry.surface - md.geometry.thickness
|
---|
| 49 | md.geometry.bed = md.geometry.base
|
---|
| 50 | # }}}
|
---|
| 51 | #materials: {{{
|
---|
[24214] | 52 | md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
|
---|
[22350] | 53 | md.materials.rheology_B = paterson(md.initialization.temperature)
|
---|
[24214] | 54 | md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
|
---|
[22350] | 55 | # }}}
|
---|
| 56 | #additional parameters, miscellaneous: {{{
|
---|
[23793] | 57 | md.miscellaneous.name = 'test2113'
|
---|
| 58 | md.esa.degacc = 0.01
|
---|
| 59 | md.esa.hemisphere = 1 # AIS is placed in Northern Hemisphere
|
---|
[22350] | 60 | # }}}
|
---|
| 61 |
|
---|
| 62 | #solve esa: {{{
|
---|
[23793] | 63 | md.esa.requested_outputs = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion']
|
---|
| 64 | md.cluster = generic('name', gethostname(), 'np', 3)
|
---|
[22350] | 65 | md.verbose = verbose('111111111')
|
---|
[23793] | 66 | md = solve(md, 'Esa')
|
---|
[22350] | 67 | # }}}
|
---|
| 68 | #Fields and tolerances to track changes: {{{
|
---|
[23793] | 69 | field_names = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion']
|
---|
| 70 | field_tolerances = [1e-13, 1e-13, 1e-13]
|
---|
| 71 | field_values = [md.results.EsaSolution.EsaUmotion,
|
---|
| 72 | md.results.EsaSolution.EsaNmotion,
|
---|
| 73 | md.results.EsaSolution.EsaEmotion]
|
---|
[22350] | 74 | # }}}
|
---|