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 is His slave and Messenger.
If a Muslim commits a sin that requires inflicting a corporal punishment determined by Islamic Law on him, like the punishment for committing fornication or adultery and the like, then it is not for the public to carry out this corporal punishment on him, as this will cause anarchy. It is only the Muslim ruler who may inflict this corporal punishment determined by Islamic Law.
If there is no Muslim ruler, or that there is a Muslim ruler but the corporal punishments determined by Islamic Law are not inflicted on the sinners, then, in this case, the sinner is only obliged to sincerely repent to Allaah. So this woman is obliged to sincerely repent and conceal her sin, and whoever knows about her should conceal her sin as well.
It is more appropriate for her husband to keep her as his wife if she had repented, and he should not feel any harm in keeping her as his wife. Indeed repentance wipes out the previous sins, and whoever repents, Allaah accepts his repentance as the Prophet informed us. However, her husband is not permitted to have sexual intercourse with her after she committed adultery unless he makes sure that she is not pregnant; this is either by her observing one menstruation or giving birth to the child if she is pregnant from adultery.
If it happens that she gives birth to a child from adultery, the child will be traced back to the husband as the Prophet said: "The boy is for the owner of the bed and the stone is for the person who commits an illegal sexual intercourse (i.e. the child will not be traced back to him)." [Al-Bukhari and Muslim]
The husband is obliged to protect his wife from any means that could lead her to commit adultery again, he should oblige her to wear Hijab and not allow her to go out except for a necessity.
As regards locking the door on her and her children, then this could be dangerous in case there is a fire or the like, so it might be more appropriate not to lock the door on her, but if he doubts that she has sincerely repented, then it is more appropriate for him to divorce her.
With regard to beating her if she is disobedient to him, then there is no harm provided he does not cause any scars or marks and provided that hitting her does not cause a greater harm. But it is not permissible for him to beat her for a sin from which she had repented from committing. However, he is permitted to prevent her from visiting his relatives especially if he fears any harm from them.
Allaah Knows best.