function ui = ic_ramp ( x )

%*****************************************************************************80
%
%% ic_ramp() evaluates the initial condition for a ramp function.
%
%  Modified:
%
%    16 April 2012
%
%  Author:
%
%    Mikel Landajuela
%
%  Input:
%
%    real X(*), the node coordinates.
%
%  Output:
%
%    real UI(*), the value of the initial condition at each node.
%
  for i = 1 : length ( x )
    if ( x(i) < -0.5 )
      ui(i) = 1.0;
    elseif ( -0.5 <= x(i) & x(i) < 0.0 )
      ui(i) = 1.0 * ( x(i) - 0.0 ) / ( - 0.5 - 0.0 );
    elseif ( 0.0 <= x(i) )
      ui(i) = 0.0;
    end
  end

  return
end
