Mercurial > repos > public > sbplib
diff +multiblock/DiffOp.m @ 392:30ff8879162e feature/beams
Better input parsing for multiblock DiffOp.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 12 Jan 2017 17:17:58 +0100 |
parents | 33b2ef863519 |
children | 225765e345c4 324c927d8b1d |
line wrap: on
line diff
--- a/+multiblock/DiffOp.m Thu Jan 12 15:51:24 2017 +0100 +++ b/+multiblock/DiffOp.m Thu Jan 12 17:17:58 2017 +0100 @@ -94,11 +94,23 @@ if isempty(doParam) getParam = @(i){}; - elseif iscell(doParam) && length(doParam) == grid.nBlocks() + return + end + + if ~iscell(doParam) + getParam = @(i)doParam; + return + end + + % doParam is a non-empty cell-array + + if length(doParam) == grid.nBlocks() && all(cellfun(@iscell, doParam)) + % doParam is a cell-array of cell-arrays getParam = @(i)doParam{i}; - else - getParam = @(i)doParam; + return end + + getParam = @(i)doParam; end end