An algorithm for simulating self-gravitating cosmological astrophysica
l fluids is presented. The advantages include a large dynamic range, p
arallelizability, high resolution per grid element, and fast execution
speed. The code is based on a finite volume flux-conservative total v
ariation diminishing (TVD) scheme for the shock-capturing hydro and an
iterative multigrid solver for the gravity. The grid is a time-depend
ent field, whose motion is described by a generalized potential how. A
pproximately constant mass per cell can be obtained, which provides al
l the advantages of a Lagrangian scheme. The grid deformation combined
with appropriate limiting and smoothing schemes guarantees a regular
and well-behaved grid geometry, in which nearest neighbor relationship
s remain constant. The full hydrodynamic fluid equations are implement
ed in the curvilinear moving grid, which allows for arbitrary fluid fl
ow relative to the grid geometry. This combination retains all the adv
antages of the grid-based schemes including high speed per fluid eleme
nt and a rapid gravity solver. The current implementation is described
, and empirical simulation results are presented. Accurate execution s
peed calculations are given in terms of floating point operations per
time step per grid cell. This code is freely available to the communit
y.