1 % KNTUNIFORM: generate uniform open knot vectors in the reference domain.
3 % [csi, zeta] = kntuniform (num, degree, regularity)
7 % num: number of breaks (in each direction)
8 % degree: polynomial degree (in each direction)
9 % regularity: global regularity (in each direction)
14 % zeta: breaks = knots without repetitions
16 % Copyright (C) 2009, 2010 Carlo de Falco
17 % Copyright (C) 2011 Rafael Vazquez
19 % This program is free software: you can redistribute it and/or modify
20 % it under the terms of the GNU General Public License as published by
21 % the Free Software Foundation, either version 2 of the License, or
22 % (at your option) any later version.
24 % This program is distributed in the hope that it will be useful,
25 % but WITHOUT ANY WARRANTY; without even the implied warranty of
26 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 % GNU General Public License for more details.
29 % You should have received a copy of the GNU General Public License
30 % along with this program. If not, see <http://www.gnu.org/licenses/>.
32 function [csi, zeta] = kntuniform (num, degree, regularity)
34 if (numel(num)~=numel(degree) || numel(num)~=numel(regularity))
35 error('kntuniform: num, degree and regularity must have the same length')
38 zeta{idim} = linspace (0, 1, num(idim));
39 rep = degree(idim) - regularity(idim);
41 csi{idim} = [zeros(1, degree(idim)+1-rep)...
42 reshape(repmat(zeta{idim}, rep, 1), 1, []) ones(1, degree(idim)+1-rep)];
44 error ('kntuniform: regularity requested is too high')