1function g = laplace2d_bdata(t, r, sx, sy, c)
2% LAPLACE2D_BDATA Dirichlet data for laplace-dirichlet-2d.
3% Evaluates u(x(t)) = sum_j c_j log|x(t) - s_j| at boundary parameters t,
4% given the boundary radius r = r(t) at those parameters (which family the
5% radius came from does not matter here). Called through the prob.g handle
6% built in build_problem; solvers see only that handle.
7x = r.*cos(t);
8y = r.*sin(t);
9g = zeros(size(t));
10for j = 1:numel(c)
11 g = g + c(j)*0.5*log((x - sx(j)).^2 + (y - sy(j)).^2);
12end
13end