1 %% Setup the VERB code
for different figures
3 % SETUP is the file you will actually run. It will call VERB_code_2.0.exe
4 % and Plot.m on its own (assuming you want it to).
6 % In order to run
this script, you must outline the following (4)
7 %
parameters. After that, it will be ready to run.
9 % The only other parameter that you should set is
'SAVEFIG' in Plot.m. It
10 % decides whether to save the figure, so be sure to set that parameter as
11 % well before running
this script.
15 % Set the following (4)
parameters before running the script:
16 % OS, FIGURE, RUN, PLOT
18 % Assuming they are properly set, you will not need to worry about the
19 % code after this section.
22 % DEFINE YOUR OS: WIN MAC LIN
25 % Available options: 1 2.1 2.2 3 4
26 % FIGURE 2 is split into 2.1 and 2.2 because it requires 2 separate runs.
27 % 2.1 refers to the top row; 2.2 refers to the bottom row.
28 % Consult the paper to decide which plot you want to generate.
31 % choose if you want to run the .exe file on your data
32 % if there is no generated data, then set to true.
33 % otherwise, it is up to you.
36 % choose to plot the results.
37 % if RUN = true, it will use data gathered from the simulation
38 % if RUN = false, it will use whatever data was stored in Output_x,
39 % where x represents the FIGURE
45 VERBcodePath = '../Execute/';
47 addpath('./Various_functions/');
49 % this file may be obtained by any run of the VERB code with
parameters of
51 if(~strcmp(FIGURE,'0'))
52 % Replaced '\' with '/'
53 % If this does not work for Windows, use a switch statement as in
54 % 'create_PSD0.m' for multiple users. Otherwise, delete this comment!
55 Grid_filename = '../Execute/
Output/rad_grid.plt';
56 [L, epc, alpha, pc] = load_plt(Grid_filename, 'squeeze', 'permute');
58 OutputFolder = [VERBcodePath 'Output_' FIGURE '/'];
59 if(~exist(OutputFolder,'file'))
60 % FIGURES 1 does not need output folder
61 if(~strcmp(FIGURE,'1'))
65 if(~strcmp(FIGURE,'1')) % FIGURE 1 has no parameter file
66 % otherwise, we copy our specified parameter file into the
67 % Parameters.ini file to run with the correct specifications
68 copyfile([VERBcodePath 'Parameters' FIGURE '.ini'],[VERBcodePath 'Parameters.ini']);
74 case '0' % only to setup the grid, no results (first time users)
75 OutputFolder = [VERBcodePath '
Output' '/'];
76 if(~exist(OutputFolder,'file'))
79 copyfile([VERBcodePath 'Parameters0.ini'],[VERBcodePath 'Parameters.ini']);
95 PSD0_filename = '../Execute/Input/myPSD0.plt';
97 PSD_prof =
steady_state(L1d, RadialDiffCoeff(Kp,L1d),tau)';
98 PSD_ongrid.arr = squeeze(repmat(PSD_prof,[1 1 3 3]));
99 save_plt(PSD0_filename,PSD_ongrid);
105 system('./VERB_code.exe'); % WiNDOWS
107 system('./VERB_code_2.0'); % MAC
109 system('./VERB_code_2.0_linux'); % LINUX
void steady_state(Matrix1D< double > &f, double tau, double Kp, int nx, Matrix1D< double > &L, double f_bnd_out, double f_bnd_in)
functions for write log and support files. Functions are defined in Output.h and descripted in Output...
Parameters_structure parameters
Parameters structure, with all parameters from the parameters.ini file. The default parameters define...