Smoothed particle hydrodynamics: theory and application to non-spherical stars | Synapse