/ proof-of-concept / plate-dynamics-lab
Sign in
proof-of-concept / plate-dynamics-lab
plate-dynamics-lab / packages / core / src / generate / library.ts
147 lines · 4.9 KBCodeBlameHistory
2import plate_fd_plan from "../m/plate_fd_plan.m?raw";
3import plate_fd_setup from "../m/plate_fd_setup.m?raw";
4import plate_fd_loop from "../m/plate_fd_loop.m?raw";
5import plate_fd_output from "../m/plate_fd_output.m?raw";
6import plate_model from "../m/plate_model.m?raw";
7import plate_setup from "../m/plate_setup.m?raw";
8import plate_domain from "../m/plate_domain.m?raw";
9import plate_mount from "../m/plate_mount.m?raw";
10import plate_bending from "../m/plate_bending.m?raw";
11import plate_prestress from "../m/plate_prestress.m?raw";
12import plate_static from "../m/plate_static.m?raw";
13import plate_rigid_basis from "../m/plate_rigid_basis.m?raw";
14import plate_force_time from "../m/plate_force_time.m?raw";
15import plate_force_footprint from "../m/plate_force_footprint.m?raw";
16import plate_stress from "../m/plate_stress.m?raw";
17import plate_listener from "../m/plate_listener.m?raw";
18import plate_spectrum from "../m/plate_spectrum.m?raw";
19import plate_curvature_free from "../m/plate_curvature_free.m?raw";
20import plate_curvature_domain from "../m/plate_curvature_domain.m?raw";
21import plate_result_schema from "../m/plate_result_schema.m?raw";
23export interface SourceFile {
24 name: string;
25 source: string;
28export interface LibraryFile extends SourceFile {
29 /** One line for the code view's file list */
30 summary: string;
33/** Every `.m` file the solver can call, in reading order. The runner ships all of them with each run. */
34export const LIBRARY_FILES: LibraryFile[] = [
35 {
36 name: "plate_fd.m",
37 source: plate_fd,
38 summary: "Explicit finite differences: setup, time loop and output in turn",
39 },
40 {
41 name: "plate_fd_setup.m",
42 source: plate_fd_setup,
43 summary: "Load, probe, listener, initial state and constants for the time loop",
44 },
45 {
46 name: "plate_fd_loop.m",
47 source: plate_fd_loop,
48 summary:
49 "Explicit time stepping of rigid coordinates plus flexural field; the lab has a WebGPU port of this file",
50 },
51 {
52 name: "plate_fd_output.m",
53 source: plate_fd_output,
54 summary: "Stresses, audio, spectra and the result struct from the loop's record",
55 },
56 {
57 name: "plate_fd_plan.m",
58 source: plate_fd_plan,
59 summary: "Time step, cost, rigid-body frequencies and statics before a run",
60 },
61 {
62 name: "plate_model.m",
63 source: plate_model,
64 summary: "Operators, statics, rigid-body system and the stable time step",
65 },
66 {
67 name: "plate_setup.m",
68 source: plate_setup,
69 summary: "Bending stiffness and other derived constants",
70 },
71 {
72 name: "plate_domain.m",
73 source: plate_domain,
74 summary:
75 "The plate's footprint on the grid: every node for a rectangle, a staircase for an ellipse",
76 },
77 {
78 name: "plate_mount.m",
79 source: plate_mount,
80 summary:
81 "Threads, pads, felts, vise or fingers as gravity direction, springs, contacts and constraints",
82 },
83 {
84 name: "plate_bending.m",
85 source: plate_bending,
86 summary:
87 "Bending and Laplacian operators from the discrete energy; free edges natural, held nodes clamped",
88 },
89 {
90 name: "plate_prestress.m",
91 source: plate_prestress,
92 summary: "Plane-stress solve for the self-weight tension and the membrane operator it adds",
93 },
94 {
95 name: "plate_static.m",
96 source: plate_static,
97 summary: "Static equilibrium under gravity with one-sided contacts",
98 },
99 {
100 name: "plate_rigid_basis.m",
101 source: plate_rigid_basis,
102 summary: "Rigid-body coordinates about the mount's pivot and their mass-orthogonal projector",
103 },
104 {
105 name: "plate_force_time.m",
106 source: plate_force_time,
107 summary: "Force history F(t): hammer pulse, or nothing for a release",
108 },
109 {
110 name: "plate_force_footprint.m",
111 source: plate_force_footprint,
112 summary: "Raised-cosine spatial footprint of the load, restricted to the plate's nodes",
113 },
114 {
115 name: "plate_stress.m",
116 source: plate_stress,
117 summary: "Surface stresses, von Mises and principal stress from curvatures",
118 },
119 {
120 name: "plate_listener.m",
121 source: plate_listener,
122 summary:
123 "Weights and delays to the listener: Rayleigh integral, baffled or the unbaffled estimate",
124 },
125 { name: "plate_spectrum.m", source: plate_spectrum, summary: "Windowed amplitude spectrum" },
126 {
127 name: "plate_curvature_free.m",
128 source: plate_curvature_free,
129 summary: "Curvatures of a rectangle, edges from the free-edge moment condition",
130 },
131 {
132 name: "plate_curvature_domain.m",
133 source: plate_curvature_domain,
134 summary: "Curvatures on an ellipse: central differences inside, copied along the staircase",
135 },
136 {
137 name: "plate_result_schema.m",
138 source: plate_result_schema,
139 summary: "Documentation of the result struct",
140 },
141];
143export function libraryFile(name: string): LibraryFile {
144 const f = LIBRARY_FILES.find((x) => x.name === name);
145 if (!f) throw new Error(`unknown library file ${name}`);
146 return f;
↑↓ move↵openescclose