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