% pde_helmholtz.m — A variable-coefficient surface Helmholtz problem. % % surfaceop handles general elliptic operators on surfaces of any genus. % Here we solve (Delta_Gamma + c(x)) u = f on a genus-1 stellarator, with % a spatially varying coefficient c. mip load --install flatironinstitute/flatironinstitute/surfacefun p = 16; nu = 8; nv = 24; dom = surfacemesh.stellarator(p + 1, nu, nv); % Operator: Laplacian plus a zeroth-order term c(x,y,z). pdo = []; pdo.lap = 1; pdo.c = @(x, y, z) 300*(1 - z); f = -1; L = surfaceop(dom, pdo, f); u = L.solve(); figure(1); plot(u), colorbar title('Variable-coefficient Helmholtz on a stellarator');