%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file defines all the parameters used in the 2D advection diffusion simulation.
%
% All constants used below are defined in file CONSTANTS_for_advection_diffusion_2D.m.
% Please see that file for definition of constants.
%
% Note that many variables are defined as sets with just one member, since it is also possible
% to define SEVERAL data sets in a single parameter file.
% Those variables end with the ending "set".
%

%%% PARAMETERS FOR GRID 1:
Grid1.N_x_grid_points = 20;
Grid1.N_y_grid_points = 20;

Grid1.xmin=0.0; Grid1.xmax=100.0;
Grid1.ymin=0.0; Grid1.ymax=100.0;


%%% PARAMETERS FOR GRID 2:
N_samples_to_combine_set = [1];
N_x_grid_points_to_combine_set = [1];
N_y_grid_points_to_combine_set = [1];


%%%%%%% PARAMETER FOR NUMERICAL SIMULATION (must be within (0,1.0] )
lambda_set = [ 0.5 ];  % This is also often called variable C


%%%%%%%%%%% PARAMETERS FOR INFORMATION ENTERED IN SYSTEM (information sent to system during runs):

%%% CHOICES FOR INITIAL_TEMP_PATTERN (initial conditions) FOR EACH RUN

%%% Typical choices are NO_INITIAL_SIGNAL, if we want to juse just PRIOR NOISE;
%%% or PEAK_AT_JUST_ONE_GRID_POINT, if we want to send a large peak to each grid point.

%Advection.INITIAL_TEMP_PATTERN = NO_INITIAL_SIGNAL;  % FLAT signal, all nodes set to min temp.
Advection.INITIAL_TEMP_PATTERN = PEAK_AT_JUST_ONE_GRID_POINT;  % create hot spot at just a single point

% Older options: rarely used in this context
%Advection.INITIAL_TEMP_PATTERN = POINTS_ON_VERTICAL_LINE; % several hot spots on vertical line
%Advection.INITIAL_TEMP_PATTERN = POINTS_ON_CIRCLE; % several hot spots on circle
%Advection.INITIAL_TEMP_PATTERN = LEFT_HALF; % for debugging: left half is hot, right half if cold
%Advection.INITIAL_TEMP_PATTERN = RECTANGULAR_AREA; % one single rectangular area is hot

N_hot_spots = 1; % determines number of hot spots for options POINTS_ON_VERTICAL_LINE and POINTS_ON_CIRCLE


%%% DEFINING PRIOR NOISE

% CHOOSE TYPE OF "PRIOR NOISE":
Advection.NOISE_TYPE = NO_NOISE;
%Advection.NOISE_TYPE = NOISE_AT_ALL_POINTS;
%Advection.NOISE_TYPE = NOISE_AT_ONE_POINT;

Advection.mu_for_noise = 0;
Advection.sigma_for_noise = 1.0; % to turn off noise, set NOISE_TYPE = NO_NOISE above.

% CURRENTLY NO "POSTERIOR NOISE" IS IMPLEMENTED, BUT ONE CAN ALWAYS ADD SUCH NOISE
% BY JUST ADDING NOISE TO THE FINAL DATA GENERATED HERE.


%%%%%%%%%%% PARAMETERS FOR ADVECTION AND DIFFUSION EQUATIONS:

% HOW TO HANDLE BOUNDARIES:
Advection.BOUNDARY_HANDLING = BOUNDARIES_WRAP_AROUND;
%Advection.BOUNDARY_HANDLING = BOUNDARIES_CONSTRAINED_TO_MIN;


% NUMERICAL SCHEME USED FOR CALCULATIONS OF ADVECTION AND DIFFUSION
% Choose true for basic scheme, set false for UPWIND scheme (recommended)
Advection.BASIC_ADVECTION = false;  % Use UPWIND scheme, this is generally the better choice.

Advection.WITH_DIFFUSION = true;  % Do we want diffusion terms?

% Choose diffusion parameters in each direction
Advection.kappa_x = 1;
Advection.kappa_y = 1;  

if ( Advection.WITH_DIFFUSION == false )
   Advection.kappa_x = 0;
   Advection.kappa_y = 0;
end

% PARAMETERS FOR ADVECTION FIELD:
%Advection.VELOCITY_PATTERN = ZERO_VELOCITY;
%Advection.VELOCITY_PATTERN = STRAIGHT_AT_ANGLE;
Advection.VELOCITY_PATTERN = CIRCULAR_CLOCKWISE;
%Advection.VELOCITY_PATTERN = CROSS_CURRENT;
%Advection.VELOCITY_PATTERN = COUNTER_CURRENT;  % Not yet fully implemented.  Experimental.

% Advection velocity:
Advection.Vel= 1; %m/s   Set maximal value of advection velocity within field.

alpha_with_horizontal_set = [0];  % relevant only for STRAIGHT_AT_ANGLE case

% For STRAIGHT_AT_ANGLE and CIRCULAR_CLOCKWISE: strip_start and strip_end
% define areas in which velocities are non-zero.
% Everywhere else velocities are set to zero.
strip_start_in_perc_set = [30];
strip_end_in_perc_set = [65];


% Define number of tiers (lagged variables) to calculate
% Even if saving without lags, this defines how many samples to calculate.
% Namely enough samples so that a data set with N_tiers lags still has at least 5,000 samples.
N_tiers_to_calculate = 20; %

% An internal parameter for creating plots of advection velocity field - you can ignore this
timestep_for_vel_plot = 5;  % step size for plotting velocity field as displacement per timestep

