Mercurial > repos > public > sbplib
comparison +sbp/+grid/minimalBoundaryOptimizedGrid.m @ 1298:0ffb5bfa65e4 feature/boundary_optimized_grids
Improve comments
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 07 Jul 2020 16:23:44 +0200 |
parents | e53b1e25970a |
children |
comparison
equal
deleted
inserted
replaced
1297:e53b1e25970a | 1298:0ffb5bfa65e4 |
---|---|
1 % Computes the grid points x and grid spacing h used by the boundary optimized SBP operators | |
2 % with minimal number of non-equidistant boundary points, presented in | |
3 % 'Boundary optimized diagonal-norm SBP operators - Mattsson, Almquist, van der Weide 2018'. | |
4 % | |
5 % lim - cell array with domain limits | |
6 % N - Number of grid points | |
7 % order - order of accuracy of sbp operator. | |
1 function [x,h] = minimalBoundaryOptimizedGrid(lim,N,order) | 8 function [x,h] = minimalBoundaryOptimizedGrid(lim,N,order) |
2 assert(iscell(lim) && numel(lim) == 2,'The limits should be cell arrays with 2 elements.'); | 9 assert(iscell(lim) && numel(lim) == 2,'The limit should be a cell array with 2 elements.'); |
3 L = lim{2} - lim{1}; | 10 L = lim{2} - lim{1}; |
4 assert(L>0,'Limits must be given in increasing order.'); | 11 assert(L>0,'Limits must be given in increasing order.'); |
5 %%%% Non-equidistant grid points %%%%% | 12 %%%% Non-equidistant grid points %%%%% |
6 xb = boundaryPoints(order); | 13 xb = boundaryPoints(order); |
7 m = length(xb)-1; % Number of non-equidistant points | 14 m = length(xb)-1; % Number of non-equidistant points |