Sure - if it's an actual boundary condition (like, it's applied on the boundary) then it's pretty straightforward to do with a parsed function and FunctionBC.
If it's a source in the interior of the domain then you have two options depending on what the source looks like:
1. For a point source make a custom DiracKernel. Every time the DiracKernel is applied you get to specify _where_ it's applied.
2. For a distributed source (like a gaussian that's going to span many elements) you could use a parsed function and UserForcingFunction... or you could write your own Kernel.
Derek