function f = elliptic_wavefront_rhs ( x, y, nel )

%*****************************************************************************80
%
%% ELLIPTIC_WAVEFRONT_RHS sets the right hand side function.
%
%  Discussion:
%
%    RHS(X,Y) = - del^2 ( atan ( alpha * sqrt ( (x-xc)^2 + (y-yc)^2 ) - r0 ) )
%
%  Modified:
%
%    07 November 2013
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    William Mitchell,
%    A collection of 2D elliptic problems for testing adaptive
%    grid refinement algorithms,
%    Applied Mathematics and Computation,
%    Volume 220, 1 September 2013, pages 350-364.
%
%  Parameters:
%
%    Input, real X(*), Y(*), the evaluation points.
%
%    Input, integer N, the number of evaluation points.
%
%    Output, real F(*), the right hand side function.
%
  alpha = 20.0;
  xc = - 0.05;
  yc = - 0.05;
  r0 = 0.7;

  xsq = ( x - xc ).^2;
  ysq = ( y - yc ).^2;

  f = - ( alpha + alpha^3 * ( r0^2 - xsq - ysq ) ) ...
    ./ ( sqrt ( xsq + ysq ) .* ( - 1.0 + alpha^2 ...
    .* ( - r0^2 - xsq - ysq + 2.0 * r0 * sqrt ( xsq + ysq ) ) ).^2 );

  return
end
