Hi Thomas,
since the normal is constant for every cell of your mesh you are correct that you should use eval_cell in the Expression, however, the correct function arguments in this case include a ufc_cell. You can use the ufc_cell to then evaluate the normal of the facet for the particular ufc_cell. Note, that the value for x doesn't matter in this case, since the normal is constant on the facet anyway:
class BoundarySource(Expression):
def __init__(self, mesh):
self.mesh = mesh
def eval_cell(self, values, x, ufc_cell):
cur_cell_normal = np.empty((3,), dtype=np.float)
n.eval_cell(cur_cell_normal, np.array([0.0, 0.0, 0.0]), ufc_cell)
a, b, c = 1.0, 1.0, 1.0
values[0] = a*cur_cell_normal[0] + b*cur_cell_normal[1] + c*cur_cell_normal[2]
Note, that you cannot evaluate this function by simply providing a coordinate. Instead you should always evaluate the function using eval_cell. This is automatically used when passing the Expression to interpolate or any other dolfin routine.