Skip to content
Snippets Groups Projects

Bridge example

Merged Anne Poot requested to merge bridge-example into master
1 file
+ 15
7
Compare changes
  • Side-by-side
  • Inline
@@ -21,17 +21,17 @@ props_c['init']['mesh']['file'] = 'meshes/bridge-q4-r0.msh'
globdat_c = main.jive(props_c)
u_coarse = globdat_c['state0']
strain_xx_c = globdat_c['tables']['strain']['xx']
strain_yy_c = globdat_c['tables']['strain']['yy']
strain_c = np.append(strain_xx_c, strain_yy_c)
eps_xx_c = globdat_c['tables']['strain']['xx']
eps_yy_c = globdat_c['tables']['strain']['yy']
eps_c = np.append(eps_xx_c, eps_yy_c)
globdat = main.jive(props)
K = globdat['matrix0']
M = globdat['matrix2']
u = globdat['state0']
strain_xx = globdat['tables']['strain']['xx']
strain_yy = globdat['tables']['strain']['yy']
strain = np.append(strain_xx, strain_yy)
eps_xx = globdat['tables']['strain']['xx']
eps_yy = globdat['tables']['strain']['yy']
eps = np.append(eps_xx, eps_yy)
mean = globdat['gp']['mean']
u_prior = mean['prior']['state0']
@@ -56,6 +56,14 @@ samples_eps_yy_prior = samples['prior']['strain']['yy']
samples_eps_xx_post = samples['posterior']['strain']['xx']
samples_eps_yy_post = samples['posterior']['strain']['yy']
eps_xx_prior = np.mean(samples_eps_xx_prior, axis=1)
eps_yy_prior = np.mean(samples_eps_yy_prior, axis=1)
eps_xx_post = np.mean(samples_eps_xx_post, axis=1)
eps_yy_post = np.mean(samples_eps_yy_post, axis=1)
eps_prior = np.append(eps_xx_prior, eps_yy_prior)
eps_post = np.append(eps_xx_post, eps_yy_post)
std_eps_xx_prior = np.std(samples_eps_xx_prior, axis=1)
std_eps_yy_prior = np.std(samples_eps_yy_prior, axis=1)
std_eps_xx_post = np.std(samples_eps_xx_post, axis=1)
@@ -67,7 +75,7 @@ std_eps_post = np.append(std_eps_xx_post, std_eps_yy_post)
Phi = globdat['Phi']
err = abs(u - Phi @ u_coarse)
err_grad = abs(strain - Phi @ strain_c)
err_grad = abs(eps - Phi @ eps_c)
QuickViewer(u_post, globdat, title=r'Posterior mean diplacement ($\bar u$)')
Loading