wave_solver_yp

PURPOSE ^

SYNOPSIS ^

function [wave] = wave_solver_yp(dkepath,wavestruct,f0struct)

DESCRIPTION ^

 Wave solver module for LUKE. Self-consistent calculations with or without plasma fluctuations

 by Y. Peysson (DRFC/DSM/CEA) <yves.peysson@cea.fr> and J. Decker (DRFC/DSM/CEA) <joan.decker@cea.fr>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [wave] = wave_solver_yp(dkepath,wavestruct,f0struct)
0002 %
0003 % Wave solver module for LUKE. Self-consistent calculations with or without plasma fluctuations
0004 %
0005 % by Y. Peysson (DRFC/DSM/CEA) <yves.peysson@cea.fr> and J. Decker (DRFC/DSM/CEA) <joan.decker@cea.fr>
0006 %
0007 if isfield(wavestruct,'waveparam') && isfield(wavestruct.waveparam,'n_rf_list'),
0008     n_rf_list = wavestruct.waveparam.n_rf_list;
0009 elseif isfield(dkeparam,'n_rf_list'),
0010     n_rf_list = dkeparam.n_rf_list;
0011 else
0012     disp('Warning : no n_rf_list data found, enforced to 0:3')
0013     n_rf_list = 0:3;
0014 end
0015 %
0016 if strcmp(wavestruct.wavesolver,'C3PO'),% C3P0 ray tracing
0017     rayinit = main_rayinit_launch_jd(wavestruct.equil,wavestruct.launch);
0018     %
0019     if ~isfield(wavestruct,'raydisplay') && isfield(wavestruct,'C3POdisplay'),
0020         wavestruct.raydisplay = wavestruct.C3POdisplay;
0021     end
0022     %
0023     if ~isfield(wavestruct,'C3POparam'),
0024         wavestruct.C3POparam = [];
0025     end
0026     %
0027     if ~isfield(wavestruct,'equil_fit'),
0028         if isfield(wavestruct,'fitparam'),
0029             [wavestruct.equil_fit] = fitequil_yp(wavestruct.equil,wavestruct.fitparam.mode_equil,wavestruct.fitparam.method,wavestruct.fitparam.ngridresample,wavestruct.fitparam.nharm);
0030         else
0031             [wavestruct.equil_fit] = fitequil_yp(wavestruct.equil,wavestruct.fitequilparam.mode_equil,wavestruct.fitequilparam.method,wavestruct.fitequilparam.ngridresample,wavestruct.fitequilparam.nharm);%backward compatibility
0032         end  
0033     end
0034     %
0035     if ~isfield(wavestruct.equil_fit,'fluct_fit'),
0036         wave = main_C3PO_jd(dkepath,wavestruct.id,wavestruct.equil,wavestruct.equil_fit,rayinit,wavestruct.waveparam,[],wavestruct.rayparam,wavestruct.raydisplay,wavestruct.C3POparam);%Ray calculations
0037     else
0038         wave = main_C3PO_jd(dkepath,wavestruct.id,wavestruct.equil,wavestruct.equil_fit,rayinit,wavestruct.waveparam,[],wavestruct.rayparam,wavestruct.raydisplay,wavestruct.C3POparam,f0struct,wavestruct.equil_fit.fluct_fit);%Ray calculations
0039     end
0040     %
0041     wave = wave_process_jd(wavestruct.equil,wave,n_rf_list);%Wave processing and relativistic linear damping
0042     %
0043     if isfield(wavestruct.launch,'b_sdNpar') == 1,
0044         wave.b_sdNpar = wavestruct.launch.b_sdNpar;
0045     end
0046     %
0047 elseif strcmp(wavestruct.wavesolver,'AMR'),% AMR ray tracing
0048     %
0049     wave = make_wave_AMR_jd(wavestruct,equil);%Ray calculations
0050     %
0051     wave = wave_process_jd(equil,wave,n_rf_list);%Wave processing and relativistic linear damping
0052     %
0053 else
0054     error('This wave solver is not linked to LUKE.')
0055 end
0056 %
0057 if isfield(wavestruct,'savedir') && ischar(wavestruct.savedir),
0058     if ~isempty(wavestruct.savedir) && ~exist(wavestruct.savedir,'dir'),
0059         mkdir(wavestruct.savedir)
0060     end
0061     filename = [wavestruct.savedir,filesep,'WAVE_',wave.equil_id,'_',wave.id,'.mat'];
0062     save(filename,'wave');
0063     wave = filename;
0064 end
0065 
0066 
0067

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.