function u = dirichlet_condition ( node_num, node_xy, time )

%*****************************************************************************80
%
%% dirichlet_condition() sets the value of a Dirichlet boundary condition.
%
%  Discussion:
%
%    For efficiency, this routine may be called once, with all the
%    nodes input.  Of course, only those nodes that lie on the boundary
%    will need a meaningful value of U to be assigned.  Other nodes
%    may be given a dummy value for U.
%
%    This routine is set for the unit square.
%
%    We assume that the equation to be solved is
%
%      dUdT - Del L(X,Y,T) Del U + K(X,Y,T) * U = F
%
%    with 
%
%      L(X,Y,T) = 1
%      K(X,Y,T) = 0
%      F(X,Y,T) = (2*pi*pi-1)*sin(pi*x)*sin(pi*y)*exp(-t).
%
%    The exact solution is:
%
%      U = sin(pi*x) * sin(pi*y) * exp(-t)
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 November 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer NODE_NUM, the number of nodes.
%
%    real NODE_XY(2,NODE_NUM), the coordinates of the points.
%
%    real TIME, the current time.
%
%  Output:
%
%    real U(NODE_NUM), the value of the solution at the
%    the points.
%
  u(1:node_num) = sin ( pi * node_xy(1,1:node_num) ) ...
               .* sin ( pi * node_xy(2,1:node_num) ) * exp ( - time );

  return
end
