/ concept-collection / fastandaccurate
Sign in
concept-collection / fastandaccurate
fastandaccurate / src / solvers / index.ts
72 lines · 2.9 KBCodeBlameHistory
5127df5fastandaccurate: PDE solver benchmarks, laplace-dirichlet-2d with MFS and Nystrom DLP solversJeremy Magland 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 /** The resolution values a standard work-precision sweep runs. */
17 sweepN: number[];
20export const SOLVERS: SolverManifest[] = [
21 {
22 id: "mfs",
23 name: "Method of fundamental solutions",
24 description:
25 "Represents the solution as n logarithmic point charges on a curve " +
26 "a fixed distance 0.3 outside the boundary, with strengths found by " +
27 "collocation at n boundary points. Converges geometrically when the " +
28 "data continues harmonically past the charge curve; stagnates when " +
29 "it does not (the star-hard instance). Ill-conditioning caps the " +
30 "attainable accuracy near 1e-10 in exchange for very small n.",
31 version: "1.0.0",
32 backend: "cpu",
33 sweepN: [8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256],
34 },
35 {
36 id: "nystrom-dlp",
37 name: "Nystrom double-layer BIE",
38 description:
39 "Second-kind boundary integral equation for the double-layer " +
40 "density, discretized with the periodic trapezoid rule at n " +
41 "boundary nodes. Converges geometrically for any smooth data, at a " +
42 "rate set by how far the data continues analytically, so the hard " +
43 "instance costs more nodes rather than a lost method assumption.",
44 version: "1.0.0",
45 backend: "cpu",
46 sweepN: [16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768],
47 },
49 id: "chunkie-dlp",
50 name: "chunkie double-layer BIE",
51 description:
52 "The same second-kind double-layer formulation as nystrom-dlp, " +
53 "discretized by chunkie, a production MATLAB boundary-integral " +
54 "toolbox: n uniform 16th-order Gauss-Legendre panels, high-order " +
55 "singular quadrature in the assembly, a direct dense solve, and " +
56 "near-corrected evaluation of the potential. chunkie's default " +
57 "quadrature tolerances cap the attainable accuracy near 1e-11, and " +
58 "the timings include the cost of running a general-purpose library " +
59 "through numbl. The package is fetched by mip on first use, so the " +
60 "first run in a session spends tens of seconds downloading it; " +
61 "later runs do not.",
62 version: "1.0.0",
63 backend: "cpu",
64 sweepN: [2, 3, 4, 6, 8, 12, 16, 24, 32, 48],
65 },
68export function getSolver(id: string): SolverManifest {
69 const s = SOLVERS.find((x) => x.id === id);
70 if (!s) throw new Error(`Unknown solver: ${id}`);
71 return s;
moveopenescclose