% Example 8: Laplace Neumann BVP on a starfish domain via single-layer % representation, with the W (onesmat) regularization added so that the % second-kind integral equation is invertible. mip load --install magland/magland/chunkie; tic; % chunker discretization of a starfish domain chnkr = chunkerfunc(@(t) starfish(t)); % boundary condition. by symmetry of the starfish this integrates to zero pwfun = @(r) r(1,:).^2.*r(2,:); rhs = pwfun(chnkr.r); rhs = rhs(:); % kernel: normal derivative of the Laplace single-layer kernsp = kernel('lap','sprime'); % matrix discretization of the BIE sysmat = chunkermat(chnkr,kernsp); sysmat = sysmat + 0.5*eye(chnkr.npt) + onesmat(chnkr); % solve sigma = gmres(sysmat,rhs); % grid for plotting x1 = linspace(-2,2,300); [xx,yy] = meshgrid(x1,x1); targs = [xx(:).'; yy(:).']; in = chunkerinterior(chnkr,targs); uu = nan(size(xx)); % evaluate solution using the single layer (not its derivative) kerns = kernel('lap','s'); uu(in) = chunkerkerneval(chnkr,kerns,sigma,targs(:,in)); toc; figure(1); clf h = pcolor(xx,yy,uu); set(h,'EdgeColor','none'); colorbar hold on; plot(chnkr,'k'); colormap(redblue)