rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
spline_select.m
1 function [p_mu] = spline_select(model)
2 %function [p_mu] = spline_select(model)
3 %
4 % This function is a wrapper for spline functions that are used for geometrical
5 % transformations of the grid.
6 
7 if isequal(model.geometry_spline_type, 'cubic')
8 
9  x_hill = model.geometry_transformation_spline_x;
10  y_hill = model.geometry_transformation_spline_y;
11  if model.hill_height >= 0
12  y_hill(2) = model.hill_height;
13  end
14 
15  p_mu = spline(x_hill, y_hill);
16 
17 elseif isequal(model.geometry_spline_type, 'affine')
18 
19 % x_hill = model.geometry_transformation_spline_x;
20  y_hill = model.geometry_transformation_spline_y;
21  if model.hill_height >= 0
22  y_hill(2) = model.hill_height;
23  end
24 
25 % p_mu = mkpp(x_hill, [(y_hill(2)-y_hill(1))/(x_hill(2)-x_hill(1)),y_hill(1);
26 % (y_hill(3)-y_hill(2))/(x_hill(3)-x_hill(2)),y_hill(2)]);
27  p_mu = mkpp([0 1], [-y_hill(2) y_hill(2)]);
28 % plot(ppval(p_mu, linspace(0,1)));
29 end
30 
31 %| \docupdate