  In the first part of a series of two papers, we present in considerable
detail a collision-driven molecular dynamics algorithm for a system of
nonspherical particles, within a parallelepiped simulation domain, under both
periodic or hard-wall boundary conditions. The algorithm extends previous
event-driven molecular dynamics algorithms for spheres. We present a novel
partial-update near-neighbor list (NNL) algorithm that is superior to previous
algorithms at high densities, without compromising the correctness of the
algorithm. This efficiency of the algorithm is further increased for systems of
very aspherical particles by using bounding sphere complexes (BSC). In the
second part of this series of papers we apply the algorithm presented in the
first part of this series of papers to systems of hard ellipses and ellipsoids.
The theoretical machinery needed to treat such particles, including the overlap
potentials, is developed in full detail. We describe an algorithm for
predicting the time of collision for two moving ellipses or ellipsoids. We
present performance results for our implementation of the algorithm. The
practical utility of the algorithm is demonstrated by presenting several
interesting physical applications, including the generation of jammed packings
inside spherical containers, the study of contact force chains in jammed
packings, and melting the densest-known equilibrium crystals of prolate
spheroids.
