Пример #1
0
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)

H     = dsr.get_projection("H")
S     = dsr.get_projection("h")
adot  = dsr.get_projection("adot")

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

# File ouput
do    = DataOutput('results/greenland_balance_velocity_v2/')

d_out = {'Ubmag' : prb.Ubmag,
         'H'         : prb.H,
         'adot'      : prb.adot,
         'S'         : prb.S,
         'slope'     : prb.slope,
         'residual'  : prb.residual}
Пример #2
0
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
do = DataOutput('results/antartica_bv/')

d_out = {
    'U_bal_mag': prb.Ubmag,
    'H': prb.H,
    'adot': prb.adot,
    'S': prb.S,
    'slope': prb.slope,
# load a mesh :
mesh    = Mesh("./mesh.xml")

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

dms.change_projection(dsr)

dbam.set_data_min('H', 200.0, 200.0)
dbam.set_data_min('h', 1.0, 1.0)
dms.set_data_min('sp',0.0,-2e9)

H     = dbam.get_projection("H")
H0     = dbam.get_projection("H")
S     = dbam.get_projection("h")
adot  = dsr.get_projection("adot")

Uobs  = dms.get_projection("sp")

Uobs.vector()[Uobs.vector().array()<0] = 0.0

U_sar_spline = dms.get_spline_expression("sp")

insar_mask = CellFunctionSizet(mesh)
insar_mask.set_all(0)
for c in cells(mesh):
    x,y = c.midpoint().x(),c.midpoint().y()
    Uval = U_sar_spline(x,y)
Пример #4
0
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)

H     = dbm.get_projection("H_n")
S     = dbm.get_projection("h_n")
adot  = dsr.get_projection("adot")

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

# File ouput
do    = DataOutput('results/greenland_balance_velocity_v2/')

d_out = {'U_bal_mag' : prb.Ubmag,
         'H'         : prb.H,
         'adot'      : prb.adot,
         'S'         : prb.S,
         'slope'     : prb.slope,
         'residual'  : prb.residual}
Пример #5
0
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)

H = dbm.get_projection("H_n")
S = dbm.get_projection("h_n")
adot = dsr.get_projection("adot")

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

# File ouput
do = DataOutput('results/greenland_balance_velocity_v2/')

d_out = {
    'U_bal_mag': prb.Ubmag,
    'H': prb.H,
    'adot': prb.adot,
    'S': prb.S,
    'slope': prb.slope,
Пример #6
0
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)

H     = dsr.get_projection("H")
S     = dsr.get_projection("h")
adot  = dsr.get_projection("adot")

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

# File ouput
do    = DataOutput('results/greenland_balance_velocity_v2/')

d_out = {'Ubmag' : prb.Ubmag,
         'H'         : prb.H,
         'adot'      : prb.adot,
         'S'         : prb.S,
         'slope'     : prb.slope,
         'residual'  : prb.residual}
Пример #7
0
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)

# get projections for use with FEniCS :
adot   = d1.get_projection("adot")
H      = d3.get_projection("H")
h      = d3.get_projection("h")
b      = d3.get_projection("b")


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

do     = DataOutput('results/antarctia_balance_velocity/')

data_out = {'Ubmag'    : prb.Ubmag,
            'H'        : prb.H,
            'adot'     : prb.adot,
            'S'        : prb.S,
            'slope'    : prb.slope,
            'residual' : prb.residual}
Пример #8
0
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)

# get projections for use with FEniCS :
adot   = d1.get_projection("adot")
H      = d3.get_projection("H")
h      = d3.get_projection("h")
b      = d3.get_projection("b")


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

do     = DataOutput('results/antarctia_balance_velocity/')

data_out = {'Ubmag'    : prb.Ubmag,
            'H'        : prb.H,
            'adot'     : prb.adot,
            'S'        : prb.S,
            'slope'    : prb.slope,
            'residual' : prb.residual}
Пример #9
0
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
do    = DataOutput('results/antartica_bv/')

d_out = {'U_bal_mag' : prb.Ubmag,
         'H'         : prb.H,
         'adot'      : prb.adot,
         'S'         : prb.S,
         'slope'     : prb.slope,
         'residual'  : prb.residual}