This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

variational formulation involved normal vector

0 votes

I want to evaluate the following surface integral in fenics (as a part of variational formulation):
$$\int_{\partial V} \mathbf{T} : (\mathbf{u} \otimes \mathbf{n}) d S$$
where $\mathbf{u}$ is a vector field and $\mathbf{n}$ denotes the outward pointing normal vector on the boundary.

My sample code is:

n = FacetNormal(mesh)
L = inner(T, outer(u, n))*ds

Is this correct?

Thanks

asked Oct 2, 2015 by newuser FEniCS Novice (650 points)

1 Answer

+1 vote

Looks correct to me, assuming that the products in your notation are defined as usual. If u and T are given functions, don't forget to put this into assemble if you want to to compute the actual value. L is in your case only a symbolic representation of the integral.

answered Oct 3, 2015 by Christian Waluga FEniCS Expert (12,310 points)

Thanks for your answer. Can I evaluate the normal vector on a part of domain? I imagine something likes this:

n = FacetNormal(SubDomain)

Thanks.

I think you have to restrict ds to a marked subset of your boundary facets in this case. I have no way to try this atm, but maybe this leads you to the right solution.

...