Unit tangent vector in Gridap.jl

Hi. I am trying to solve two-dimensional Stokes-Darcy equations using Gridap.jl. One of the terms in a weak formulation has the form {\int_{I}\lambda\left(u\cdot\tau\right)\left(v\cdot\tau\right)ds} where \tau is a unit tangent vector to the interface I between two subdomains.
Is there a way to specify a unit tangent vector in Gridap.jl? Specifically, I am looking for a function similar to get_normal_vector.

Can’t you use \int \lambda (u \times n) \cdot (v \times n) \, ds instead, where n is a unit normal?

@stevengj Thank you for your reply. However I am solving a two-dimensional problem so I cannot use the cross product.

I believe that Gridap defines the cross product of 2d vectors as just a scalar corresponding to the “z” component, which is exactly what you want here (u \times n is then equivalent to (u \times n) \cdot e_3 = u \cdot (n \times e_3) = u \cdot \tau).

The cross product also gives you a way to get a tangent vector if you want it — given a 2d normal vector n = (n_1, n_2), a tangent vector is \tau = n \times e_3 = (n_2, -n_1). But it doesn’t seem like you actually need to construct this explicitly.

4 Likes