ED (erectile dysfunction)can be caused by many factors including physical or psychological issues. For a professional diagnosis, I would suggest that you start with your family doctor and progress from there.
For a lot of the WS community, its not uncommon to have a mental block, or trigger that is creating ED due to guilt or shame. Given that you are in the midst of a emotional upheaval in your personal life, he may suggest seeing a therapist to address the psychological issues that you maybe experiencing. This may require some form of counselling so you relax and approach lovemaking without the triggers. For some people, the key is not to focus on the physical act itself but rather relax into the emotional intimacy of the act. Relax and the body should follow its natural instinct.
After raising the issue with your family doctor, he may or may not suggest seeing a urologist who specializes in reproductive organ issues if its felt that physical issues maybe contributing to ED. It should be noted that continuing issues with erectile dysfunction can have severe psychological consequences as it can contribute to further relationship difficulties as you retreat from a uncomfortable sex life due to ED. This of course, creates a downward spiral.
As I said, the first step should be bringing this up with your family doctor. Yes, it maybe uncomfortable to open up but since ED is treatable, this is where you need to start. Good luck.