Ejemplo n.º 1
0
S      = Function(Q)
B      = Function(Q)

File(in_dir + 'S_s.xml') >> S
File(in_dir + 'B_s.xml') >> B

adot_v = loadmat(in_dir + 'smb/smb.mat')
dbm.data['smb'] = adot_v['map_data']

adot = dbm.get_expression('smb', near=True)

config = default_config()
config['output_path']               = out_dir
config['balance_velocity']['kappa'] = 5.0
config['model_order']               = 'SSA'

model = model.Model(config)
model.set_mesh(mesh)
model.set_surface_and_bed(S, B)
model.initialize_variables()

#model.init_adot(in_dir + 'adot_s.xml')
model.init_adot(adot)

F = solvers.BalanceVelocitySolver(model, config)

F.solve()

#model.save_xml(model.Ubar, 'Ubar_5')

Ejemplo n.º 2
0
S = Function(Q)
B = Function(Q)

File(in_dir + 'S_s.xml') >> S
File(in_dir + 'B_s.xml') >> B

config = default_config()
config['output_path'] = out_dir
config['balance_velocity']['kappa'] = 5.0
config['model_order'] = 'SSA'

model = model.Model(config)
model.set_mesh(mesh)
model.set_surface_and_bed(S, B)
model.initialize_variables()

model.init_adot(in_dir + 'adot_s.xml')

F = solvers.BalanceVelocitySolver(model, config)

F.solve()

model.save_xml(model.Ubar, 'Ubar_5')

bedmap = DataFactory.get_bedmap1()
bm = DataInput(bedmap, gen_space=False)

do = DataOutput(out_dir)
do.write_matlab(bm, model.Ubar, 'Ubar_5', val=0.0)