Smoothed particle hydrodynamics simulations of white dwarf collisions and close encounters