How to evaluate variational formulation

You need to assemble the residual. Anything written with dot, grad, inner, div, dx etc are objects from the Unified form language (ufl). To obtain numerical values, such objects has to be assembled. To assemble a residual with boundary conditions, see for instance: Residual for Stokes equation not equal to zero - #3 by nate