I also think it is extremely speculative that David didn't know she was Uriah's wife.
I tried envisioning the situation and here is what I came up with.
1. David had already been in bed for the night and couldn't sleep so he went up to the roof to meditate. It is supposedly dark by now.
2. Bath-sheba supposed she was safe from prying eyes bathing in her home or perhaps in a courtyard.
3. They had no electric lights and no streetlights. David could see the alluring form of a beautiful woman, perhaps disrobing and bathing, but was unable to identify her in the dim light of an oil lamp from a distance.
4. David inquired of a servant, "Who is the woman that lives in the third house from the end of the next street over?"
5. The servant advises David that she is a married woman and he sends for her anyway. David's bad.
6 Bath-sheba came to him willingly, not of necessity. A king of Israel did not have the authority to demand a woman's favors. Her bad.
7. There is not one iota of Biblical evidence indicating, much less proving that David's men provided their wives a "get" before war. Such, if it were done would only be effective if the husband were unaccounted for.
8. David had just participated in a major war, destroying the allies of the Ammonites and quite likely the remaining clean up was not worthy of David's participation.
Just thinking.