Pregnant and having sex.

I am 27 weeks pregnant and it hurts to have sex and I swell afterwards. Has anyone else had this problem? I would like to have sex but it hurts so bad...