import plate_modal from "../m/plate_modal.m?raw"; import plate_fd from "../m/plate_fd.m?raw"; import plate_fd_plan from "../m/plate_fd_plan.m?raw"; import plate_fd_setup from "../m/plate_fd_setup.m?raw"; import plate_fd_loop from "../m/plate_fd_loop.m?raw"; import plate_fd_output from "../m/plate_fd_output.m?raw"; import plate_setup from "../m/plate_setup.m?raw"; import plate_force_time from "../m/plate_force_time.m?raw"; import plate_force_footprint from "../m/plate_force_footprint.m?raw"; import plate_stress from "../m/plate_stress.m?raw"; import plate_sdof from "../m/plate_sdof.m?raw"; import plate_listener from "../m/plate_listener.m?raw"; import plate_spectrum from "../m/plate_spectrum.m?raw"; import plate_pad from "../m/plate_pad.m?raw"; import plate_laplacian from "../m/plate_laplacian.m?raw"; import plate_curvature from "../m/plate_curvature.m?raw"; import plate_compare from "../m/plate_compare.m?raw"; import plate_implicit from "../m/plate_implicit.m?raw"; import plate_implicit_plan from "../m/plate_implicit_plan.m?raw"; import plate_matrices from "../m/plate_matrices.m?raw"; import plate_rigid_modes from "../m/plate_rigid_modes.m?raw"; import plate_curvature_free from "../m/plate_curvature_free.m?raw"; import plate_domain from "../m/plate_domain.m?raw"; import plate_curvature_domain from "../m/plate_curvature_domain.m?raw"; import plate_result_schema from "../m/plate_result_schema.m?raw"; export interface SourceFile { name: string; source: string; } export interface LibraryFile extends SourceFile { /** One line for the code view's file list */ summary: string; } /** Every `.m` file the solvers can call. The runner ships all of them with each run. */ export const LIBRARY_FILES: LibraryFile[] = [ { name: "plate_modal.m", source: plate_modal, summary: "Modal superposition on a simply supported rectangle", }, { name: "plate_fd.m", source: plate_fd, summary: "Explicit finite differences: setup, time loop and output in turn", }, { name: "plate_fd_setup.m", source: plate_fd_setup, summary: "Grid, step, load, probe, listener and operators for the explicit loop", }, { name: "plate_fd_loop.m", source: plate_fd_loop, summary: "Explicit time stepping; the lab has a WebGPU port of this file", }, { name: "plate_fd_output.m", source: plate_fd_output, summary: "Stresses, audio, spectra and the result struct from the loop's record", }, { name: "plate_fd_plan.m", source: plate_fd_plan, summary: "Grid, stable time step and cost of the FD scheme", }, { name: "plate_implicit.m", source: plate_implicit, summary: "Implicit theta-scheme: sparse Cholesky once, two triangular solves per step", }, { name: "plate_implicit_plan.m", source: plate_implicit_plan, summary: "Grid, accuracy-chosen time step and size of the implicit scheme", }, { name: "plate_domain.m", source: plate_domain, summary: "The plate's footprint on the grid: every node for a rectangle, a staircase for an ellipse", }, { name: "plate_matrices.m", source: plate_matrices, summary: "Sparse mass, Laplacian and stiffness matrices for every edge condition and shape", }, { name: "plate_rigid_modes.m", source: plate_rigid_modes, summary: "Rigid-body motions of a free plate and the projector that removes them", }, { name: "plate_setup.m", source: plate_setup, summary: "Bending stiffness and other derived constants", }, { name: "plate_force_time.m", source: plate_force_time, summary: "Force history F(t): hammer pulse or harmonic drive", }, { name: "plate_force_footprint.m", source: plate_force_footprint, summary: "Raised-cosine spatial footprint of the load, restricted to the plate's nodes", }, { name: "plate_stress.m", source: plate_stress, summary: "Surface stresses, von Mises and principal stress from curvatures", }, { name: "plate_sdof.m", source: plate_sdof, summary: "Exact step response of one damped oscillator", }, { name: "plate_listener.m", source: plate_listener, summary: "Rayleigh-integral weights and delays to the listener", }, { name: "plate_spectrum.m", source: plate_spectrum, summary: "Windowed amplitude spectrum" }, { name: "plate_pad.m", source: plate_pad, summary: "Ghost layer implementing the edge conditions", }, { name: "plate_laplacian.m", source: plate_laplacian, summary: "Five-point Laplacian" }, { name: "plate_curvature.m", source: plate_curvature, summary: "Second derivatives by central differences", }, { name: "plate_curvature_free.m", source: plate_curvature_free, summary: "Curvatures of a free rectangle, edges from the moment condition", }, { name: "plate_curvature_domain.m", source: plate_curvature_domain, summary: "Curvatures on an ellipse: central differences inside, copied along the staircase", }, { name: "plate_compare.m", source: plate_compare, summary: "Error norms between two solutions" }, { name: "plate_result_schema.m", source: plate_result_schema, summary: "Documentation of the result struct", }, ]; export function libraryFile(name: string): LibraryFile { const f = LIBRARY_FILES.find((x) => x.name === name); if (!f) throw new Error(`unknown library file ${name}`); return f; }