comparison +sbp/+util/minimalBoundaryOptimizedGrid.m @ 1288:e059a43bb675 feature/boundary_optimized_grids

Error-check format of limit arguments
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 01 Jul 2020 15:13:36 +0200
parents 38653d26225c
children
comparison
equal deleted inserted replaced
1287:38653d26225c 1288:e059a43bb675
1 function [x,h] = minimalBoundaryOptimizedGrid(lim,N,order) 1 function [x,h] = minimalBoundaryOptimizedGrid(lim,N,order)
2 assert(iscell(lim) && numel(lim) == 2,'The limits should be cell arrays with 2 elements.');
2 L = lim{2} - lim{1}; 3 L = lim{2} - lim{1};
3 assert(L>0,'Limits must be given in increasing order.') 4 assert(L>0,'Limits must be given in increasing order.');
4 %%%% Non-equidistant grid points %%%%% 5 %%%% Non-equidistant grid points %%%%%
5 xb = boundaryPoints(order); 6 xb = boundaryPoints(order);
6 m = length(xb)-1; % Number of non-equidistant points 7 m = length(xb)-1; % Number of non-equidistant points
7 assert(N-2*(m+1)>=0,'Not enough grid points to contain the boundary region. Requires at least %d points.',2*(m+1)); 8 assert(N-2*(m+1)>=0,'Not enough grid points to contain the boundary region. Requires at least %d points.',2*(m+1));
8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%