Mercurial > repos > public > sbplib
diff +grid/Curvilinear.m @ 173:f7bb2a94d291 feature/grids
Added functionallity for storing grid scaling on structured grids.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 26 Feb 2016 16:06:03 +0100 |
parents | c3483685116a |
children | c5ca9bbfed41 |
line wrap: on
line diff
--- a/+grid/Curvilinear.m Thu Feb 25 11:30:05 2016 +0100 +++ b/+grid/Curvilinear.m Fri Feb 26 16:06:03 2016 +0100 @@ -29,7 +29,7 @@ if iscell(mapping) obj.coords = cellMappingToCoords(mapping, N, D, obj.logic.m); elseif isnumeric(mapping) - obj.coords = matrixMappingToCoords(mapping, N, D) + obj.coords = matrixMappingToCoords(mapping, N, D); else error('grid:Curvilinear:Curvilinear','mapping must be a matrix or a cell array.'); end @@ -73,13 +73,20 @@ function gf = projectFunc(obj, gf, g) gf = obj.logic.projectFunc(gf,g.baseGrid()); end + + function h = scaling(obj) + if isempty(obj.logic.h) + error('grid:Curvilinear:NoScalingSet','No scaling set'); + end + h = obj.logic.h; + end end end function coords = cellMappingToCoords(mapping, N, D, m) if ~isequal(size(mapping),[1 D]) - error('grid:Curvilinear:Curvilinear','The cell array must be a row array.'); + error('grid:Curvilinear:Curvilinear','The cell array must be a 1xD array.'); end if isequal(size(mapping{1}),[N 1])