  We perform three-dimensional simulations of homogeneous and inhomogeneous
cosmologies via the coupling of a numerical relativity code for spacetime
evolution and smoothed particle hydrodynamics (SPH) code. Evolution of a flat
dust and radiation dominated Friedmann-Lema\^itre-Roberston-Walker (FLRW)
spacetime shows an agreement of exact solutions with residuals on the order
$10^{-6}$ and $10^{-3}$ respectively, even at low grid resolutions. We
demonstrate evolution of linear perturbations of density, velocity and metric
quantities to the FLRW with residuals of only $10^{-2}$ compared to exact
solutions. Finally, we demonstrate the evolution of non-linear perturbations of
the metric past shell-crossing, such that dark matter halo formation is
possible. We show that numerical relativistic smoothed particle hydrodynamics
is a viable method for understanding non-linear effects in cosmology.
