Stripping reactions and elastic scattering of 12 MeV vector polarized deuterons on 9Be and 12C