RT = FunctionSpace(mesh, 'RT', q)
bc = DirichletBC(RT, g, ...)
is to be applied (algebraically) to facet DOFs by evaluating g at those DOFs. (In fact something like g.restrict(..., RT.element(), cell, ...) is used to do this where cell is adjacent to respective facet.)