コード例 #1
0
ファイル: test.py プロジェクト: JacobDowns/VarGlaS
import src.physical_constants as pc
from data.data_factory   import DataFactory
from pylab               import *
from gmshpy              import *
from scipy.interpolate   import RectBivariateSpline
from src.utilities       import DataInput
from scipy.io            import loadmat

#===============================================================================
# data preparation :

thklim = 200.0

# collect the raw data :
bamber   = DataFactory.get_bamber(thklim = thklim)
searise  = DataFactory.get_searise(thklim = thklim)
#meas_shf = DataFactory.get_shift_gre_measures()

#dbv  = DataInput("../results/", ("Ubmag_measures.mat", "Ubmag.mat"), 
#                 gen_space=False)
dsr  = DataInput(None, searise,  gen_space=False)
dbm  = DataInput(None, bamber,   gen_space=False)
#dmss = DataInput(None, meas_shf, gen_space=False)

#dbv.set_data_min('Ubmag', 0.0,   0.0)
#dbv.set_data_max('Ubmag', 500.0, 500.0)

dsr.change_projection(dbm)
dsr.set_data_min('U_ob', 0.0,   0.0)
dsr.set_data_max('U_ob', 400.0, 400.0)
コード例 #2
0
from data.data_factory import DataFactory
from src.utilities import DataInput, DataOutput
from src.helper import *
from dolfin import *
from time import time

out_dir = './stress_balance_stokes_5H/'
in_dir = './results_stokes_5H/03/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 200.0

# collect the raw data :
bamber = DataFactory.get_bamber(thklim=thklim)

# define the meshes :
mesh = Mesh('meshes/greenland_3D_5H.xml')
mesh.coordinates()[:, 2] /= 100000.0

# create data objects to use with varglas :
dbm = DataInput(None, bamber, mesh=mesh)

# get the expressions used by varglas :
Surface = dbm.get_spline_expression('h')
Bed = dbm.get_spline_expression('b')

model = model.Model(out_dir=out_dir)
model.set_geometry(Surface, Bed)
model.set_mesh(mesh, deform=True)
コード例 #3
0
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities import DataInput, MeshGenerator
from data.data_factory import DataFactory

# create meshgrid for contour :
vara = DataFactory.get_bamber()
H = vara['H']['map_data']
S = vara['h']['map_data']
B = vara['b']['map_data']
H[S <= 0] = 0.0
vara['H']['map_data'] = H

# process the data :
dd = DataInput(None, vara, flip=False, gen_space=False)
#dd.set_data_max('mask', 2, 0)

m = MeshGenerator(dd, 'mesh', './')

# 20 works well for the last arg. below
m.create_contour('H', 200.0, 3)
m.plot_contour()

m.eliminate_intersections()
m.plot_contour()

# 10000 works well on the following line
m.write_gmsh_contour(1000)
コード例 #4
0
ファイル: bv_antartica_v2.py プロジェクト: JacobDowns/VarGlaS
import sys
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities       import DataInput,DataOutput
from data.data_factory   import DataFactory
from meshes.mesh_factory import MeshFactory
from src.physics         import VelocityBalance_2
from dolfin              import Mesh, set_log_active

set_log_active(True)

thklim = 50.0

bedmap1 = DataFactory.get_bedmap1(thklim=thklim)
bedmap2 = DataFactory.get_bedmap2(thklim=thklim)

# load a mesh :
mesh = Mesh("meshes/2dmesh.xml")

db1  = DataInput(None, bedmap1, mesh=mesh)
db2  = DataInput(None, bedmap2, mesh=mesh)

h    = db2.get_projection("h_n")
H    = db2.get_projection("H_n")
adot = db1.get_projection("adot")

prb   = VelocityBalance_2(mesh, H, h, adot, 12.0)
prb.solve_forward()

# File ouput
コード例 #5
0
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities     import DataInput,DataOutput
from data.data_factory import DataFactory
from src.physics       import VelocityBalance_2
from numpy             import sqrt
from pylab             import *
from dolfin            import *
from scipy.optimize    import fmin_l_bfgs_b
import os

set_log_active(True)

# collect the raw data :
searise = DataFactory.get_searise()
measure = DataFactory.get_gre_measures()
bamber  = DataFactory.get_bamber()

direc = os.path.dirname(os.path.realpath(__file__))

# load a mesh :
mesh    = Mesh("./mesh_5km.xml")

# create data objects to use with varglas :
dsr     = DataInput(None, searise, mesh=mesh)
dbam    = DataInput(None, bamber, mesh=mesh)
dms     = DataInput(None, measure, mesh=mesh, flip=True)
dms.change_projection(dsr)

# Bound data to managable values
コード例 #6
0
import sys
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities import DataInput, DataOutput
from data.data_factory import DataFactory
from meshes.mesh_factory import MeshFactory
from src.physics import VelocityBalance_2
from dolfin import Mesh, set_log_active

set_log_active(True)

thklim = 50.0

bedmap1 = DataFactory.get_bedmap1(thklim=thklim)
bedmap2 = DataFactory.get_bedmap2(thklim=thklim)

# load a mesh :
mesh = Mesh("meshes/2dmesh.xml")

db1 = DataInput(None, bedmap1, mesh=mesh)
db2 = DataInput(None, bedmap2, mesh=mesh)

h = db2.get_projection("h_n")
H = db2.get_projection("H_n")
adot = db1.get_projection("adot")

prb = VelocityBalance_2(mesh, H, h, adot, 12.0)
prb.solve_forward()

# File ouput
コード例 #7
0
ファイル: bv_greenland_v2.py プロジェクト: JacobDowns/VarGlaS
import sys
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities     import DataInput,DataOutput
from data.data_factory import DataFactory
from src.physics       import VelocityBalance_2
from dolfin            import Mesh, set_log_active
from plot.plothelp.plotting import plotIce
import os

set_log_active(True)

# collect the raw data :
searise = DataFactory.get_searise()
measure = DataFactory.get_gre_measures()
#bamber  = DataFactory.get_bamber()

direc = os.path.dirname(os.path.realpath(__file__))

# load a mesh :
mesh    = Mesh("../meshes/mesh.xml")

# create data objects to use with varglas :
dsr     = DataInput(None, searise, mesh=mesh, create_proj=True)
#dbm     = DataInput(None, bamber,  mesh=mesh)
dms     = DataInput(None, measure, mesh=mesh, create_proj=True, flip=True)

dms.change_projection(dsr)

dsr.set_data_min('H', 10.0, 10.0)
コード例 #8
0
ファイル: data_assimilation.py プロジェクト: mauro3/VarGlaS
import sys
src_directory = '../../../'
sys.path.append(src_directory)

import src.model              as model
import src.solvers            as solvers
import src.physical_constants as pc
from data.data_factory   import DataFactory
from meshes.mesh_factory import MeshFactory
from src.helper          import default_nonlin_solver_params
from src.utilities       import DataInput
from dolfin              import *

set_log_active(True)

var_measures = DataFactory.get_ant_measures()
var_bedmap1  = DataFactory.get_lebrocq()
var_bedmap2  = DataFactory.get_bedmap2()

mesh         = MeshFactory.get_antarctica_coarse()
flat_mesh    = MeshFactory.get_antarctica_coarse()

dm  = DataInput(None, var_measures, mesh=mesh,flip=True)
db1 = DataInput(None, var_bedmap1,  mesh=mesh)
db2 = DataInput(None, var_bedmap2,  mesh=mesh, flip=True)

thklim = 50.0

db2.set_data_min("H", thklim, thklim)
db2.set_data_min("h", 0.0,0.0)
コード例 #9
0
ファイル: bv_bedmap2.py プロジェクト: mauro3/VarGlaS
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from pylab                  import *
from dolfin                 import *
from src.utilities          import DataInput, DataOutput
from src.physics            import VelocityBalance_2
from plot.plothelp.plotting import plotIce
from data.data_factory      import DataFactory
from meshes.mesh_factory    import MeshFactory

set_log_level(PROGRESS)

bm1 = DataFactory.get_lebrocq()
bm2 = DataFactory.get_bedmap2()

direc = os.path.dirname(os.path.realpath(__file__)) 

mesh   = Mesh("../meshes/mesh.xml")

# Import data :
d1     = DataInput(None, bm1, mesh=mesh)
d3     = DataInput(None, bm2, mesh=mesh, flip=True)

# set minimum values for data :
d3.set_data_val("H",    32767, 10.0)
d3.set_data_val("h",    32767,  0.0)
d3.set_data_val("mask", 127,    1.0)
コード例 #10
0
ファイル: transient.py プロジェクト: whigg/VarGlaS
sys.path.append(src_directory)

from data.data_factory      import DataFactory
from meshes.mesh_factory    import MeshFactory
from src.utilities          import DataInput
from src.model              import Model
from src.solvers            import SteadySolver, TransientSolver
from src.physical_constants import IceParameters
from src.helper             import default_nonlin_solver_params
from pylb                   import *
from dolfin                 import set_log_active
from scipy.io               import *

set_log_active(True)

vara = DataFactory.get_searise(thklim = 50.0)

mesh                    = MeshFactory.get_greenland_coarse()
flat_mesh               = MeshFactory.get_greenland_coarse() 
mesh.coordinates()[:,2] = mesh.coordinates()[:,2]/1000.0

dd                 = DataInput(None, vara, mesh=mesh)

Surface            = dd.get_spline_expression('h')
Bed                = dd.get_spline_expression('b')
SMB                = dd.get_spline_expression('adot')
SurfaceTemperature = dd.get_spline_expression('T')
BasalHeatFlux      = dd.get_spline_expression('q_geo')
U_observed         = dd.get_spline_expression('U_ob')
Tn                 = vara['Tn']['map_data']
           
コード例 #11
0
ファイル: bv_bedmap2.py プロジェクト: whigg/VarGlaS
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from pylab                  import *
from dolfin                 import *
from src.utilities          import DataInput, DataOutput
from src.physics            import VelocityBalance_2
from plot.plothelp.plotting import plotIce
from data.data_factory      import DataFactory
from meshes.mesh_factory    import MeshFactory

set_log_level(PROGRESS)

bm1 = DataFactory.get_bedmap1()
bm2 = DataFactory.get_bedmap2()

direc = os.path.dirname(os.path.realpath(__file__)) 

mesh   = Mesh("../meshes/mesh.xml")

# Import data :
d1     = DataInput(None, bm1, mesh=mesh)
d3     = DataInput(None, bm2, mesh=mesh, flip=True)

# set minimum values for data :
d3.set_data_val("H",    32767, 10.0)
d3.set_data_val("h",    32767,  0.0)
d3.set_data_val("mask", 127,    1.0)
コード例 #12
0
ファイル: test.py プロジェクト: douglas-brinkerhoff/VarGlaS
from src.helper           import default_nonlin_solver_params
from src.utilities        import DataInput, DataOutput
from dolfin               import *
from pylab                import sqrt, copy
from time                 import time

# make the directory if needed :
out_dir = './test_results/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 200.0

# collect the raw data :
searise  = DataFactory.get_searise(thklim = thklim)
measure  = DataFactory.get_gre_measures()
meas_shf = DataFactory.get_shift_gre_measures()
bamber   = DataFactory.get_bamber(thklim = thklim)
fm_qgeo  = DataFactory.get_gre_qgeo_fox_maule()
sec_qgeo = DataFactory.get_gre_qgeo_secret()

# define the meshes :
mesh      = Mesh('meshes/mesh_high_new.xml')
flat_mesh = Mesh('meshes/mesh_high_new.xml')
#mesh      = Mesh('meshes/mesh_low.xml')
#flat_mesh = Mesh('meshes/mesh_low.xml')
mesh.coordinates()[:,2]      /= 100000.0
flat_mesh.coordinates()[:,2] /= 100000.0

コード例 #13
0
ファイル: data_assimilation.py プロジェクト: whigg/VarGlaS

# get the input args :
i = int(sys.argv[2])           # assimilation number
dir_b = sys.argv[1] + '/0'     # directory to save

# set the output directory :
out_dir = dir_b + str(i) + '/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 200.0

# collect the raw data :
searise  = DataFactory.get_searise(thklim = thklim)
bamber   = DataFactory.get_bamber(thklim = thklim)
fm_qgeo  = DataFactory.get_gre_qgeo_fox_maule()
#measure  = DataFactory.get_gre_measures()
rignot   = DataFactory.get_gre_rignot()

# define the mesh :
mesh = MeshFactory.get_greenland_coarse()

# create data objects to use with varglas :
dsr     = DataInput(None, searise,  mesh=mesh)
dbm     = DataInput(None, bamber,   mesh=mesh)
#dms     = DataInput(None, measure,  mesh=mesh)
dfm     = DataInput(None, fm_qgeo,  mesh=mesh)
drg     = DataInput(None, rignot,   mesh=mesh)
コード例 #14
0
ファイル: bv_greenland_v2.py プロジェクト: JacobDowns/VarGlaS
import sys
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities       import DataInput,DataOutput
from data.data_factory   import DataFactory
from meshes.mesh_factory import MeshFactory
from src.physics         import VelocityBalance_2
from dolfin              import Mesh, set_log_active

set_log_active(True)

thklim = 20.0

# collect the raw data :
searise  = DataFactory.get_searise()
measure  = DataFactory.get_gre_measures()
meas_shf = DataFactory.get_shift_gre_measures()
bamber   = DataFactory.get_bamber(thklim = thklim)

# load a mesh :
mesh    = Mesh("results/meshes/refined_mesh.xml")

# create data objects to use with varglas :
dsr     = DataInput(None, searise,  mesh=mesh)
dbm     = DataInput(None, bamber,   mesh=mesh)
dms     = DataInput(None, measure,  mesh=mesh)
dmss    = DataInput(None, meas_shf, mesh=mesh)

dms.change_projection(dsr)
コード例 #15
0
ファイル: transient.py プロジェクト: JacobDowns/VarGlaS
from src.helper           import default_nonlin_solver_params
from src.utilities        import DataInput, DataOutput
from dolfin               import *
from pylab                import sqrt, copy
from time                 import time

# make the directory if needed :
out_dir   = './results/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 10.0

# collect the raw data :
searise  = DataFactory.get_searise(thklim = thklim)
bamber   = DataFactory.get_bamber(thklim = thklim)
fm_qgeo  = DataFactory.get_gre_qgeo_fox_maule()

# define the meshes :
mesh      = Mesh('../../../meshes/greenland/greenland_coarse_mesh.xml')
flat_mesh = Mesh('../../../meshes/greenland/greenland_coarse_mesh.xml')
mesh.coordinates()[:,2]      /= 1000.0
flat_mesh.coordinates()[:,2] /= 1000.0


# create data objects to use with varglas :
dsr     = DataInput(None, searise,  mesh=mesh)
dbm     = DataInput(None, bamber,   mesh=mesh)
dfm     = DataInput(None, fm_qgeo,  mesh=mesh)
コード例 #16
0
ファイル: test.py プロジェクト: whigg/VarGlaS
from src.helper import default_nonlin_solver_params
from src.utilities import DataInput, DataOutput
from dolfin import *
from pylab import sqrt, copy
from time import time

# make the directory if needed :
out_dir = './test_results/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 200.0

# collect the raw data :
searise = DataFactory.get_searise(thklim=thklim)
measure = DataFactory.get_gre_measures()
meas_shf = DataFactory.get_shift_gre_measures()
bamber = DataFactory.get_bamber(thklim=thklim)
fm_qgeo = DataFactory.get_gre_qgeo_fox_maule()
sec_qgeo = DataFactory.get_gre_qgeo_secret()

# define the meshes :
mesh = Mesh('meshes/mesh_high_new.xml')
flat_mesh = Mesh('meshes/mesh_high_new.xml')
#mesh      = Mesh('meshes/mesh_low.xml')
#flat_mesh = Mesh('meshes/mesh_low.xml')
mesh.coordinates()[:, 2] /= 100000.0
flat_mesh.coordinates()[:, 2] /= 100000.0

# create data objects to use with varglas :
コード例 #17
0
ファイル: bv_greenland_v2.py プロジェクト: whigg/VarGlaS
import sys
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities import DataInput, DataOutput
from data.data_factory import DataFactory
from meshes.mesh_factory import MeshFactory
from src.physics import VelocityBalance_2
from dolfin import Mesh, set_log_active

set_log_active(True)

thklim = 20.0

# collect the raw data :
searise = DataFactory.get_searise()
measure = DataFactory.get_gre_measures()
meas_shf = DataFactory.get_shift_gre_measures()
bamber = DataFactory.get_bamber(thklim=thklim)

# load a mesh :
mesh = Mesh("results/meshes/refined_mesh.xml")

# create data objects to use with varglas :
dsr = DataInput(None, searise, mesh=mesh)
dbm = DataInput(None, bamber, mesh=mesh)
dms = DataInput(None, measure, mesh=mesh)
dmss = DataInput(None, meas_shf, mesh=mesh)

dms.change_projection(dsr)
コード例 #18
0
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities     import DataInput, MeshGenerator
from data.data_factory import DataFactory

# create meshgrid for contour :
vara = DataFactory.get_bedmap2()

# process the data :
dd = DataInput(None, vara, flip=True, gen_space=False)
#dd.set_data_max('mask', 2, 0)

m = MeshGenerator(dd, 'mesh', '../meshes/') 

m.create_contour('mask', 0.999, 100)
m.plot_contour()

m.eliminate_intersections()

m.write_gmsh_contour(10000.)
m.finish()


コード例 #19
0
ファイル: gen_mesh.py プロジェクト: whigg/VarGlaS
import os
src_directory = '../../../../'
sys.path.append(src_directory)

from src.utilities       import DataInput, MeshGenerator, MeshRefiner
from data.data_factory   import DataFactory
from pylab               import *


#===============================================================================
# data preparation :

thklim = 0.0

# collect the raw data :
bamber   = DataFactory.get_bamber(thklim = thklim)
searise  = DataFactory.get_searise(thklim = thklim)

dsr  = DataInput(None, searise, gen_space=False)
dbm  = DataInput(None, bamber,  gen_space=False)


#===============================================================================
# generate the contour :
m = MeshGenerator(dbm, 'mesh', '')

m.create_contour('H', zero_cntr=200.0, skip_pts=2)
m.eliminate_intersections(dist=40)
#m.plot_contour()
m.write_gmsh_contour(boundary_extend=False)
m.extrude(h=100000, n_layers=10)
コード例 #20
0
import sys
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities          import DataInput,DataOutput
from data.data_factory      import DataFactory
from src.physics            import VelocityBalance_2
from dolfin                 import Mesh, set_log_active
from plot.plothelp.plotting import plotIce
import os

set_log_active(True)

# collect the raw data :
searise = DataFactory.get_searise()
measure = DataFactory.get_gre_measures()
#bamber  = DataFactory.get_bamber()

direc = os.path.dirname(os.path.realpath(__file__))

# load a mesh :
mesh    = Mesh("../meshes/mesh.xml")

# create data objects to use with varglas :
dsr     = DataInput(None, searise, mesh=mesh, create_proj=True)
#dbm     = DataInput(None, bamber,  mesh=mesh)
dms     = DataInput(None, measure, mesh=mesh, create_proj=True, flip=True)

dms.change_projection(dsr)

dsr.set_data_min('H', 10.0, 10.0)
コード例 #21
0
#set_log_level(DEBUG)

# output directory :
i = int(sys.argv[1])
dir_b   = './results_shelves/0'

# make the directory if needed :
out_dir = dir_b + str(i) + '/'
d       = os.path.dirname(out_dir)
if not os.path.exists(d):
  os.makedirs(d)


thklim = 200.0

measures  = DataFactory.get_ant_measures(res=900)
bedmap1   = DataFactory.get_bedmap1(thklim=thklim)
bedmap2   = DataFactory.get_bedmap2(thklim=thklim)

mesh      = Mesh('meshes/mesh_low.xml')
flat_mesh = Mesh('meshes/mesh_low.xml')
#mesh.coordinates()[:,2]      /= 100000.0
#flat_mesh.coordinates()[:,2] /= 100000.0


dm  = DataInput(None, measures, mesh=mesh)
db1 = DataInput(None, bedmap1,  mesh=mesh)
db2 = DataInput(None, bedmap2,  mesh=mesh)

db2.set_data_val('H', 32767, thklim)
db2.set_data_val('h', 32767, 0.0)
コード例 #22
0
from src.helper           import default_nonlin_solver_params
from src.utilities        import DataInput, DataOutput
from dolfin               import *
from pylab                import sqrt, copy
from time                 import time

# make the directory if needed :
out_dir   = './results/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 10.0

# collect the raw data :
searise  = DataFactory.get_searise(thklim = thklim)
measure  = DataFactory.get_gre_measures()
#meas_shf = DataFactory.get_shift_gre_measures()
bamber   = DataFactory.get_bamber(thklim = thklim)
fm_qgeo  = DataFactory.get_gre_qgeo_fox_maule()
#sec_qgeo = DataFactory.get_gre_qgeo_secret()
merged   = DataFactory.get_gre_merged()

# define the meshes :
mesh      = Mesh('../../../meshes/greenland/greenland_coarse_mesh.xml')
flat_mesh = Mesh('../../../meshes/greenland/greenland_coarse_mesh.xml')
mesh.coordinates()[:,2]      /= 1000.0
flat_mesh.coordinates()[:,2] /= 1000.0


# create data objects to use with varglas :
コード例 #23
0
ファイル: data_assimilation.py プロジェクト: mauro3/VarGlaS
src_directory = '../../../'
sys.path.append(src_directory)

import src.model              as model
import src.solvers            as solvers
import src.physical_constants as pc
from data.data_factory   import DataFactory
from meshes.mesh_factory import MeshFactory
from src.helper          import default_nonlin_solver_params
from src.utilities       import DataInput
from dolfin              import *

set_log_active(True)
parameters['form_compiler']['quadrature_degree'] = 1

vara = DataFactory.get_searise()

mesh                    = MeshFactory.get_greenland_medium()
#mesh.coordinates()[:,2] = mesh.coordinates()[:,2]/1000.0
flat_mesh               = MeshFactory.get_greenland_medium()

dd                 = DataInput(None, vara, mesh=mesh)

Surface            = dd.get_spline_expression('h')
Bed                = dd.get_spline_expression('b')
Smb                = dd.get_spline_expression('adot')
SurfaceTemperature = dd.get_spline_expression('T')
BasalHeatFlux      = dd.get_spline_expression('q_geo')
U_observed         = dd.get_spline_expression('U_ob')

nonlin_solver_params = default_nonlin_solver_params()
コード例 #24
0
ファイル: gen_mesh.py プロジェクト: JacobDowns/VarGlaS
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities     import DataInput, MeshGenerator
from data.data_factory import DataFactory

# create meshgrid for contour :
vara = DataFactory.get_bamber()
H = vara['H']['map_data']
S = vara['h']['map_data']
B = vara['b']['map_data']
H[S<=0] = 0.0
vara['H']['map_data'] = H

# process the data :
dd = DataInput(None, vara, flip=False, gen_space=False)
#dd.set_data_max('mask', 2, 0)

m = MeshGenerator(dd, 'mesh', './')

# 20 works well for the last arg. below
m.create_contour('H', 200.0,3)
m.plot_contour()

m.eliminate_intersections()
m.plot_contour()

# 10000 works well on the following line
m.write_gmsh_contour(1000)
コード例 #25
0
from data.data_factory    import DataFactory
from src.utilities        import DataInput, DataOutput
from src.helper           import *
from dolfin               import *
from time                 import time

out_dir = './stress_balance_stokes_5H/'
in_dir  = './results_stokes_5H/03/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 200.0

# collect the raw data :
bamber   = DataFactory.get_bamber(thklim = thklim)

# define the meshes :
mesh     = Mesh('meshes/greenland_3D_5H.xml')
mesh.coordinates()[:,2] /= 100000.0

# create data objects to use with varglas :
dbm     = DataInput(None, bamber, mesh=mesh)

# get the expressions used by varglas :
Surface = dbm.get_spline_expression('h')
Bed     = dbm.get_spline_expression('b')

model = model.Model(out_dir = out_dir)
model.set_geometry(Surface, Bed)
model.set_mesh(mesh, deform=True)