Solving complex-valued PDE

Dirichlet boundary conditions are imposed on each subspace :

bcs = [DirichletBC(V.sub(0), u0_re, boundary_markers, 1),
       DirichletBC(V.sub(1), u0_im, boundary_markers, 1)]

The Neumann conditions can be easily applied by dividing the integrals for real and imaginary parts.

g_re * v_re * ds(1) + g_im * v_im * ds(1)

PS: This is a based on a simple (yet, neat) trick of representing the complex space of test functions by v_re + i * 0 and 0 + i * v_im functions.

2 Likes