1// The in-browser solvers shipped with the site. Each solver is a MATLAB
2// function file (solver.m) implementing the interface documented in
3// docs/problems/laplace-dirichlet-2d.md. A submitted solver adds a
4// directory here plus a manifest entry.
6export interface SolverManifest {
7 /** Short stable identifier used in results and URLs. */
8 id: string;
9 name: string;
10 /** One-paragraph description of the method for the problem page. */
11 description: string;
12 /** Semantic version of the solver code; bump on any change that could
13 * alter results. */
14 version: string;
15 backend: "cpu" | "gpu";
16 /** What executes the solver: "numbl" solvers run in the browser and in
17 * the CLI; "matlab" solvers run only in real MATLAB via the CLI. */
18 runtime: "numbl" | "matlab";
19 /** The resolution values a standard work-precision sweep runs. */
20 sweepN: number[];
21}
23export const SOLVERS: SolverManifest[] = [
24 {
25 id: "mfs",
26 name: "Method of fundamental solutions",
27 description:
28 "Represents the solution as n logarithmic point charges on a curve " +
29 "a fixed distance 0.3 outside the boundary, with strengths found by " +
30 "collocation at n boundary points. Converges geometrically when the " +
31 "data continues harmonically past the charge curve, reaching machine " +
32 "precision on the easier instances with far less work than the " +
33 "integral-equation methods. When the data's singularities sit inside " +
34 "that curve, as on star-hard, convergence is lost: more charges keep " +
35 "helping only until the system's ill-conditioning takes over, and the " +
36 "error settles near 1e-6 however far the sweep is pushed.",
37 version: "1.0.0",
38 backend: "cpu",
39 runtime: "numbl",
40 sweepN: [8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768],
41 },
42 {
43 id: "nystrom-dlp",
44 name: "Nystrom double-layer BIE",
45 description:
46 "Second-kind boundary integral equation for the double-layer " +
47 "density, discretized with the periodic trapezoid rule at n " +
48 "boundary nodes. Converges geometrically for any smooth data, at a " +
49 "rate set by how far the data continues analytically, so the hard " +
50 "instance costs more nodes rather than a lost method assumption.",
51 version: "1.0.0",
52 backend: "cpu",
53 runtime: "numbl",
54 sweepN: [16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768],
55 },
56 {
57 id: "chunkie-dlp",
58 name: "chunkie double-layer BIE",
59 description:
60 "The same second-kind double-layer formulation as nystrom-dlp, " +
61 "discretized by chunkie, a production MATLAB boundary-integral " +
62 "toolbox: n uniform 16th-order Gauss-Legendre panels, high-order " +
63 "singular quadrature in the assembly, a direct dense solve, and " +
64 "near-corrected evaluation of the potential. Runs in real MATLAB " +
65 "only: the command line invokes matlab -batch and fetches chunkie " +
66 "on first use, so its results appear here but cannot be rerun in " +
67 "the browser. chunkie's default quadrature tolerances cap the " +
68 "attainable accuracy near 1e-11.",
69 version: "2.0.0",
70 backend: "cpu",
71 runtime: "matlab",
72 sweepN: [2, 3, 4, 6, 8, 12, 16, 24, 32, 48],
73 },
74];
76export function getSolver(id: string): SolverManifest {
77 const s = SOLVERS.find((x) => x.id === id);
78 if (!s) throw new Error(`Unknown solver: ${id}`);
79 return s;
80}