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