#dms.change_projection(dsr) dmg.change_projection(dsr) # get the expressions used by varglas : Thickness = dbm.get_spline_expression('H') Surface = dbm.get_spline_expression('h') Bed = dbm.get_spline_expression('b') SurfaceTemperature = dsr.get_spline_expression('T') BasalHeatFlux = dfm.get_spline_expression('q_geo') adot = dsr.get_spline_expression('adot') U_observed = dmg.get_spline_expression('v_mag') model = model.Model() model.set_geometry(Surface, Bed) model.set_mesh(mesh, flat_mesh=flat_mesh, deform=True) model.set_parameters(pc.IceParameters()) model.initialize_variables() # specifify non-linear solver parameters : nonlin_solver_params = default_nonlin_solver_params() nonlin_solver_params['newton_solver']['relaxation_parameter'] = 0.7 nonlin_solver_params['newton_solver']['relative_tolerance'] = 1e-3 nonlin_solver_params['newton_solver']['absolute_tolerance'] = 1e2 nonlin_solver_params['newton_solver']['maximum_iterations'] = 20 nonlin_solver_params['newton_solver']['error_on_nonconvergence'] = False nonlin_solver_params['newton_solver']['linear_solver'] = 'mumps' nonlin_solver_params['newton_solver']['preconditioner'] = 'default' parameters['form_compiler']['quadrature_degree'] = 2 config = { 'mode' : 'steady',
{ 'alpha' : None, 'beta' : None, 'max_fun' : None, 'objective_function' : 'logarithmic', 'animate' : False }} model = src.model.Model() model.set_geometry(Surface(), Bed()) mesh = MeshFactory.get_circle() flat_mesh = MeshFactory.get_circle() model.set_mesh(mesh, flat_mesh=flat_mesh, deform=True) model.mesh.coordinates()[:,2] = model.mesh.coordinates()[:,2]/1000.0 model.set_parameters(src.physical_constants.IceParameters()) model.initialize_variables() F = src.solvers.SteadySolver(model,config) F.solve() T = src.solvers.TransientSolver(model,config) T.solve() dolfin.File('./results/u.xml') << model.u dolfin.File('./results/v.xml') << model.v dolfin.File('./results/w.xml') << model.w dolfin.File('./results/S.xml') << model.S dolfin.File('./results/T.xml') << model.T
Thickness = dbm.get_spline_expression('H') Surface = dbm.get_spline_expression('h') Bed = dbm.get_spline_expression('b') SurfaceTemperature = dsr.get_spline_expression('T') #BasalHeatFlux = dsr.get_spline_expression('q_geo') BasalHeatFlux = dsq.get_spline_expression('q_geo') #BasalHeatFlux = dfm.get_spline_expression('q_geo') adot = dsr.get_spline_expression('adot') U_observed = dsr.get_spline_expression('U_ob') # inspect the data values : do = DataOutput('results_pre/') model = model.Model() model.set_geometry(Surface, Bed) model.set_mesh(mesh, flat_mesh=flat_mesh, deform=True) model.set_parameters(pc.IceParameters()) model.initialize_variables() #do.write_one_file('ff', model.ff) #do.write_one_file('h', dbm.get_projection('h')) #do.write_one_file('Ubmag_measures', dbv.get_projection('Ubmag_measures')) #do.write_one_file('sq_qgeo', dsq.get_projection('q_geo')) #do.write_one_file('sr_qgeo', dsr.get_projection('q_geo')) #exit(0) # specifify non-linear solver parameters : nonlin_solver_params = default_nonlin_solver_params() nonlin_solver_params['newton_solver']['relaxation_parameter'] = 0.7 nonlin_solver_params['newton_solver']['relative_tolerance'] = 1e-3 nonlin_solver_params['newton_solver']['absolute_tolerance'] = 1e2 nonlin_solver_params['newton_solver']['maximum_iterations'] = 20 nonlin_solver_params['newton_solver']['error_on_nonconvergence'] = False