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_model from "../m/plate_model.m?raw"; import plate_setup from "../m/plate_setup.m?raw"; import plate_domain from "../m/plate_domain.m?raw"; import plate_mount from "../m/plate_mount.m?raw"; import plate_bending from "../m/plate_bending.m?raw"; import plate_prestress from "../m/plate_prestress.m?raw"; import plate_static from "../m/plate_static.m?raw"; import plate_rigid_basis from "../m/plate_rigid_basis.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_listener from "../m/plate_listener.m?raw"; import plate_spectrum from "../m/plate_spectrum.m?raw"; import plate_curvature_free from "../m/plate_curvature_free.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 solver can call, in reading order. The runner ships all of them with each run. */ export const LIBRARY_FILES: LibraryFile[] = [ { 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: "Load, probe, listener, initial state and constants for the time loop", }, { name: "plate_fd_loop.m", source: plate_fd_loop, summary: "Explicit time stepping of rigid coordinates plus flexural field; 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: "Time step, cost, rigid-body frequencies and statics before a run", }, { name: "plate_model.m", source: plate_model, summary: "Operators, statics, rigid-body system and the stable time step", }, { name: "plate_setup.m", source: plate_setup, summary: "Bending stiffness and other derived constants", }, { 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_mount.m", source: plate_mount, summary: "Threads, pads, felts, vise or fingers as gravity direction, springs, contacts and constraints", }, { name: "plate_bending.m", source: plate_bending, summary: "Bending and Laplacian operators from the discrete energy; free edges natural, held nodes clamped", }, { name: "plate_prestress.m", source: plate_prestress, summary: "Plane-stress solve for the self-weight tension and the membrane operator it adds", }, { name: "plate_static.m", source: plate_static, summary: "Static equilibrium under gravity with one-sided contacts", }, { name: "plate_rigid_basis.m", source: plate_rigid_basis, summary: "Rigid-body coordinates about the mount's pivot and their mass-orthogonal projector", }, { name: "plate_force_time.m", source: plate_force_time, summary: "Force history F(t): hammer pulse, or nothing for a release", }, { 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_listener.m", source: plate_listener, summary: "Weights and delays to the listener: Rayleigh integral, baffled or the unbaffled estimate", }, { name: "plate_spectrum.m", source: plate_spectrum, summary: "Windowed amplitude spectrum" }, { name: "plate_curvature_free.m", source: plate_curvature_free, summary: "Curvatures of a rectangle, edges from the free-edge 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_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; }