err_arr=np.array([[0.5967723905,0.4589340128,0.2529912857,2.016360934e-16],[0.03444765807,0.02755175037,0.01606591351,2.016360934e-16],\ [0.4163716944,0.2234622603,0.09915404499,2.016360934e-16],[0.3032028344,0.2234622603,0.1244506931,2.016360934e-16]]) ampd_err=np.array([[0.03398046218,0.2598977031,0.5944863376,1],[0.9952356331,0.9940539705,0.9958724535,1]\ ,[0.3256369889,0.6380761394,0.8394126754,1],[0.5094467491,0.6380761394,0.7992518172,1]]) # phase_err=np.array([[0.7575757576,0.7575757576,0.7575757576,0.7272727273],[0.7272727273,0.7575757576,0.7575757576,0.7272727273]\ # ,[0.7575757576,0.7575757576,0.7575757576,0.7272727273],[0.7575757576,0.7575757576,0.7575757576,0.7272727273]]) phase_err=np.array([[0.517131,0.513711,0.50793,0.484848],[0.491542,0.493249,0.496076,0.484848]\ ,[0.499999,0.5,0.500006,0.484848],[0.496603,0.5,0.511106,0.484848]]) N_itr = np.array([198, 99, 66, 49]) dx = 0.0303030303 phase_err *= 2 * np.pi for i in range(4): for j in range(4): phase_err[i, j] -= phase_err[i, 3] # phase_err-=dx*np.pi Plot.plot_err_norm(nu, err_arr, title_str, scheme_str, -0.03, 0.65) err_type = 'ampd' km = 2 * np.pi theta = km * dx plot_ana_ctrl = 1 # Plot.plot_ampd_phase_err(nu,theta,scheme_str,title_str,ampd_err,err_type,plot_ana_ctrl,0,1.05) Plot.plot_ampd_phase_err(nu, theta, scheme_str, title_str, ampd_err, err_type, plot_ana_ctrl, 0, 1.1, N_itr) err_type = 'phase' scheme_str = ['LF', 'LW', 'MD', 'UW1'] # Plot.plot_ampd_phase_err(nu,theta,scheme_str,title_str,phase_err,err_type,plot_ana_ctrl,-0.002,0.012) Plot.plot_ampd_phase_err(nu, theta, scheme_str, title_str, phase_err, err_type, plot_ana_ctrl, -0.05, 0.1, N_itr) plt.show()
mov_name='demo' fps=10 fine_fac=4 Plot.set_movie_para(mov_name,fps,fine_fac) Plot.set_var(x_name,t_out_name,u_num_name,u_exa_name) # Plot.read_raw_data() # Plot.gen_movie() scheme_str=['LF','LW','MD','UW1'] fd_name_base_o='shock_DN_F1' var_name='nu' var_str=['1','0p75','0p5','0p25'] var_val=[1,0.75,0.5,0.25] y_min=-0.1 y_max=1.3 for i in range(len(scheme_str)): fd_name_base=fd_name_base_o+'_'+scheme_str[i] Plot.plot_group_data(fd_name_base,var_name,var_str,var_val,y_min,y_max) nu=[0.25,0.5,0.75,1] title_str='shock Dirichlet and Neumann F1 flux when aT=1' err_arr = np.array([[0.04641024655,0.01648920167,0.003602943027,1e-10], [0.02066685788,0.008694746278,0.003020102171,1e-10], \ [0.01169086506,0.001564054043,5.464146928e-06,1e-10], [0.004017098275,0.001564054043,0.0001886489281,1e-10]]) log_scale_ctrl=1 Plot.plot_err_norm(nu,err_arr,title_str,scheme_str,1e-11,1,1) plt.show()
var_name = 'nu' var_str = ['1', '0p75', '0p5', '0p25'] var_val = [1, 0.75, 0.5, 0.25] y_min = -0.2 y_max = 1.2 for i in range(len(scheme_str)): fd_name_base = fd_name_base_o + '_' + scheme_str[i] Plot.plot_group_data(fd_name_base, var_name, var_str, var_val, y_min, y_max) nu = [0.25, 0.5, 0.75, 1] title_str = 'cosine periodic F2 flux' err_arr = np.array( [[0.05815778044, 0.05366503119, 0.04596604384, 0.03252356717]]) scheme_str = ['Flux 2'] Plot.plot_err_norm(nu, err_arr, title_str, scheme_str) ampd_err = np.array([[0.724997835, 0.7664966715, 0.8384281541, 1.007122486]]) phase_err = np.array( [[0.0, 0.030303030303030276, 0.030303030303030276, 0.030303030303030276]]) phase_err *= 2 * np.pi err_type = 'ampd' dx = 0.0303030303 km = np.pi / (2 * dx) theta = km * dx plot_ana_ctrl = 0 Plot.plot_ampd_phase_err(nu, theta, scheme_str, title_str, ampd_err, err_type, plot_ana_ctrl) err_type = 'phase' Plot.plot_ampd_phase_err(nu, theta, scheme_str, title_str, phase_err, err_type,