I plan to abandon my own 2D FEM-solver and switch to FEniCS. However, the boundary conditions of the problem I intend to solve are beyond simple Dirichlet or Neumann, and hence I need to know for sure that it is possible in FEniCS. It is a mixed boundary condition in a sense that it relates the normal derivative on a point of the boundary to the values over all of that boundary.
For a unit box $(x, y) \in [0, 1] \times [0, 1]$ for example, this would be a boundary condition:
$$ \frac{\partial}{\partial x} u(0, y) = f(y) \int_0^1 f(y') u(0, y') y' dy'$$
Where f is a known function. Would this be difficult to achieve?
As a bonus: the actual boundary condition would be more like
$$ \frac{\partial}{\partial x} u(0, y) = \sum_i j f_i(y) \int_0^1 f_i^*(y') u(0, y') y' dy'$$
with j the imaginary unit. I see possible profit / problems in the following:
- Both f and u are complex-valued functions. I read there is no support for this yet, so I would have to write it as two coupled PDE's, both for the real and imaginary part, with corresponding BC's?
- The $f_i$ are itself a solution of a 1D boundary valued eigenproblem on $x = 0$. Is it possible to inherit this 1D mesh from the 2D one, and to use solutions $f_i$ from this 1D problem?
Any thoughts would be very welcome. Note that had a look in the FEniCS book to get familiar with the software, but I haven't found much related problems.
Thanks,
Maarten