[13463] | 1 | import os.path
|
---|
| 2 | import inspect
|
---|
[21341] | 3 | from arch import *
|
---|
[16560] | 4 | import numpy
|
---|
| 5 | from verbose import verbose
|
---|
[13463] | 6 | from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
|
---|
[16560] | 7 | from paterson import paterson
|
---|
| 8 | from SetMarineIceSheetBC import SetMarineIceSheetBC
|
---|
[13463] | 9 |
|
---|
| 10 | #Start defining model parameters here
|
---|
| 11 |
|
---|
| 12 | #Geometry and observation
|
---|
[21341] | 13 | x = numpy.array(archread('../Data/Pig.arch','x'))
|
---|
| 14 | y = numpy.array(archread('../Data/Pig.arch','y'))
|
---|
| 15 | vx_obs = numpy.array(archread('../Data/Pig.arch','vx_obs'))
|
---|
| 16 | vy_obs = numpy.array(archread('../Data/Pig.arch','vy_obs'))
|
---|
| 17 | index = numpy.array(archread('../Data/Pig.arch','index')).astype(int)
|
---|
| 18 | surface = numpy.array(archread('../Data/Pig.arch','surface'))
|
---|
| 19 | thickness = numpy.array(archread('../Data/Pig.arch','thickness'))
|
---|
[13463] | 20 |
|
---|
| 21 | [md.inversion.vx_obs] =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y)
|
---|
| 22 | [md.inversion.vy_obs] =InterpFromMeshToMesh2d(index,x,y,vy_obs,md.mesh.x,md.mesh.y)
|
---|
| 23 | [md.geometry.surface] =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)
|
---|
| 24 | [md.geometry.thickness]=InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)
|
---|
[17806] | 25 | md.geometry.base=md.geometry.surface-md.geometry.thickness
|
---|
[13463] | 26 | md.initialization.vx=md.inversion.vx_obs
|
---|
| 27 | md.initialization.vy=md.inversion.vy_obs
|
---|
[21729] | 28 | md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
|
---|
| 29 | md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
|
---|
[13463] | 30 |
|
---|
| 31 | #Materials
|
---|
[21729] | 32 | md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
|
---|
[13463] | 33 | md.materials.rheology_B=paterson(md.initialization.temperature)
|
---|
[21729] | 34 | md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
|
---|
[13463] | 35 | md.initialization.temperature=md.initialization.temperature
|
---|
| 36 |
|
---|
| 37 | #Friction
|
---|
[21729] | 38 | md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
|
---|
[16137] | 39 | md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
|
---|
[21729] | 40 | md.friction.p=numpy.ones((md.mesh.numberofelements))
|
---|
| 41 | md.friction.q=numpy.ones((md.mesh.numberofelements))
|
---|
[13463] | 42 |
|
---|
| 43 | #Numerical parameters
|
---|
[16137] | 44 | md.masstransport.stabilization=1.
|
---|
[13463] | 45 | md.verbose=verbose(0)
|
---|
[14310] | 46 | md.settings.waitonlock=30
|
---|
[13463] | 47 | md.timestepping.time_step=1.
|
---|
| 48 | md.timestepping.final_time=2.
|
---|
[16137] | 49 | md.stressbalance.restol=0.05
|
---|
| 50 | md.stressbalance.reltol=1.
|
---|
[13463] | 51 | md.steadystate.reltol=1.
|
---|
[16137] | 52 | md.stressbalance.abstol=float('nan')
|
---|
[13463] | 53 |
|
---|
| 54 | #Boundary conditions:
|
---|
[13471] | 55 | md=SetMarineIceSheetBC(md)
|
---|
[13463] | 56 |
|
---|
| 57 | #Change name so that no test have the same name
|
---|
| 58 | if len(inspect.stack()) > 2:
|
---|
| 59 | md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
|
---|