def agu_convergence(): """ Mesh Refinement demonstration for 1/4 cylinder large domain mesh """ points = '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output_points.txt' outputs = [ '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/supercoarse/points.h5', '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/coarse/points.h5', '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/medium/points.h5', '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/fine/points.h5', '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/test/points.h5', '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/superfine/points.h5', ] #number of elements #supercoarse 40000/1000/1000 = 300360 #coarse 30000/1000/500 = 445841 #medium 25000/750/300 = 642087 #fine 20000/500/250 = 832400 #test? 30000/300/150 = 1170025 #superfine 10000/250/100 = 1955701 #max? 20000/250/50 = 2840658 #NOTE: Fialko max # elements=2.5mil nel = np.array([300360, 445841, 642087, 832400, 1170025, 1955701]) RMSE = [] for pointsh5 in outputs: x = np.sqrt(2) * 1e3 * np.loadtxt(points, usecols=[0]) y = np.zeros_like(x) params = dict(xoff=0, yoff=0, d=25e3, dP=50e6, a=2e3, mu=30e9, nu=0.25) # Superposition of inflation and deflation source ur1, uz1 = m.calc_mogi_dp(x, y, **params) ur2, uz2 = m.calc_mogi_dp(x, y, d=75e3, a=5e3, mu=30e9, dP=-10e6) ur = ur1 + ur2 uz = uz1 + uz2 x_fem, ur_fem, uz_fem = pp.extract_points(pointsh5) ur_fem[x >= 60000] = -ur_fem[x >= 60000] rmseR, rmseZ = calc_stats(x, ur, uz, ur_fem, uz_fem) RMSE.append(rmseR + rmseZ) RMSE = np.array(RMSE) plt.figure() plt.plot(nel / 10000, RMSE * 100, 'k.-', lw=2) plt.title('Benchmark Mesh Accuracy') plt.xlabel('# Elements [x1e4]') plt.ylabel('RMSE [mm]') plt.grid()
def agu_apmb_weakness(): """ Test different material properties of APMB layer in AGU mesh, comment outputs to select different material property settings """ points = '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output_points.txt' homogeneous = '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/medium/points.h5' outputs = [ #'/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/weak/points.h5', '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/weaker/points.h5', '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output/elastic/weakest/points.h5', ] xe, ure, uze = pp.extract_points(homogeneous) #ur_fem[xe >= 60000] = -ur_fem[xe >= 60000] #or limit view... normZ = uze.max() normR = ure.max() plt.figure() plt.plot(xe, uze / normZ, 'k-') plt.plot(xe, uze / normR, 'k--') Gs = np.array([30, 20, 10, 0.01]) colors = ['b', 'g', 'r'] for G, c, pointsh5 in zip(Gs, colors, outputs): x_fem, ur_fem, uz_fem = pp.extract_points(pointsh5) ur_fem[xe >= 60000] = -ur_fem[xe >= 60000] plt.plot(xe, uze / normZ, ls='-', color=c, label=G) plt.plot(xe, uze / normR, ls='--', color=c) plt.title('Buffering Effect of APMB') plt.xlabel('Radial Distance [km]') plt.ylabel('Normalized Displacement') plt.grid()
def mogi_LZ2003_layered(): """ Fully 3D model for investigating Uplift source in the mid-crust. Used to investigate layering proposed by Leidig & Zandt 2003, and seismic tomography from Matt Haney. Domain 150x100 (cylinder), depth=25km. NOTE: also a version of mesh that includes topography. """ #UTURNCU MESH surfaceh5 = '/home/scott/research/models/pylith/3d/uturuncu_layered/output/step01/surface.h5' pointsh5 = '/home/scott/research/models/pylith/3d/uturuncu_layered/output/step01/points.h5' points = '/home/scott/research/models/pylith/3d/uturuncu_layered/output_points.txt' #Get analytic solution #x = np.linspace(0,25e3,1e2) #y = np.zeros_like(x) x = 1e3 * np.loadtxt(points, usecols=[0]) y = np.zeros_like(x) params = dict( xoff=0.0, #-2150.0, yoff=0.0, #250.0, d=26e3, dP=33.0e6, a=2000.0, mu=30e9, nu=0.25) #ur,uz = m.calc_mogi_dp(x,y,d=4e3,dP=100e6,a=700,mu=30e9,nu=0.25) ur, uz = m.calc_mogi_dp(x, y, **params) # Get FEM solution #verts, data, tris = load_h5(surfaceh5) #X, R, Z = extract_profile_axisym(verts, data, elmtsize=500) x_fem, ur_fem, uz_fem = pp.extract_points(pointsh5) # Statistics & Graph calc_stats(x, ur, uz, ur_fem, uz_fem) plot_result(x, ur, uz, ur_fem, uz_fem, params)
def mogi_reservoir_depth(step, depth, dP): """ Show benchmark accuracy for variety of depths """ #UTURNCU MESH surfaceh5 = '/home/scott/research/models/pylith/3d/uturuncu_cylinder/output/step0{}/surface.h5'.format( step) pointsh5 = '/home/scott/research/models/pylith/3d/uturuncu_cylinder/output/step0{}/points.h5'.format( step) points = '/home/scott/research/models/pylith/3d/uturuncu_cylinder/output_points.txt' #Get analytic solution #x = np.linspace(0,25e3,1e2) #y = np.zeros_like(x) x = 1e3 * np.loadtxt(points, usecols=[0]) y = np.zeros_like(x) params = dict( xoff=0.0, #-2150.0, yoff=0.0, #250.0, d=depth, dP=dP, a=2000.0, mu=30e9, nu=0.25) #ur,uz = m.calc_mogi_dp(x,y,d=4e3,dP=100e6,a=700,mu=30e9,nu=0.25) ur, uz = m.calc_mogi_dp(x, y, **params) # Get FEM solution #verts, data, tris = load_h5(surfaceh5) #X, R, Z = extract_profile_axisym(verts, data, elmtsize=500) x_fem, ur_fem, uz_fem = pp.extract_points(pointsh5) # Statistics & Graph calc_stats(x, ur, uz, ur_fem, uz_fem) plot_result(x, ur, uz, ur_fem, uz_fem, params, plotcomp=True)