When stimulated by the nerves, the spongy tissue arranges itself in such a way that more blood can be stored in the penis. The veins running through the outer sheath of the penis then compress which stops the blood from leaving the penis. As the blood is stopped from flowing out, the penis fills with blood and stretches within the outer casing, giving an erection.
A physical exam checks your total health. Examination focusing on your genitals (penis and testicles) is often done to check for ED. Based on your age and risk factors, the exam may also focus on your heart and blood system: heart, peripheral pulses and blood pressure. Based on your age and family history your doctor may do a rectal exam to check the prostate. These tests are not painful. Most patients do not need a lot of testing before starting treatment.