Hi all,
I need to solve the Laplace/Poisson equation on some custom mesh omega (generated by gmsh) where in some of my DirichletBCs the normal vector is used. See:
V = VectorFunctionSpace(omega, "Lagrange", 1)
w = TrialFunction(V)
v = TestFunction(V)
n = FacetNormal(omega)
#not working:
#n = project(n,V)
#n = interpolate(n,V)
f = Constant((0.0, 0.0))
bc1 = DirichletBC(V, zero_v, boundaries, 2)
bc2 = DirichletBC(V, zero_v, boundaries, 3)
bc3 = DirichletBC(V, zero_v, boundaries, 4)
bc4 = DirichletBC(V, zero_v, boundaries, 5)
bc5 = DirichletBC(V, n, boundaries, 6)
bc6 = DirichletBC(V, n, boundaries, 7)
bc7 = DirichletBC(V, zero_v, boundaries, 8)
bcs = [bc1, bc2, bc3, bc4, bc5, bc6, bc7]
a = inner(grad(w), grad(v))*dx
L = inner(f,v)*dx
w = Function(V)
solve(a == L, w, bcs)
However, using
n = FacetNormal(omega)
doesn't work, as I know by searching around that there is no eval - Routine for the FacetNormal.
These boundary conditions however are criticial to my project, so I need to have atleast some workaround, maybe calculating the FacetNormal manually so that I can use them in my DirichletBC, but I don't have an idea how to do this or adding some evalute-routine manually, but I don't know where to start with the latter (already seen: https://fenicsproject.org/qa/11723/boundary-condition-that-depends-on-facet-normal )
Any ideas?