Skip to content
Snippets Groups Projects
Commit 507e9cf9 authored by Antoine Cyril David Hoffmann's avatar Antoine Cyril David Hoffmann
Browse files

Scripts adaptations

parent 38a4f6e3
No related branches found
No related tags found
No related merge requests found
...@@ -5,16 +5,16 @@ function [ field_r ] = ifourier_GENE( field_c ) ...@@ -5,16 +5,16 @@ function [ field_r ] = ifourier_GENE( field_c )
% comparison purpose. % comparison purpose.
%% Original %% Original
[nx,nky,nz]=size(field_c); [nky,nx,nz]=size(field_c);
%extend to whole ky by imposing reality condition %extend to whole ky by imposing reality condition
ny=2*nky-1; ny=2*nky-1;
if ny~=1 if ny~=1
%note, we need one extra point which we set to zero for the ifft %note, we need one extra point which we set to zero for the ifft
spectrumKxKyZ=zeros(nx,ny,nz); spectrumKxKyZ=zeros(ny,nx,nz);
spectrumKxKyZ(:,1:nky,:)=field_c(:,:,:); spectrumKxKyZ(1:nky,:,:)=field_c(:,:,:);
spectrumKxKyZ(1,(nky+1):(ny),:)=conj(field_c(1,nky:-1:2,:)); spectrumKxKyZ((nky+1):(ny),1,:)=conj(field_c(nky:-1:2,1,:));
spectrumKxKyZ(2:nx,(nky+1):(ny),:)=conj(field_c(nx:-1:2,nky:-1:2,:)); spectrumKxKyZ((nky+1):(ny),2:nx,:)=conj(field_c(nky:-1:2,nx:-1:2,:));
else else
%pad with zeros to interpolate on fine scale %pad with zeros to interpolate on fine scale
ny=20; ny=20;
......
...@@ -26,7 +26,7 @@ function [FIGURE] = plot_radial_transport_and_spacetime(DATA, TAVG_0, TAVG_1,stf ...@@ -26,7 +26,7 @@ function [FIGURE] = plot_radial_transport_and_spacetime(DATA, TAVG_0, TAVG_1,stf
end end
Gx_t_mtlb = squeeze(mean(mean(Gx,1),2)); Gx_t_mtlb = squeeze(mean(mean(Gx,1),2));
% Compute Heat flux from ifft matlab % 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 it = 1:numel(DATA.Ts3D)
for iz = 1:DATA.Nz for iz = 1:DATA.Nz
Qx(:,:,it) = Qx(:,:,it) + ifourier_GENE(-1i*KY.*(DATA.PHI(:,:,iz,it)))... Qx(:,:,it) = Qx(:,:,it) + ifourier_GENE(-1i*KY.*(DATA.PHI(:,:,iz,it)))...
...@@ -71,7 +71,7 @@ mvm = @(x) movmean(x,Nmvm); ...@@ -71,7 +71,7 @@ mvm = @(x) movmean(x,Nmvm);
% computation % computation
Ns3D = numel(DATA.Ts3D); Ns3D = numel(DATA.Ts3D);
[KY, KX] = meshgrid(DATA.ky, DATA.kx); [KY, KX] = meshgrid(DATA.ky, DATA.kx);
plt = @(x) mean(x(:,:,1,:),2); plt = @(x) mean(x(:,:,1,:),1);
kycut = max(DATA.ky); kycut = max(DATA.ky);
kxcut = max(DATA.kx); kxcut = max(DATA.kx);
LP = (abs(KY)<kycut).*(abs(KX)<kxcut); %Low pass filter LP = (abs(KY)<kycut).*(abs(KX)<kxcut); %Low pass filter
...@@ -87,7 +87,7 @@ mvm = @(x) movmean(x,Nmvm); ...@@ -87,7 +87,7 @@ mvm = @(x) movmean(x,Nmvm);
end end
switch stfname switch stfname
case 'phi' case 'phi'
phi = zeros(DATA.Nx,DATA.Ny,1,Ns3D); phi = zeros(DATA.Ny,DATA.Nx,1,Ns3D);
for it = 1:numel(DATA.Ts3D) for it = 1:numel(DATA.Ts3D)
phi(:,:,1,it) = ifourier_GENE(compz(DATA.PHI(:,:,:,it))); phi(:,:,1,it) = ifourier_GENE(compz(DATA.PHI(:,:,:,it)));
end end
......
...@@ -17,28 +17,28 @@ LTXNAME = OPTIONS.NAME; ...@@ -17,28 +17,28 @@ LTXNAME = OPTIONS.NAME;
switch OPTIONS.PLAN switch OPTIONS.PLAN
case 'xy' case 'xy'
XNAME = '$x$'; YNAME = '$y$'; 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; REALP = 1; COMPDIM = 3; POLARPLOT = 0; SCALE = 1;
case 'xz' case 'xz'
XNAME = '$x$'; YNAME = '$z$'; XNAME = '$x$'; YNAME = '$z$';
[Y,X] = meshgrid(DATA.z,DATA.x); [Y,X] = meshgrid(DATA.z,DATA.x);
REALP = 1; COMPDIM = 2; SCALE = 0; REALP = 1; COMPDIM = 1; SCALE = 0;
case 'yz' case 'yz'
XNAME = '$y$'; YNAME = '$z$'; XNAME = '$y$'; YNAME = '$z$';
[Y,X] = meshgrid(DATA.z,DATA.y); [Y,X] = meshgrid(DATA.z,DATA.y);
REALP = 1; COMPDIM = 1; SCALE = 0; REALP = 1; COMPDIM = 2; SCALE = 0;
case 'kxky' case 'kxky'
XNAME = '$k_x$'; YNAME = '$k_y$'; 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; REALP = 0; COMPDIM = 3; POLARPLOT = 0; SCALE = 1;
case 'kxz' case 'kxz'
XNAME = '$k_x$'; YNAME = '$z$'; XNAME = '$k_x$'; YNAME = '$z$';
[Y,X] = meshgrid(DATA.z,DATA.kx); [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' case 'kyz'
XNAME = '$k_y$'; YNAME = '$z$'; XNAME = '$k_y$'; YNAME = '$z$';
[Y,X] = meshgrid(DATA.z,DATA.ky); [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' case 'sx'
XNAME = '$v_\parallel$'; YNAME = '$\mu$'; XNAME = '$v_\parallel$'; YNAME = '$\mu$';
[Y,X] = meshgrid(OPTIONS.XPERP,OPTIONS.SPAR); [Y,X] = meshgrid(OPTIONS.XPERP,OPTIONS.SPAR);
...@@ -110,7 +110,7 @@ end ...@@ -110,7 +110,7 @@ end
switch REALP switch REALP
case 1 % Real space plot case 1 % Real space plot
INTERP = OPTIONS.INTERP; INTERP = OPTIONS.INTERP;
process = @(x) real(fftshift(ifft2(x,Nx,Ny))); process = @(x) real(fftshift(ifft2(x,Ny,Nx)));
shift_x = @(x) x; shift_x = @(x) x;
shift_y = @(x) x; shift_y = @(x) x;
case 0 % Frequencies plot case 0 % Frequencies plot
......
...@@ -3,8 +3,8 @@ character(len=40) BRANCH ...@@ -3,8 +3,8 @@ character(len=40) BRANCH
character(len=20) AUTHOR character(len=20) AUTHOR
character(len=40) EXECDATE character(len=40) EXECDATE
character(len=40) HOST character(len=40) HOST
parameter (VERSION='e4c9228-dirty') parameter (VERSION='38a4f6e-dirty')
parameter (BRANCH='kx_pos_plane') parameter (BRANCH='kx_pos_plane')
parameter (AUTHOR='ahoffman') 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') parameter (HOST ='spcpc606')
...@@ -3,8 +3,8 @@ character(len=40) BRANCH ...@@ -3,8 +3,8 @@ character(len=40) BRANCH
character(len=20) AUTHOR character(len=20) AUTHOR
character(len=40) EXECDATE character(len=40) EXECDATE
character(len=40) HOST character(len=40) HOST
parameter (VERSION='e4c9228-dirty') parameter (VERSION='38a4f6e-dirty')
parameter (BRANCH='kx_pos_plane') parameter (BRANCH='kx_pos_plane')
parameter (AUTHOR='ahoffman') 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') parameter (HOST ='spcpc606')
...@@ -39,18 +39,18 @@ if 0 ...@@ -39,18 +39,18 @@ if 0
% Options % Options
options.INTERP = 1; options.INTERP = 1;
options.POLARPLOT = 0; options.POLARPLOT = 0;
options.NAME = '\phi'; % options.NAME = '\phi';
% options.NAME = 'N_i^{00}'; options.NAME = 'N_i^{00}';
% options.NAME = 'v_y'; % options.NAME = 'v_y';
% options.NAME = 'n_i^{NZ}'; % options.NAME = 'n_i^{NZ}';
% options.NAME = '\Gamma_x'; % options.NAME = '\Gamma_x';
% options.NAME = 'n_i'; % options.NAME = 'n_i';
options.PLAN = 'kxky'; options.PLAN = 'xy';
% options.NAME = 'f_e'; % options.NAME = 'f_e';
% options.PLAN = 'sx'; % options.PLAN = 'sx';
options.COMP = 'avg'; options.COMP = 'avg';
% options.TIME = dat.Ts5D; % options.TIME = dat.Ts5D;
options.TIME = 0:0.1:10; options.TIME = 0:1:100;
data.EPS = 0.1; data.EPS = 0.1;
data.a = data.EPS * 2000; data.a = data.EPS * 2000;
create_film(data,options,'.gif') create_film(data,options,'.gif')
......
...@@ -3,7 +3,7 @@ helazdir = '/home/ahoffman/HeLaZ/'; ...@@ -3,7 +3,7 @@ helazdir = '/home/ahoffman/HeLaZ/';
% Directory of the simulation % Directory of the simulation
% if 1% Local results % if 1% Local results
outfile =''; 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 ='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 ='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/'; % outfile ='shearless_cyclone/128x128x16x4x2_L_120_CTC_1.0/';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment