1import plate_modal from "../m/plate_modal.m?raw";
2import plate_fd from "../m/plate_fd.m?raw";
3import plate_fd_plan from "../m/plate_fd_plan.m?raw";
4import plate_setup from "../m/plate_setup.m?raw";
5import plate_force_time from "../m/plate_force_time.m?raw";
6import plate_force_footprint from "../m/plate_force_footprint.m?raw";
7import plate_stress from "../m/plate_stress.m?raw";
8import plate_sdof from "../m/plate_sdof.m?raw";
9import plate_listener from "../m/plate_listener.m?raw";
10import plate_spectrum from "../m/plate_spectrum.m?raw";
11import plate_pad from "../m/plate_pad.m?raw";
12import plate_laplacian from "../m/plate_laplacian.m?raw";
13import plate_curvature from "../m/plate_curvature.m?raw";
14import plate_compare from "../m/plate_compare.m?raw";
15import plate_implicit from "../m/plate_implicit.m?raw";
16import plate_implicit_plan from "../m/plate_implicit_plan.m?raw";
17import plate_matrices from "../m/plate_matrices.m?raw";
18import plate_rigid_modes from "../m/plate_rigid_modes.m?raw";
19import plate_curvature_free from "../m/plate_curvature_free.m?raw";
20import plate_result_schema from "../m/plate_result_schema.m?raw";
22export interface SourceFile {
23 name: string;
24 source: string;
25}
27export interface LibraryFile extends SourceFile {
28 /** One line for the code view's file list */
29 summary: string;
30}
32/** Every `.m` file the solvers can call. The runner ships all of them with each run. */
33export const LIBRARY_FILES: LibraryFile[] = [
34 {
35 name: "plate_modal.m",
36 source: plate_modal,
37 summary: "Modal superposition on a simply supported rectangle",
38 },
39 { name: "plate_fd.m", source: plate_fd, summary: "Explicit finite-difference time stepping" },
40 {
41 name: "plate_fd_plan.m",
42 source: plate_fd_plan,
43 summary: "Grid, stable time step and cost of the FD scheme",
44 },
45 {
46 name: "plate_implicit.m",
47 source: plate_implicit,
48 summary: "Implicit theta-scheme: sparse Cholesky once, two triangular solves per step",
49 },
50 {
51 name: "plate_implicit_plan.m",
52 source: plate_implicit_plan,
53 summary: "Grid, accuracy-chosen time step and size of the implicit scheme",
54 },
55 {
56 name: "plate_matrices.m",
57 source: plate_matrices,
58 summary: "Sparse mass, Laplacian and stiffness matrices for every edge condition",
59 },
60 {
61 name: "plate_rigid_modes.m",
62 source: plate_rigid_modes,
63 summary: "Rigid-body motions of a free plate and the projector that removes them",
64 },
65 {
66 name: "plate_setup.m",
67 source: plate_setup,
68 summary: "Bending stiffness and other derived constants",
69 },
70 {
71 name: "plate_force_time.m",
72 source: plate_force_time,
73 summary: "Force history F(t): hammer pulse or harmonic drive",
74 },
75 {
76 name: "plate_force_footprint.m",
77 source: plate_force_footprint,
78 summary: "Raised-cosine spatial footprint of the load",
79 },
80 {
81 name: "plate_stress.m",
82 source: plate_stress,
83 summary: "Surface stresses, von Mises and principal stress from curvatures",
84 },
85 {
86 name: "plate_sdof.m",
87 source: plate_sdof,
88 summary: "Exact step response of one damped oscillator",
89 },
90 {
91 name: "plate_listener.m",
92 source: plate_listener,
93 summary: "Rayleigh-integral weights and delays to the listener",
94 },
95 { name: "plate_spectrum.m", source: plate_spectrum, summary: "Windowed amplitude spectrum" },
96 {
97 name: "plate_pad.m",
98 source: plate_pad,
99 summary: "Ghost layer implementing the edge conditions",
100 },
101 { name: "plate_laplacian.m", source: plate_laplacian, summary: "Five-point Laplacian" },
102 {
103 name: "plate_curvature.m",
104 source: plate_curvature,
105 summary: "Second derivatives by central differences",
106 },
107 {
108 name: "plate_curvature_free.m",
109 source: plate_curvature_free,
110 summary: "Curvatures of a free plate, edges from the moment condition",
111 },
112 { name: "plate_compare.m", source: plate_compare, summary: "Error norms between two solutions" },
113 {
114 name: "plate_result_schema.m",
115 source: plate_result_schema,
116 summary: "Documentation of the result struct",
117 },
118];
120export function libraryFile(name: string): LibraryFile {
121 const f = LIBRARY_FILES.find((x) => x.name === name);
122 if (!f) throw new Error(`unknown library file ${name}`);
123 return f;
124}