source: issm/trunk/test/Par/Pig.py@ 24313

Last change on this file since 24313 was 24313, checked in by Mathieu Morlighem, 5 years ago

merged trunk-jpl and trunk for revision 24310

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