Beispiel #1
0
           'adjoint' :
           { 
             'alpha'              : None,
             'beta'               : None,
             'max_fun'            : None,
             'objective_function' : 'logarithmic',
             'animate'            : False
           }}

model = src.model.Model()
model.set_geometry(Surface(), Bed())

nx = 20
ny = 20
nz = 5

model.generate_uniform_mesh(nx, ny, nz, xmin=0, xmax=L, ymin=0, ymax=L,
                            generate_pbcs = True)
model.set_parameters(src.physical_constants.IceParameters())
model.initialize_variables()
model.n = 1.0

T = src.solvers.TransientSolver(model, config)
T.solve()

File('./results/u.xml') << model.u
File('./results/v.xml') << model.v
File('./results/w.xml') << model.w
File('./results/S.xml') << model.S

src_directory = '../../../'
sys.path.append(src_directory)

import src.model

import pylab 
import dolfin
import pickle
from pylab import *

nx = 20
ny = 20
nz = 6

model = src.model.Model()
model.generate_uniform_mesh(nx,ny,nz,0,1,0,1,deform=False,generate_pbcs=True)

Q = model.Q
U_opt = dolfin.project(dolfin.as_vector([dolfin.Function(Q),dolfin.Function(Q),dolfin.Function(Q)]))
b_opt = dolfin.Function(Q)
n = len(b_opt.compute_vertex_values())

rcParams['text.usetex']=True
rcParams['font.size'] = 12
rcParams['font.family'] = 'serif'

Us = zeros((50,n))
betas = zeros((50,n))

fig,axs = subplots(2,1,sharex=True)
fig.set_size_inches(8,4)