
\section{Examples of \nesl{} Applets}
\label{sec:applets}

In this section we describe three existing \nesl{} applications that are
now available as Java applets on the web.  Figure~\ref{fig:snapshots}
shows screen shots of the applets running in a web browser; other
applications that we have converted include a geometric graph separator
and a two-dimensional convex hull~\cite{nesl-applets}.

\begin{enumerate}
\item {\bf Airflow simulation.}  This is a simulation of airflow over an
  airfoil using a parallel implementation of the finite volume method.
  Steps in the simulation include: finding a Delaunay
  triangulation of the set of points; generating the
  dual Voronoi diagram from the triangulation; writing a linear equation
  for each Voronoi cell such that the net flow into each cell is zero;
  setting the boundary conditions (Neumann conditions); solving the set
  of linear equations using the conjugate gradient method; and
  generating the flow velocities on each triangle from the flow
  potentials at the three corners.  The generated mesh can be zoomed in
  or out, and each step is animated to aid in its explanation.
  
\item {\bf $N$-body simulation.}  This is a simulation of gravitational
  forces between $N$ bodies in two dimensions, using the Barnes-Hut
  $O(N\log N)$ algorithm.  In each timestep, the algorithm
  builds a quadtree based on the bodies, calculates the total force on
  each body by traversing the quadtree, and updates the positions and
  velocities of the bodies.  The simulation allows both
  uniform and non-uniform distributions of bodies.
  
\item {\bf Connected components tutorial.}  This tutorial demonstrates
  three algorithms for finding the connected components in a graph:
  random mate, Awerbuch-Shiloach, and a hybrid of the two.  The tutorial
  highlights each line of code as it is  
  executed, explaining its effect on the displayed graph.  It also
  displays graph statistics as it runs, and allows the user to edit the
  graph.

\end{enumerate}

\begin{figure}[htb]
 \begin{center}
  \begin{tabular}{ccc} 
  %\centerline{\psfig{figure=wing1.ps,height=2.5in}}
  % \psfig{figure=wing1.ps,height=2.0in}\ \ \ &
   \psfig{figure=aflow2.ps,height=2.0in}\ \ \ &
    \psfig{figure=bh.ps,height=2.0in}\ \ \ &
  %\psfig{figure=nb22.ps,height=2.0in}\ \ \ &
  %\psfig{figure=cc1.ps,height=2.0in} \\ 
   \psfig{figure=cc12.ps,height=2.0in} \\ 
   (a) & (b) & (c) \\
  \end{tabular}
 \end{center}
 \onehalfspacing
 \caption{Screen shots of algorithm animations written in \nesl,
    compiled into Java, and running as applets: (a) airflow simulation,
    (b) $N$-body simulation, and (c) connected components
    tutorial. From \texttt{http://www.cs.cmu.edu/\~{}scandal/applets/}.}
 \label{fig:snapshots}
\end{figure}

% LocalWords:  http www
