Patterson scores ton against Sri Lanka