/ concept-collection / windowedFourierProjection
Sign in
concept-collection / windowedFourierProjection
windowedFourierProjection / wfp_1Dspringscattering / get_xgrid.m
23 lines · 727 BBlameHistoryRaw
1function x = get_xgrid(ax,bx,src_dmn,Nx,h0,W)
2% GET_XGRID a function to get the spatial grid for plotting
3%
4% INPUTS:
5% [ax,bx]: spatial domain
6% [as,bs]: interval where sources are placed
7% Nx: number of grid points in the spatial discretization
8% h0: intial time-step size
9% W: width of the window function
10% addProj: button to turn on free-space projection
11% getSelfConvergence: button to turn on self-convergence study
13as = src_dmn(1); bs = src_dmn(2);
15h_temp = h0;
17xmin = (ax + 2*h_temp*W); xmax = (bx - 2*h_temp*W);
18x = linspace(xmin,xmax,Nx)';
19if(xmin>as || xmax<bs)
20 error('Sources are outside allowed region; reduce the time-step or narrow down the domain where sources live');
21end
23end
moveopenescclose