Surface Integral of Function over Boundary of 3D mesh

Hi everyone,

Currently within my code, I am trying to calculate the surface integral of my solution (called T) over the upper circular surface of my 3D cylindrical mesh ( this surface element is currently represented by da(3)). Currently the surface integral that I wish to perform looks like this:

rad_power = assemble(T**2*V*da(3))
print(rad_power)

Where V is the test function from my function space. Currently if I run this code, I obtain:

<dolfin.cpp.la.Vector object at 0x7f4d624b5e50>

Which is a tensor object rather than the scalar value that I wanted (since T is also a tensor). My question is how can this be altered such that T is evaluated at every point on the upper surface in order to calculate the surface integral of this function?

Thank you in advance

Hello,

In my experience, I never use the test function. All what I do is expression_integral = assemble(expression*facets_subdomain), and it works.
So I recommand to try :

rad_power = assemble(T**2*da(3))