From 507e9cf9419b9dcb08b65a991d86fca02bc570b3 Mon Sep 17 00:00:00 2001 From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch> Date: Mon, 2 May 2022 14:55:46 +0200 Subject: [PATCH] Scripts adaptations --- matlab/compute/ifourier_GENE.m | 10 +++++----- matlab/plot/plot_radial_transport_and_spacetime.m | 6 +++--- matlab/process_field.m | 14 +++++++------- src/srcinfo.h | 4 ++-- src/srcinfo/srcinfo.h | 4 ++-- wk/analysis_3D.m | 8 ++++---- wk/analysis_header.m | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/matlab/compute/ifourier_GENE.m b/matlab/compute/ifourier_GENE.m index df01e5fd..3c3a454a 100644 --- a/matlab/compute/ifourier_GENE.m +++ b/matlab/compute/ifourier_GENE.m @@ -5,16 +5,16 @@ function [ field_r ] = ifourier_GENE( field_c ) % comparison purpose. %% Original -[nx,nky,nz]=size(field_c); +[nky,nx,nz]=size(field_c); %extend to whole ky by imposing reality condition ny=2*nky-1; if ny~=1 %note, we need one extra point which we set to zero for the ifft - spectrumKxKyZ=zeros(nx,ny,nz); - spectrumKxKyZ(:,1:nky,:)=field_c(:,:,:); - spectrumKxKyZ(1,(nky+1):(ny),:)=conj(field_c(1,nky:-1:2,:)); - spectrumKxKyZ(2:nx,(nky+1):(ny),:)=conj(field_c(nx:-1:2,nky:-1:2,:)); + spectrumKxKyZ=zeros(ny,nx,nz); + spectrumKxKyZ(1:nky,:,:)=field_c(:,:,:); + spectrumKxKyZ((nky+1):(ny),1,:)=conj(field_c(nky:-1:2,1,:)); + spectrumKxKyZ((nky+1):(ny),2:nx,:)=conj(field_c(nky:-1:2,nx:-1:2,:)); else %pad with zeros to interpolate on fine scale ny=20; diff --git a/matlab/plot/plot_radial_transport_and_spacetime.m b/matlab/plot/plot_radial_transport_and_spacetime.m index 6e5444cd..1957f424 100644 --- a/matlab/plot/plot_radial_transport_and_spacetime.m +++ b/matlab/plot/plot_radial_transport_and_spacetime.m @@ -26,7 +26,7 @@ function [FIGURE] = plot_radial_transport_and_spacetime(DATA, TAVG_0, TAVG_1,stf end Gx_t_mtlb = squeeze(mean(mean(Gx,1),2)); % Compute Heat flux from ifft matlab - Qx = zeros(DATA.Nx,DATA.Ny,numel(DATA.Ts3D)); + Qx = zeros(DATA.Ny,DATA.Nx,numel(DATA.Ts3D)); for it = 1:numel(DATA.Ts3D) for iz = 1:DATA.Nz Qx(:,:,it) = Qx(:,:,it) + ifourier_GENE(-1i*KY.*(DATA.PHI(:,:,iz,it)))... @@ -71,7 +71,7 @@ mvm = @(x) movmean(x,Nmvm); % computation Ns3D = numel(DATA.Ts3D); [KY, KX] = meshgrid(DATA.ky, DATA.kx); - plt = @(x) mean(x(:,:,1,:),2); + plt = @(x) mean(x(:,:,1,:),1); kycut = max(DATA.ky); kxcut = max(DATA.kx); LP = (abs(KY)<kycut).*(abs(KX)<kxcut); %Low pass filter @@ -87,7 +87,7 @@ mvm = @(x) movmean(x,Nmvm); end switch stfname case 'phi' - phi = zeros(DATA.Nx,DATA.Ny,1,Ns3D); + phi = zeros(DATA.Ny,DATA.Nx,1,Ns3D); for it = 1:numel(DATA.Ts3D) phi(:,:,1,it) = ifourier_GENE(compz(DATA.PHI(:,:,:,it))); end diff --git a/matlab/process_field.m b/matlab/process_field.m index 5762fc84..5258ef7c 100644 --- a/matlab/process_field.m +++ b/matlab/process_field.m @@ -17,28 +17,28 @@ LTXNAME = OPTIONS.NAME; switch OPTIONS.PLAN case 'xy' XNAME = '$x$'; YNAME = '$y$'; - [Y,X] = meshgrid(DATA.y,DATA.x); + [X,Y] = meshgrid(DATA.x,DATA.y); REALP = 1; COMPDIM = 3; POLARPLOT = 0; SCALE = 1; case 'xz' XNAME = '$x$'; YNAME = '$z$'; [Y,X] = meshgrid(DATA.z,DATA.x); - REALP = 1; COMPDIM = 2; SCALE = 0; + REALP = 1; COMPDIM = 1; SCALE = 0; case 'yz' XNAME = '$y$'; YNAME = '$z$'; [Y,X] = meshgrid(DATA.z,DATA.y); - REALP = 1; COMPDIM = 1; SCALE = 0; + REALP = 1; COMPDIM = 2; SCALE = 0; case 'kxky' XNAME = '$k_x$'; YNAME = '$k_y$'; - [Y,X] = meshgrid(DATA.ky,DATA.kx); + [X,Y] = meshgrid(DATA.kx,DATA.ky); REALP = 0; COMPDIM = 3; POLARPLOT = 0; SCALE = 1; case 'kxz' XNAME = '$k_x$'; YNAME = '$z$'; [Y,X] = meshgrid(DATA.z,DATA.kx); - REALP = 0; COMPDIM = 2; POLARPLOT = 0; SCALE = 0; + REALP = 0; COMPDIM = 1; POLARPLOT = 0; SCALE = 0; case 'kyz' XNAME = '$k_y$'; YNAME = '$z$'; [Y,X] = meshgrid(DATA.z,DATA.ky); - REALP = 0; COMPDIM = 1; POLARPLOT = 0; SCALE = 0; + REALP = 0; COMPDIM = 2; POLARPLOT = 0; SCALE = 0; case 'sx' XNAME = '$v_\parallel$'; YNAME = '$\mu$'; [Y,X] = meshgrid(OPTIONS.XPERP,OPTIONS.SPAR); @@ -110,7 +110,7 @@ end switch REALP case 1 % Real space plot INTERP = OPTIONS.INTERP; - process = @(x) real(fftshift(ifft2(x,Nx,Ny))); + process = @(x) real(fftshift(ifft2(x,Ny,Nx))); shift_x = @(x) x; shift_y = @(x) x; case 0 % Frequencies plot diff --git a/src/srcinfo.h b/src/srcinfo.h index 690578d0..b8301335 100644 --- a/src/srcinfo.h +++ b/src/srcinfo.h @@ -3,8 +3,8 @@ character(len=40) BRANCH character(len=20) AUTHOR character(len=40) EXECDATE character(len=40) HOST -parameter (VERSION='e4c9228-dirty') +parameter (VERSION='38a4f6e-dirty') parameter (BRANCH='kx_pos_plane') parameter (AUTHOR='ahoffman') -parameter (EXECDATE='Mon May 2 09:30:54 CEST 2022') +parameter (EXECDATE='Mon May 2 14:23:17 CEST 2022') parameter (HOST ='spcpc606') diff --git a/src/srcinfo/srcinfo.h b/src/srcinfo/srcinfo.h index 690578d0..b8301335 100644 --- a/src/srcinfo/srcinfo.h +++ b/src/srcinfo/srcinfo.h @@ -3,8 +3,8 @@ character(len=40) BRANCH character(len=20) AUTHOR character(len=40) EXECDATE character(len=40) HOST -parameter (VERSION='e4c9228-dirty') +parameter (VERSION='38a4f6e-dirty') parameter (BRANCH='kx_pos_plane') parameter (AUTHOR='ahoffman') -parameter (EXECDATE='Mon May 2 09:30:54 CEST 2022') +parameter (EXECDATE='Mon May 2 14:23:17 CEST 2022') parameter (HOST ='spcpc606') diff --git a/wk/analysis_3D.m b/wk/analysis_3D.m index a0c6cd14..a96dc881 100644 --- a/wk/analysis_3D.m +++ b/wk/analysis_3D.m @@ -39,18 +39,18 @@ if 0 % Options options.INTERP = 1; options.POLARPLOT = 0; -options.NAME = '\phi'; -% options.NAME = 'N_i^{00}'; +% options.NAME = '\phi'; +options.NAME = 'N_i^{00}'; % options.NAME = 'v_y'; % options.NAME = 'n_i^{NZ}'; % options.NAME = '\Gamma_x'; % options.NAME = 'n_i'; -options.PLAN = 'kxky'; +options.PLAN = 'xy'; % options.NAME = 'f_e'; % options.PLAN = 'sx'; options.COMP = 'avg'; % options.TIME = dat.Ts5D; -options.TIME = 0:0.1:10; +options.TIME = 0:1:100; data.EPS = 0.1; data.a = data.EPS * 2000; create_film(data,options,'.gif') diff --git a/wk/analysis_header.m b/wk/analysis_header.m index afc69d88..98f1b8b7 100644 --- a/wk/analysis_header.m +++ b/wk/analysis_header.m @@ -3,7 +3,7 @@ helazdir = '/home/ahoffman/HeLaZ/'; % Directory of the simulation % if 1% Local results outfile =''; -outfile ='quick_run/1x32_5x3_L_120_kN_2_kT_0.5_nu_1e-01_DGGK'; +outfile ='quick_run/64x64_5x3_L_120_kN_2.0_kT_0.5_nu_1e-01_SGGK'; % outfile ='pedestal/64x64x16x2x1_L_300_LnT_20_nu_0.1'; % outfile ='quick_run/32x32x16_5x3_L_300_q0_2.5_e_0.18_kN_20_kT_20_nu_1e-01_DGGK'; % outfile ='shearless_cyclone/128x128x16x4x2_L_120_CTC_1.0/'; -- GitLab