All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
If your situation is as you have related, then you have the right to claim divorce; for having children is a great blessing, and losing this right is harm that is afflicted on the spouse and a valid reason under Sharee`ah for demanding divorce. Moreover, the prophetic narrations that condemn wives who demand divorce are for those wives who demand divorce for no valid reason under Sharee`ah, i.e. wives who are not subjected to any harm if they maintained their matrimonial life. Ibn ‘Abaas reported that the Prophet, sallallaahu ‘alayhi wa sallam, said: “Any woman who asks her husband for a divorce for no reason, the fragrance of Paradise will be forbidden for her.” [Ibn Maajah]
Imaam As-Sindi elaborated in his commentary on Sunan Ibn Maajah: “The narration refers to wives who demand divorce without any valid excuse or reason; without being subjected to any harm that entails them to seek divorce.”
Undeniably, in your case, dear questioner, deprivation of the right to be a mother is a harm that justifies demanding divorce. However, we would like to advise you not to rush seeking divorce. Supplicate to Allaah The Exalted and seek forgiveness. Indeed, Allaah The Almighty Is Capable of Endowing you with children just like He Blessed Prophet Ibraaheem (Abraham), may Allaah Exalt his mention, and his wife with children although he had reached infirm old age.
Allaah Knows best.