From fda646ff333a95d23836c249a06d787d45f0adb2 Mon Sep 17 00:00:00 2001 From: Antoine Hoffmann <antoine.hoffmann@epfl.ch> Date: Mon, 7 Nov 2022 15:56:00 +0100 Subject: [PATCH] scripts save --- matlab/load/load_gene_data.m | 12 ++++++------ matlab/plot/spectrum_1D.m | 2 +- wk/CBC_nu_CO_scan.m | 26 +++++++++++++++++--------- wk/analysis_gene.m | 16 +++++++++------- wk/gene_data.FIGDIR | 0 wk/header_3D_results.m | 6 +++--- 6 files changed, 36 insertions(+), 26 deletions(-) create mode 100644 wk/gene_data.FIGDIR diff --git a/matlab/load/load_gene_data.m b/matlab/load/load_gene_data.m index 4ef290a3..af55df0c 100644 --- a/matlab/load/load_gene_data.m +++ b/matlab/load/load_gene_data.m @@ -48,14 +48,14 @@ for jt = 1:numel(DATA.Ts3D) t = DATA.Ts3D(jt); [~, it] = min(abs(DATA.Ts3D-t)); % -% tmp = h5read([folder,momfile],['/mom_ions/dens/',sprintf('%10.10d',it-1)]); -% DATA.DENS_I(:,:,:,it) = tmp.real + 1i*tmp.imaginary; + tmp = h5read([folder,momfile],['/mom_ions/dens/',sprintf('%10.10d',it-1)]); + DATA.DENS_I(:,:,:,it) = tmp.real + 1i*tmp.imaginary; % -% tmp = h5read([folder,momfile],['/mom_ions/T_par/',sprintf('%10.10d',it-1)]); -% DATA.TPAR_I(:,:,:,it) = tmp.real + 1i*tmp.imaginary; + tmp = h5read([folder,momfile],['/mom_ions/T_par/',sprintf('%10.10d',it-1)]); + DATA.TPAR_I(:,:,:,it) = tmp.real + 1i*tmp.imaginary; % -% tmp = h5read([folder,momfile],['/mom_ions/T_perp/',sprintf('%10.10d',it-1)]); -% DATA.TPER_I(:,:,:,it) = tmp.real + 1i*tmp.imaginary; + tmp = h5read([folder,momfile],['/mom_ions/T_perp/',sprintf('%10.10d',it-1)]); + DATA.TPER_I(:,:,:,it) = tmp.real + 1i*tmp.imaginary; tmp = h5read([folder,phifile],['/field/phi/',sprintf('%10.10d',it-1)]); DATA.PHI(:,:,:,it) = tmp.real + 1i*tmp.imaginary; diff --git a/matlab/plot/spectrum_1D.m b/matlab/plot/spectrum_1D.m index 7288fe17..6591df16 100644 --- a/matlab/plot/spectrum_1D.m +++ b/matlab/plot/spectrum_1D.m @@ -1,7 +1,7 @@ function [ FIGURE ] = spectrum_1D( data, options ) options.PLAN = 'kxky'; -options.COMP = 'avg'; +options.COMP = 1; options.INTERP = 0; options.POLARPLOT = 0; options.AXISEQUAL = 1; diff --git a/wk/CBC_nu_CO_scan.m b/wk/CBC_nu_CO_scan.m index 7f69c607..9a07ac6e 100644 --- a/wk/CBC_nu_CO_scan.m +++ b/wk/CBC_nu_CO_scan.m @@ -1,12 +1,15 @@ gyacomodir = '/home/ahoffman/gyacomo/'; -% EXECNAME = 'gyacomo_1.0'; +addpath(genpath([gyacomodir,'matlab'])) % ... add +addpath(genpath([gyacomodir,'matlab/plot'])) % ... add +addpath(genpath([gyacomodir,'matlab/compute'])) % ... add +addpath(genpath([gyacomodir,'matlab/load'])) % ... add% EXECNAME = 'gyacomo_1.0'; % EXECNAME = 'gyacomo_dbg'; EXECNAME = 'gyacomo'; %% NU_a = [0.005 0.01:0.01:0.1]; % P_a = [2 4 6 8 10 12 16]; -% NU_a = 0.05; -P_a = [10]; +% NU_a = 0.1; +P_a = [2 4 8 10 12 16 20]; CO = 'SG'; @@ -19,7 +22,7 @@ kymin = 0.05; Ny = 40; SIMID = 'linear_CBC_nu+PJ_scan_kT_6.96_SGGK'; % Name of the simulation % SIMID = 'linear_CBC_nu_scan_kT_11_ky_0.3_DGGK'; % Name of the simulation -RUN = 1; +RUN = 0; g_ky = zeros(numel(NU_a),numel(P_a),Ny/2); g_avg= g_ky*0; @@ -56,7 +59,7 @@ for NU = NU_a ZETA = 0.0; % squareness NEXC = 1; % To extend Lx if needed (Lx = Nexc/(kymin*shear)) EPS = 0.18; % inverse aspect ratio - SPS0D = 1; SPS2D = 0; SPS3D = 1;SPS5D= 1/5; SPSCP = 0; + SPS0D = 1; SPS2D = -1; SPS3D = 1;SPS5D= 1/5; SPSCP = 0; JOB2LOAD= -1; LINEARITY = 'linear'; % activate non-linearity (is cancelled if KXEQ0 = 1) GKCO = 1; % gyrokinetic operator @@ -65,7 +68,7 @@ for NU = NU_a CLOS = 0; % Closure model (0: =0 truncation, 1: v^Nmax closure (p+2j<=Pmax))s NL_CLOS = 0; % nonlinear closure model (-2:nmax=jmax; -1:nmax=jmax-j; >=0:nmax=NL_CLOS) KERN = 0; % Kernel model (0 : GK) - INIT_OPT= 'phi'; % Start simulation with a noisy mom00/phi/allmom + INIT_OPT= 'mom00'; % Start simulation with a noisy mom00/phi/allmom W_DOUBLE = 1; W_GAMMA = 1; W_HF = 1; W_PHI = 1; W_NA00 = 1; @@ -86,6 +89,7 @@ for NU = NU_a setup if RUN system(['cd ../results/',SIMID,'/',PARAMS,'/; mpirun -np 6 ',gyacomodir,'bin/',EXECNAME,' 2 3 1 0; cd ../../../wk']) +% system(['cd ../results/',SIMID,'/',PARAMS,'/; mpirun -np 1 ',gyacomodir,'bin/',EXECNAME,' 1 1 1 0; cd ../../../wk']) end % Load results @@ -130,24 +134,28 @@ for i = 1:numel(idx_) e_ = g_std(:,:,idx_(i)); end +colors_ = summer(numel(NU_a)); subplot(121) for i = 1:numel(NU_a) errorbar(P_a,y_(i,:),e_(i,:),... 'LineWidth',1.2,... - 'DisplayName',['$\nu=$',num2str(NU_a(i))]); + 'DisplayName',['$\nu=$',num2str(NU_a(i))],... + 'color',colors_(i,:)); hold on; end title(['$\kappa_T=$',num2str(K_Ti),' $k_y=k_y^{max}$']); legend('show'); xlabel('$P$, $J=P/2$'); ylabel('$\gamma$'); +colors_ = jet(numel(P_a)); subplot(122) for j = 1:numel(P_a) errorbar(NU_a,y_(:,j),e_(:,j),... 'LineWidth',1.2,... - 'DisplayName',['(',num2str(P_a(j)),',',num2str(P_a(j)/2),')']); + 'DisplayName',['(',num2str(P_a(j)),',',num2str(P_a(j)/2),')'],... + 'color',colors_(j,:)); hold on; end -title(['$\kappa_T=$',num2str(K_Ti),' $k_y=$',num2str(data.ky(idx_))]); +title(['$\kappa_T=$',num2str(K_Ti),' $k_y=k_y^{max}$']); legend('show'); xlabel(['$\nu_{',CO,'}$']); ylabel('$\gamma$'); end diff --git a/wk/analysis_gene.m b/wk/analysis_gene.m index a35d30f9..48a6d160 100644 --- a/wk/analysis_gene.m +++ b/wk/analysis_gene.m @@ -13,15 +13,15 @@ addpath(genpath([gyacomodir,'matlab/load'])) % ... add % folder = '/misc/gene_results/shearless_cyclone/LD_s_alpha_output_1.0/'; % folder = '/misc/gene_results/shearless_cyclone/LD_s_alpha_output_0.8/'; % folder = '/misc/gene_results/Z-pinch/HP_fig_2a_mu_1e-2/'; -folder = '/misc/gene_results/Z-pinch/HP_fig_2b_mu_5e-2/'; +% folder = '/misc/gene_results/Z-pinch/HP_fig_2b_mu_5e-2/'; % folder = '/misc/gene_results/Z-pinch/HP_fig_2c_mu_5e-2/'; % folder = '/misc/gene_results/LD_zpinch_1.6/'; % folder = '/misc/gene_results/ZP_HP_kn_1.6_nuv_3.2/'; % folder = '/misc/gene_results/ZP_HP_kn_1.6_nuv_3.2/'; % folder = '/misc/gene_results/Z-pinch/ZP_HP_kn_1.6_HRES/'; % folder = '/misc/gene_results/ZP_kn_2.5_large_box/'; -% folder = '/misc/gene_results/Z-pinch/kN_2.0_HD_transport_spectrum_00/'; -% folder = '/misc/gene_results/Z-pinch/kN_2.5_HD_transport_spectrum_00/'; +folder = '/misc/gene_results/Z-pinch/kN_2.0_HD_transport_spectrum_01/'; +% folder = '/misc/gene_results/Z-pinch/kN_2.5_HD_transport_spectrum_01/'; % folder = '/misc/gene_results/CBC/128x64x16x24x12/'; % folder = '/misc/gene_results/CBC/196x96x20x32x16_02/'; @@ -43,6 +43,7 @@ options.NMVA = 1; % Moving average for time traces options.ST_FIELD = '\phi'; % chose your field to plot in spacetime diag (e.g \phi,v_x,G_x, Q_x) options.INTERP = 1; options.NCUT = 4; % Number of cuts for averaging and error estimation +options.RESOLUTION = 256; gene_data.FIGDIR = folder; fig = plot_radial_transport_and_spacetime(gene_data,options); save_figure(gene_data,fig,'.png') @@ -80,15 +81,16 @@ if 0 % Options options.INTERP = 1; options.POLARPLOT = 0; -options.NAME = '\phi'; +% options.NAME = '\phi'; % options.NAME = 'v_y'; % options.NAME = '\Gamma_x'; -% options.NAME = 'n_i'; -options.PLAN = 'kxky'; +options.NAME = 'n_i'; +options.PLAN = 'xy'; % options.NAME = 'f_e'; % options.PLAN = 'sx'; options.COMP = 'avg'; options.TIME = gene_data.Ts3D; +options.RESOLUTION= 256; gene_data.a = data.EPS * 2000; create_film(gene_data,options,'.gif') end @@ -134,7 +136,7 @@ end if 0 %% Time averaged spectrum -options.TIME = [60 10000]; +options.TIME = [600 5000]; options.NORM =1; % options.NAME = '\phi'; % options.NAME = 'n_i'; diff --git a/wk/gene_data.FIGDIR b/wk/gene_data.FIGDIR new file mode 100644 index 00000000..e69de29b diff --git a/wk/header_3D_results.m b/wk/header_3D_results.m index 63cb0bf3..8a872def 100644 --- a/wk/header_3D_results.m +++ b/wk/header_3D_results.m @@ -35,7 +35,7 @@ gyacomodir = '/home/ahoffman/gyacomo/'; % resdir = 'CBC/96x96x16x3x2_Nexc_6'; % resdir = 'CBC/128x96x16x3x2'; % resdir = 'CBC/192x96x16x3x2'; -% resdir = 'CBC/192x96x24x13x7'; +resdir = 'CBC/192x96x24x13x7'; % resdir = 'CBC/kT_11_128x64x16x5x3'; % resdir = 'CBC/kT_9_256x128x16x3x2'; % resdir = 'CBC/kT_4.5_128x64x16x13x3'; @@ -60,7 +60,7 @@ gyacomodir = '/home/ahoffman/gyacomo/'; %% Linear CBC % resdir = 'linear_CBC/20x2x32_21x11_Lx_62.8319_Ly_31.4159_q0_1.4_e_0.18_s_0.8_kN_2.22_kT_5.3_nu_1e-02_DGDK_adiabe'; % resdir = 'testcases/miller_example'; -resdir = 'Miller/128x256x3x2_CBC_dt_5e-3'; -% resdir = ['results/',resdir]; +% resdir = 'Miller/128x256x3x2_CBC_dt_5e-3'; +resdir = ['results/',resdir]; JOBNUMMIN = 00; JOBNUMMAX = 10; run analysis_gyacomo -- GitLab