import plate_setup from "../m/plate_setup.m?raw"; import plate_hertz from "../m/plate_hertz.m?raw"; import plate_gauss_legendre from "../m/plate_gauss_legendre.m?raw"; import plate_damping from "../m/plate_damping.m?raw"; import plate_radiation from "../m/plate_radiation.m?raw"; import plate_modal_free from "../m/plate_modal_free.m?raw"; import plate_synthesize from "../m/plate_synthesize.m?raw"; import plate_stress from "../m/plate_stress.m?raw"; import plate_spectrum from "../m/plate_spectrum.m?raw"; import plate_plan_common from "../m/plate_plan_common.m?raw"; import plate_rr_modes from "../m/plate_rr_modes.m?raw"; import plate_rr_strike from "../m/plate_rr_strike.m?raw"; import plate_rr_contact from "../m/plate_rr_contact.m?raw"; import plate_rr_basis from "../m/plate_rr_basis.m?raw"; import plate_rr_legendre from "../m/plate_rr_legendre.m?raw"; import plate_rr_plan from "../m/plate_rr_plan.m?raw"; import plate_fem_modes from "../m/plate_fem_modes.m?raw"; import plate_fem_strike from "../m/plate_fem_strike.m?raw"; import plate_fem_contact from "../m/plate_fem_contact.m?raw"; import plate_fem_rhs from "../m/plate_fem_rhs.m?raw"; import plate_fem_force from "../m/plate_fem_force.m?raw"; import plate_fem_assemble from "../m/plate_fem_assemble.m?raw"; import plate_fem_element from "../m/plate_fem_element.m?raw"; import plate_fem_shape from "../m/plate_fem_shape.m?raw"; import plate_fem_interp from "../m/plate_fem_interp.m?raw"; import plate_fem_eigs from "../m/plate_fem_eigs.m?raw"; import plate_fem_nodal from "../m/plate_fem_nodal.m?raw"; import plate_fem_plan from "../m/plate_fem_plan.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_rr_modes.m", source: plate_rr_modes, summary: "Rayleigh-Ritz: Kirchhoff-Love energy on a tensor-Legendre basis, dense eigensolve", }, { name: "plate_rr_strike.m", source: plate_rr_strike, summary: "Strike the Rayleigh-Ritz modes: basis at the strike point, damping, pulse, synthesis", }, { name: "plate_rr_contact.m", source: plate_rr_contact, summary: "The prescribed Hertz pulse and the modal states it leaves, by quadrature", }, { name: "plate_rr_basis.m", source: plate_rr_basis, summary: "The tensor-Legendre basis and its curvatures at points of the plate", }, { name: "plate_rr_legendre.m", source: plate_rr_legendre, summary: "Legendre polynomials and their derivatives by recurrence", }, { name: "plate_rr_plan.m", source: plate_rr_plan, summary: "Sizes and estimates of a Rayleigh-Ritz run, before it runs", }, { name: "plate_fem_modes.m", source: plate_fem_modes, summary: "Finite elements: assemble the Mindlin-Reissner mesh and solve for its lowest modes", }, { name: "plate_fem_strike.m", source: plate_fem_strike, summary: "Strike the finite-element modes: interpolation, damping, coupled contact, synthesis", }, { name: "plate_fem_contact.m", source: plate_fem_contact, summary: "The hammer and the plate as one system: Runge-Kutta integration to separation", }, { name: "plate_fem_rhs.m", source: plate_fem_rhs, summary: "Time derivative of the coupled hammer/plate state", }, { name: "plate_fem_force.m", source: plate_fem_force, summary: "The Hunt-Crossley contact force", }, { name: "plate_fem_assemble.m", source: plate_fem_assemble, summary: "Global sparse stiffness and mass of the mesh, with the thread's spring at the hole", }, { name: "plate_fem_element.m", source: plate_fem_element, summary: "Stiffness and mass of one Q4 Mindlin-Reissner element, 2 x 2 Gauss points", }, { name: "plate_fem_shape.m", source: plate_fem_shape, summary: "Bilinear shape functions of the four-node element", }, { name: "plate_fem_interp.m", source: plate_fem_interp, summary: "Which element holds a point, and its bilinear weights", }, { name: "plate_fem_eigs.m", source: plate_fem_eigs, summary: "Lowest eigenpairs of the sparse pencil by shift-invert subspace iteration", }, { name: "plate_fem_nodal.m", source: plate_fem_nodal, summary: "Element-centre values averaged to the nodes", }, { name: "plate_fem_plan.m", source: plate_fem_plan, summary: "Sizes and estimates of a finite-element run, before it runs", }, { name: "plate_setup.m", source: plate_setup, summary: "Derived constants: rigidity, the hole, the thread's spring, the cutoff", }, { name: "plate_hertz.m", source: plate_hertz, summary: "Hertz contact constants: effective modulus, stiffness, duration, impulse", }, { name: "plate_damping.m", source: plate_damping, summary: "Modal damping from the material, the air and the thread's dashpot", }, { name: "plate_radiation.m", source: plate_radiation, summary: "Pressure at the microphone per unit modal acceleration", }, { name: "plate_modal_free.m", source: plate_modal_free, summary: "Free decay of one mode after the contact ends", }, { name: "plate_synthesize.m", source: plate_synthesize, summary: "Sound, series, frames, stresses and spectra from the modes and the contact", }, { name: "plate_stress.m", source: plate_stress, summary: "Surface stresses, von Mises and principal stress from curvatures", }, { name: "plate_spectrum.m", source: plate_spectrum, summary: "Windowed amplitude spectrum" }, { name: "plate_gauss_legendre.m", source: plate_gauss_legendre, summary: "Gauss-Legendre nodes and weights by Golub-Welsch", }, { name: "plate_plan_common.m", source: plate_plan_common, summary: "The estimates both plans share: mass, pendulum, expected modes, Hertz", }, { name: "plate_result_schema.m", source: plate_result_schema, summary: "Documentation of the modes and result structs", }, ]; 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; }