From 1315f97a27f2187a675a7202216dfdbe13b5ecb3 Mon Sep 17 00:00:00 2001 From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch> Date: Mon, 2 Nov 2020 14:33:07 +0100 Subject: [PATCH] minor changes --- .gitignore | 1 + matlab/create_gif.m | 2 +- matlab/create_gif_3D.m | 1 - matlab/default_plots_options.m | 3 ++- matlab/save_figure.m | 9 ++++++--- wk/analysis_2D.m | 3 ++- wk/fort.90 | 10 +++++----- wk/load_results.m | 3 ++- wk/parameters_ZP.m | 7 +++---- 9 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 491f19f9..0b32f91f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ *.h5 *.o *.a +*.png logs/ results/ results_old/ diff --git a/matlab/create_gif.m b/matlab/create_gif.m index 826ea6de..f2445a7f 100644 --- a/matlab/create_gif.m +++ b/matlab/create_gif.m @@ -13,7 +13,7 @@ else % Setup figure frame fig = figure('Color','white','Position', [100, 100, 400, 400]); pcolor(X,Y,FIELD(:,:,1)); % to set up - colormap jet + colormap gray axis tight manual % this ensures that getframe() returns a consistent size if INTERP shading interp; diff --git a/matlab/create_gif_3D.m b/matlab/create_gif_3D.m index 188349db..646080fc 100644 --- a/matlab/create_gif_3D.m +++ b/matlab/create_gif_3D.m @@ -10,7 +10,6 @@ fig = figure('Color','white','Position', [100, 100, 400, 400]); scale_z = max(abs(plt(Z(:,:,1)))); plot3(plt(X)/scale_x,plt(Y)/scale_y,plt(Z)/scale_z,'.k','MarkerSize',MARKERSIZE); view(VIEW); - colormap jet axis tight manual % this ensures that getframe() returns a consistent size in = 1; nbytes = fprintf(2,'frame %d/%d',in,numel(FRAMES)); diff --git a/matlab/default_plots_options.m b/matlab/default_plots_options.m index ed53cc03..56e500d3 100644 --- a/matlab/default_plots_options.m +++ b/matlab/default_plots_options.m @@ -6,4 +6,5 @@ set(0,'defaultAxesFontSize',16) set(0, 'DefaultLineLineWidth', 2.0); line_colors = [[0, 0.4470, 0.7410];[0.8500, 0.3250, 0.0980];[0.9290, 0.6940, 0.1250];... [0.4940, 0.1840, 0.5560];[0.4660, 0.6740, 0.1880];[0.3010, 0.7450, 0.9330];[0.6350, 0.0780, 0.1840]]; -line_styles = {'-','-.','--',':'}; \ No newline at end of file +line_styles = {'-','-.','--',':'}; +marker_styles = {'^','v','o','s'}; \ No newline at end of file diff --git a/matlab/save_figure.m b/matlab/save_figure.m index e71ee646..c5a9c72c 100644 --- a/matlab/save_figure.m +++ b/matlab/save_figure.m @@ -1,5 +1,8 @@ %% Auxiliary script to save figure using a dir (FIGDIR), name (FIGNAME) % and parameters -FIGNAME = [BASIC.RESDIR, FIGNAME,FMT]; -saveas(fig,FIGNAME); -disp(['Figure saved @ : ',FIGNAME]) \ No newline at end of file +if ~exist([BASIC.RESDIR,'/fig'], 'dir') + mkdir([BASIC.RESDIR,'/fig']) +end +saveas(fig,[BASIC.RESDIR,'/fig/', FIGNAME,'.fig']); +saveas(fig,[BASIC.RESDIR, FIGNAME,'.png']); +disp(['Figure saved @ : ',[BASIC.RESDIR, FIGNAME,'.png']]) \ No newline at end of file diff --git a/wk/analysis_2D.m b/wk/analysis_2D.m index 1ffdb66d..6c739bb4 100644 --- a/wk/analysis_2D.m +++ b/wk/analysis_2D.m @@ -1,4 +1,5 @@ %% Load results +% JOBNUM = 0; load_results; compile_results %% Retrieving max polynomial degree and sampling info @@ -165,7 +166,7 @@ save_figure %% if 1 %% Show frame in real space -tf = 100; [~,it] = min(abs(Ts2D-tf)); [~,it5D] = min(abs(Ts5D-tf)); +tf = 1000; [~,it] = min(abs(Ts2D-tf)); [~,it5D] = min(abs(Ts5D-tf)); fig = figure; FIGNAME = ['rz_frame',sprintf('_%.2d',JOBNUM)]; subplot(221); plt = @(x) (((x))); pclr = pcolor((RR),(ZZ),plt(ne00(:,:,it))); set(pclr, 'edgecolor','none'); colorbar; diff --git a/wk/fort.90 b/wk/fort.90 index c849db79..f684ea3e 100644 --- a/wk/fort.90 +++ b/wk/fort.90 @@ -1,7 +1,7 @@ &BASIC nrun = 100000000 dt = 0.01 - tmax = 200 + tmax = 300 RESTART = .false. / &GRID @@ -25,9 +25,9 @@ write_phi = .true. write_non_lin = .true. write_doubleprecision = .true. - resfile0 = '../results/ZP/256x128_L_66_Pe_2_Je_1_Pi_2_Ji_1_nB_0.5_nN_1_nu_1e-02_DG_mu_5e-04/outputs' - rstfile0 = '../results/ZP/256x128_L_66_Pe_2_Je_1_Pi_2_Ji_1_nB_0.5_nN_1_nu_1e-02_DG_mu_5e-04/checkpoint' - job2load = 1 + resfile0 = '../results/ZP/256x128_L_66_Pe_2_Je_1_Pi_2_Ji_1_nB_0.4_nN_1_nu_1e-02_DG_mu_5e-04/outputs' + rstfile0 = '../results/ZP/256x128_L_66_Pe_2_Je_1_Pi_2_Ji_1_nB_0.4_nN_1_nu_1e-02_DG_mu_5e-04/checkpoint' + job2load = 0 / &MODEL_PAR ! Collisionality @@ -44,7 +44,7 @@ q_i = 1 eta_n = 1 eta_T = 0 - eta_B = 0.5 + eta_B = 0.4 lambdaD = 0 kr0KH = 0 A0KH = 0 diff --git a/wk/load_results.m b/wk/load_results.m index 5fccf08e..43bdbdeb 100644 --- a/wk/load_results.m +++ b/wk/load_results.m @@ -2,7 +2,8 @@ filename = sprintf([BASIC.RESDIR,'outputs_%.2d.h5'],JOBNUM); disp(['Loading ',filename]) % Loading from output file -% CPUTIME = h5readatt(filename,'/data/input','cpu_time'); +CPUTIME = h5readatt(filename,'/data/input','cpu_time'); +DT_SIM = h5readatt(filename,'/data/input','dt'); if strcmp(OUTPUTS.write_moments,'.true.') [Nipj, Pi, Ji, kr, kz, Ts5D, dt5D] = load_5D_data(filename, 'moments_i'); [Nepj, Pe, Je ] = load_5D_data(filename, 'moments_e'); diff --git a/wk/parameters_ZP.m b/wk/parameters_ZP.m index 4033fbd2..4339223c 100644 --- a/wk/parameters_ZP.m +++ b/wk/parameters_ZP.m @@ -1,13 +1,12 @@ clear all; addpath(genpath('../matlab')) % ... add -default_plots_options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Set Up parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% PHYSICAL PARAMETERS NU = 1e-2; % Collision frequency TAU = 1.0; % e/i temperature ratio -ETAB = 0.5; % Magnetic gradient +ETAB = 0.4; % Magnetic gradient ETAN = 1.0; % Density gradient ETAT = 0.0; % Temperature gradient MU = 5e-4; % Hyper diffusivity coefficient @@ -20,12 +19,12 @@ JMAXE = 1; % Highest '' Laguerre '' PMAXI = 2; % Highest ion Hermite polynomial degree JMAXI = 1; % Highest '' Laguerre '' %% TIME PARAMETERS -TMAX = 200; % Maximal time unit +TMAX = 300; % Maximal time unit DT = 1e-2; % Time step SPS2D = 2; % Sampling per time unit for 2D arrays SPS5D = 0.1; % Sampling per time unit for 5D arrays RESTART = 0; % To restart from last checkpoint -JOB2LOAD= 01; +JOB2LOAD= 0; %% OPTIONS SIMID = 'ZP'; % Name of the simulation CO = -2; % Collision operator (0 : L.Bernstein, -1 : Full Coulomb, -2 : Dougherty) -- GitLab