Mercurial > repos > public > sbplib
changeset 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 | 73e52c74baac |
files | +grid/boundaryOptimizedTest.m +sbp/+grid/accurateBoundaryOptimizedGrid.m +sbp/+grid/minimalBoundaryOptimizedGrid.m |
diffstat | 3 files changed, 17 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
diff -r e53b1e25970a -r 0ffb5bfa65e4 +grid/boundaryOptimizedTest.m --- a/+grid/boundaryOptimizedTest.m Tue Jul 07 16:08:08 2020 +0200 +++ b/+grid/boundaryOptimizedTest.m Tue Jul 07 16:23:44 2020 +0200 @@ -50,8 +50,7 @@ % Tests that the expected grid points are obtained for a boundary optimized grid with a 4th order % accurate stencil and 8th order minimal stencil. % The boundary grid point distance weights are taken from the D1Nonequidistant operators and -% grid spacing is calculated according to Mattsson et al 2018. The test uses minimal number of grid -% points required by the operators. +% grid spacing is calculated according to Mattsson et al 2018. function testCompiles(testCase) %% 1D 4th order accurate stencil
diff -r e53b1e25970a -r 0ffb5bfa65e4 +sbp/+grid/accurateBoundaryOptimizedGrid.m --- a/+sbp/+grid/accurateBoundaryOptimizedGrid.m Tue Jul 07 16:08:08 2020 +0200 +++ b/+sbp/+grid/accurateBoundaryOptimizedGrid.m Tue Jul 07 16:23:44 2020 +0200 @@ -1,5 +1,12 @@ +% Computes the grid points x and grid spacing h used by the boundary optimized SBP operators +% with improved boundary accuracy, presented in +% 'Boundary optimized diagonal-norm SBP operators - Mattsson, Almquist, van der Weide 2018'. +% +% lim - cell array with domain limits +% N - Number of grid points +% order - order of accuracy of sbp operator. function [x,h] = accurateBoundaryOptimizedGrid(lim,N,order) - assert(iscell(lim) && numel(lim) == 2,'The limits should be cell arrays with 2 elements.'); + assert(iscell(lim) && numel(lim) == 2,'The limit should be cell array with 2 elements.'); L = lim{2} - lim{1}; assert(L>0,'Limits must be given in increasing order.'); %%%% Non-equidistant grid points %%%%%
diff -r e53b1e25970a -r 0ffb5bfa65e4 +sbp/+grid/minimalBoundaryOptimizedGrid.m --- a/+sbp/+grid/minimalBoundaryOptimizedGrid.m Tue Jul 07 16:08:08 2020 +0200 +++ b/+sbp/+grid/minimalBoundaryOptimizedGrid.m Tue Jul 07 16:23:44 2020 +0200 @@ -1,5 +1,12 @@ +% Computes the grid points x and grid spacing h used by the boundary optimized SBP operators +% with minimal number of non-equidistant boundary points, presented in +% 'Boundary optimized diagonal-norm SBP operators - Mattsson, Almquist, van der Weide 2018'. +% +% lim - cell array with domain limits +% N - Number of grid points +% order - order of accuracy of sbp operator. function [x,h] = minimalBoundaryOptimizedGrid(lim,N,order) - assert(iscell(lim) && numel(lim) == 2,'The limits should be cell arrays with 2 elements.'); + assert(iscell(lim) && numel(lim) == 2,'The limit should be a cell array with 2 elements.'); L = lim{2} - lim{1}; assert(L>0,'Limits must be given in increasing order.'); %%%% Non-equidistant grid points %%%%%