I am looking to define a Robin boundary condition for the (screened) Poisson equation:
$$
-\Delta u + \kappa^2u = f \text{ in } \Omega
$$$$
\beta u + \frac{\partial u}{\partial n} = 0 \text{ in } \partial \Omega,
$$
where $\beta$ is a function defined on the boundary. For my given mesh, I know the values
of $\beta$ at the nodes. Can I define the Robin BC directly, without interpolating $\beta$? If not, any reference to documentation interpolation on the boundary will be most helpful.
In the code I'm using, I just use $\beta \equiv 1$. This is a (slight) modification of a piece of code written by John Burkardt.
from dolfin import *
import numpy as np
m = n = 500
kappa = 0.3
# I want to use these betas that I retrieve from memory.
# the size of betas is exactly the size of the boundary.
betas = np.load("data/" + filename + ".npy")
# But now I just use this constant beta
beta = 1.0
mesh = UnitSquareMesh( m, n )
V = FunctionSpace ( mesh, "CG", 1 )
u = TrialFunction ( V )
v = TestFunction ( V )
# Define the bilinear form, the left hand side of the FEM system.
AUV = inner ( grad ( u ), grad ( v ) ) * dx + kappa*kappa*u*v*dx + beta*u*v*ds
# Define the linear form, the right hand side. Later we add point sources.
LV = Constant ( 0.0 ) * v * dx
# Assemble the system matrix and right hand side vector,
A, B = assemble_system ( AUV , LV )
# Modify the right hand side vector to account for point source(s)
delta = PointSource ( V, Point ( 0.05, 0.5 ), 10.0 )
delta.apply ( B )
# Solve the linear system for u.
u = Function ( V )
solve ( A, u.vector(), B )