We present a generalized framework for cellular/lattice-based visualiz
ations in two dimensions based on state-of-the-art computing abstracti
ons. Our implementation lakes the form of a library of reusable functi
ons written in C++ that hide complex graphical programming issues from
the user and mimic the algebraic structure of physics at the Hamilton
ian level. Our toolkit is not just a graphics library but an object an
alysis of physical systems that disentangles separate concepts in a fa
ithful analytical way. It could be rewritten in other languages such a
s Java and extended to three-dimensional systems straightforwardly. We
illustrate the usefulness of our analysis with implementations of spi
n films (the two-dimensional XY model with and without an external mag
netic field) and a model for diffusion through a triangular lattice. (
C) 1998 American Institute of Physics. [S0894-1866(98)01703-9].