clc; clear; close all;

Globals2D;

tic;
Problem;

N = 4; % degree of polynomial representing solution within an element (local solution representation)

StartUp2D; % computing local operators and mesh information

NonreflectingBCStartup;

%[mapF, vmapF, mapW, vmapW] = BuildBCMaps();
%[mapF, vmapF, mapW, vmapW] = BuildBCMaps_large(); % for large domain to avoid problems with BC
[mapW, vmapW, mapI, vmapI, mapO, vmapO] = BuildBCMaps_PML();
%[mapW, vmapW, mapI, vmapI, mapO, vmapO] = BuildBCMaps_sponge();

NumericalFluxStartup;

rho_IC_values = rho_IC(x,y); % evaluating initial condition
u_IC_values = u_IC(x,y); % evaluating initial condition
v_IC_values = v_IC(x,y); % evaluating initial condition
p_IC_values = p_IC(x,y); % evaluating initial condition
preproccesing_time = toc;

tic;
%[rho,u,v,p] = Timestepping(rho_IC_values,u_IC_values,v_IC_values,p_IC_values,T); % time-stepping for the ODE system
[rho,u,v,p] = Timestepping_PML(rho_IC_values,u_IC_values,v_IC_values,p_IC_values,T); % time-stepping for the ODE system
%[rho,u,v,p] = Timestepping_sponge(rho_IC_values,u_IC_values,v_IC_values,p_IC_values,T); % time-stepping for the ODE system
computation_time = toc;