% fun_integral_norm.m — Integrals, means and norms of a surfacefun. % % These reductions integrate over the surface using the on-surface % measure. No plot here — just printed quantities. mip load --install flatironinstitute/flatironinstitute/surfacefun p = 16; nref = 2; dom = surfacemesh.sphere(p + 1, nref); f = surfacefun(@(x, y, z) cos(6*x) .* y + exp(z), dom); fprintf('integral(f) = %.6f\n', integral(f)); % definite integral over the surface fprintf('mean(f) = %.6f\n', mean(f)); % integral / surface area fprintf('L2 norm = %.6f\n', norm(f)); % sqrt(integral of f^2) fprintf('Linf norm = %.6f\n', norm(f, inf)); % max |f|