KNTREFINE: Refine a given knot vector by dividing each interval uniformly,
             maintaining the continuity in previously existing knots.

   [rknots]                  = kntrefine (knots, n_sub, degree, regularity)
   [rknots, zeta]            = kntrefine (knots, n_sub, degree, regularity)
   [rknots, zeta, new_knots] = kntrefine (knots, n_sub, degree, regularity)

 INPUT:

     knots:      initial knot vector.
     n_sub:      number of new knots to be added in each interval.
     degree:     polynomial degree of the refined knot vector
     regularity: maximum global regularity 

 OUTPUT:

     rknots:    refined knot vector
     zeta:      refined knot vector without repetitions
     new_knots: new knots, to apply the knot insertion

 The regularity at the new inserted knots is the one given by the user.
 At previously existing knots, the regularity is the minimum
  between the previous regularity, and the one given by the user.
  This ensures optimal convergence rates in the context of IGA.

 Copyright (C) 2010 Carlo de Falco, Rafael Vazquez

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

Package: nurbs