From ec760808394694eb241039800c171ea9f50cdc72 Mon Sep 17 00:00:00 2001 From: jeremias Date: Fri, 28 May 2021 10:01:29 +0200 Subject: [PATCH] clean up --- kalman/graphics/figure2.py | 51 ++++++--- kalman/input_files/aorta.yaml | 117 +++++++++++--------- kalman/input_files/aorta_leo.yaml | 150 -------------------------- kalman/input_files/aorta_neumann.yaml | 129 ---------------------- 4 files changed, 105 insertions(+), 342 deletions(-) delete mode 100755 kalman/input_files/aorta_leo.yaml delete mode 100755 kalman/input_files/aorta_neumann.yaml diff --git a/kalman/graphics/figure2.py b/kalman/graphics/figure2.py index de42690..90e55d5 100644 --- a/kalman/graphics/figure2.py +++ b/kalman/graphics/figure2.py @@ -52,15 +52,41 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None): inputfile = yaml.full_load(file) - true_values = { - 3: 2400, - 4: 4200, - 5: 11000, - 6: 7800, - 2: 100 - } + #true_values = { + # 3: 3400, + # 4: 4200, + # 5: 11000, + # 6: 7800, + # 2: 100 + # } - + true_values = { + 3: 4800, + 4: 7020, + 5: 11520, + 6: 11520, + 2: 75 + } + + + + true_values_c = { + 3: 0.0008, + 4: 0.00034, + 5: 0.00034, + 6: 0.00034, + 2: 100 + } + + true_values_rp = { + 3: 10, + 4: 60, + 5: 220, + 6: 160, + 2: 100 + } + + current_val = [] labels = [] ids = [] @@ -75,10 +101,9 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None): labels.append('$R_' + str(bnd_c['id'])) elif 'dirichlet' in bnd_c['type']: - current_val.append(inputfile['boundary_conditions'][1]['parameters']['U']) + current_val.append(inputfile['boundary_conditions'][0]['parameters']['U']) ids.append(bnd_c['id']) - labels.append('U') - + labels.append('$U') dim = dat['theta'].shape[-1] fig1, axes = plt.subplots(1,1,figsize=(8,6)) @@ -107,10 +132,10 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None): for i in range(dim): true_level = np.log(true_values[ids[i]]/current_val[i])/np.log(2) - rec_value = np.round(2**theta[-1, i]*current_val[i],1) + rec_value = np.round(2**theta[-1, i]*current_val[i],2) cur_key = ids[i] - axes.plot(t, theta[:, i] + 1.5*i, '-', color=col_,label=legends_ + '= ' + str(rec_value) + '/' + str(true_values[cur_key]) + '$') + axes.plot(t, theta[:, i] + 1.5*i, '-', color=col_,label= legends_ + '= ' + str(rec_value) + '/' + str(true_values[cur_key]) + '$') axes.fill_between(t, theta[:, i] + 1.5*i - np.sqrt(P[:, i, i]), theta[:, i] + 1.5*i + np.sqrt(P[:, i, i]), alpha=0.3, color=col_) diff --git a/kalman/input_files/aorta.yaml b/kalman/input_files/aorta.yaml index e007e9c..9807f85 100755 --- a/kalman/input_files/aorta.yaml +++ b/kalman/input_files/aorta.yaml @@ -4,10 +4,11 @@ mesh: './meshes/coaortaH1.h5' fluid: density: 1.2 dynamic_viscosity: 0.035 - stokes: True + stokes: False + implicit_windkessel: True io: - write_path: 'results/aorta_1ms' + write_path: 'results/aorta25_zPb_3R' restart: path: '' # './projects/nse_coa3d/results/test_restart2/' time: 0 @@ -17,53 +18,67 @@ io: write_velocity: 'update' # update or tentative boundary_conditions: + - + id: 2 + type: 'dirichlet' + #value: ['0','0','-U*sin(DOLFIN_PI*t/Th)*(t<=Th) + (t<0.8)*(Th0.8) + (t<1.6)*(0.8+Th1.6) + (t<2.4)*(1.6+Th