Physics of collisionless shocks: theory and simulation