Yes, this is easy to do. If you have an Expression called R (could be the residual and it could be something else), then define a DG function (piecewise constant) and assemble into a Vector. Add a weight for the inverse cell area.
DG = FunctionSpace(mesh, "DG", 0)
v = TestFunction(DG)
a = CellVolume(mesh)
r = assemble(R*v/a*dx).array()
r will then be an array with your indicators. To plot it, either create a DG Function with those values (by assembling right into the Vector of that Function), or create a MeshFunction with values given by the array r.