/ proof-of-concept / plate-dynamics-lab-2
Sign in
proof-of-concept / plate-dynamics-lab-2
plate-dynamics-lab-2 / packages / core / src / generate / library.ts
190 lines · 6.3 KBCodeBlameHistory
2004981Plate dynamics lab 2: a hammer on a hung plate by Rayleigh-Ritz and by Mindlin-Reissner finite elementsJeremy Magland 1import plate_setup from "../m/plate_setup.m?raw";
2import plate_hertz from "../m/plate_hertz.m?raw";
3import plate_gauss_legendre from "../m/plate_gauss_legendre.m?raw";
4import plate_damping from "../m/plate_damping.m?raw";
5import plate_radiation from "../m/plate_radiation.m?raw";
6import plate_modal_free from "../m/plate_modal_free.m?raw";
7import plate_synthesize from "../m/plate_synthesize.m?raw";
8import plate_stress from "../m/plate_stress.m?raw";
9import plate_spectrum from "../m/plate_spectrum.m?raw";
10import plate_plan_common from "../m/plate_plan_common.m?raw";
11import plate_rr_modes from "../m/plate_rr_modes.m?raw";
12import plate_rr_strike from "../m/plate_rr_strike.m?raw";
13import plate_rr_contact from "../m/plate_rr_contact.m?raw";
14import plate_rr_basis from "../m/plate_rr_basis.m?raw";
15import plate_rr_legendre from "../m/plate_rr_legendre.m?raw";
16import plate_rr_plan from "../m/plate_rr_plan.m?raw";
17import plate_fem_modes from "../m/plate_fem_modes.m?raw";
18import plate_fem_strike from "../m/plate_fem_strike.m?raw";
19import plate_fem_contact from "../m/plate_fem_contact.m?raw";
20import plate_fem_rhs from "../m/plate_fem_rhs.m?raw";
21import plate_fem_force from "../m/plate_fem_force.m?raw";
22import plate_fem_assemble from "../m/plate_fem_assemble.m?raw";
23import plate_fem_element from "../m/plate_fem_element.m?raw";
24import plate_fem_shape from "../m/plate_fem_shape.m?raw";
25import plate_fem_interp from "../m/plate_fem_interp.m?raw";
26import plate_fem_eigs from "../m/plate_fem_eigs.m?raw";
27import plate_fem_nodal from "../m/plate_fem_nodal.m?raw";
28import plate_fem_plan from "../m/plate_fem_plan.m?raw";
29import plate_result_schema from "../m/plate_result_schema.m?raw";
31export interface SourceFile {
32 name: string;
33 source: string;
36export interface LibraryFile extends SourceFile {
37 /** One line for the code view's file list */
38 summary: string;
41/** Every `.m` file the solvers can call. The runner ships all of them with each run. */
42export const LIBRARY_FILES: LibraryFile[] = [
43 {
44 name: "plate_rr_modes.m",
45 source: plate_rr_modes,
46 summary: "Rayleigh-Ritz: Kirchhoff-Love energy on a tensor-Legendre basis, dense eigensolve",
47 },
48 {
49 name: "plate_rr_strike.m",
50 source: plate_rr_strike,
51 summary: "Strike the Rayleigh-Ritz modes: basis at the strike point, damping, pulse, synthesis",
52 },
53 {
54 name: "plate_rr_contact.m",
55 source: plate_rr_contact,
56 summary: "The prescribed Hertz pulse and the modal states it leaves, by quadrature",
57 },
58 {
59 name: "plate_rr_basis.m",
60 source: plate_rr_basis,
61 summary: "The tensor-Legendre basis and its curvatures at points of the plate",
62 },
63 {
64 name: "plate_rr_legendre.m",
65 source: plate_rr_legendre,
66 summary: "Legendre polynomials and their derivatives by recurrence",
67 },
68 {
69 name: "plate_rr_plan.m",
70 source: plate_rr_plan,
71 summary: "Sizes and estimates of a Rayleigh-Ritz run, before it runs",
72 },
73 {
74 name: "plate_fem_modes.m",
75 source: plate_fem_modes,
76 summary: "Finite elements: assemble the Mindlin-Reissner mesh and solve for its lowest modes",
77 },
78 {
79 name: "plate_fem_strike.m",
80 source: plate_fem_strike,
81 summary: "Strike the finite-element modes: interpolation, damping, coupled contact, synthesis",
82 },
83 {
84 name: "plate_fem_contact.m",
85 source: plate_fem_contact,
86 summary: "The hammer and the plate as one system: Runge-Kutta integration to separation",
87 },
88 {
89 name: "plate_fem_rhs.m",
90 source: plate_fem_rhs,
91 summary: "Time derivative of the coupled hammer/plate state",
92 },
93 {
94 name: "plate_fem_force.m",
95 source: plate_fem_force,
96 summary: "The Hunt-Crossley contact force",
97 },
98 {
99 name: "plate_fem_assemble.m",
100 source: plate_fem_assemble,
101 summary: "Global sparse stiffness and mass of the mesh, with the thread's spring at the hole",
102 },
103 {
104 name: "plate_fem_element.m",
105 source: plate_fem_element,
106 summary: "Stiffness and mass of one Q4 Mindlin-Reissner element, 2 x 2 Gauss points",
107 },
108 {
109 name: "plate_fem_shape.m",
110 source: plate_fem_shape,
111 summary: "Bilinear shape functions of the four-node element",
112 },
113 {
114 name: "plate_fem_interp.m",
115 source: plate_fem_interp,
116 summary: "Which element holds a point, and its bilinear weights",
117 },
118 {
119 name: "plate_fem_eigs.m",
120 source: plate_fem_eigs,
121 summary: "Lowest eigenpairs of the sparse pencil by shift-invert subspace iteration",
122 },
123 {
124 name: "plate_fem_nodal.m",
125 source: plate_fem_nodal,
126 summary: "Element-centre values averaged to the nodes",
127 },
128 {
129 name: "plate_fem_plan.m",
130 source: plate_fem_plan,
131 summary: "Sizes and estimates of a finite-element run, before it runs",
132 },
133 {
134 name: "plate_setup.m",
135 source: plate_setup,
136 summary: "Derived constants: rigidity, the hole, the thread's spring, the cutoff",
137 },
138 {
139 name: "plate_hertz.m",
140 source: plate_hertz,
141 summary: "Hertz contact constants: effective modulus, stiffness, duration, impulse",
142 },
143 {
144 name: "plate_damping.m",
145 source: plate_damping,
146 summary: "Modal damping from the material, the air and the thread's dashpot",
147 },
148 {
149 name: "plate_radiation.m",
150 source: plate_radiation,
151 summary: "Pressure at the microphone per unit modal acceleration",
152 },
153 {
154 name: "plate_modal_free.m",
155 source: plate_modal_free,
156 summary: "Free decay of one mode after the contact ends",
157 },
158 {
159 name: "plate_synthesize.m",
160 source: plate_synthesize,
161 summary: "Sound, series, frames, stresses and spectra from the modes and the contact",
162 },
163 {
164 name: "plate_stress.m",
165 source: plate_stress,
166 summary: "Surface stresses, von Mises and principal stress from curvatures",
167 },
168 { name: "plate_spectrum.m", source: plate_spectrum, summary: "Windowed amplitude spectrum" },
169 {
170 name: "plate_gauss_legendre.m",
171 source: plate_gauss_legendre,
172 summary: "Gauss-Legendre nodes and weights by Golub-Welsch",
173 },
174 {
175 name: "plate_plan_common.m",
176 source: plate_plan_common,
177 summary: "The estimates both plans share: mass, pendulum, expected modes, Hertz",
178 },
179 {
180 name: "plate_result_schema.m",
181 source: plate_result_schema,
182 summary: "Documentation of the modes and result structs",
183 },
184];
186export function libraryFile(name: string): LibraryFile {
187 const f = LIBRARY_FILES.find((x) => x.name === name);
188 if (!f) throw new Error(`unknown library file ${name}`);
189 return f;
↑↓ move↵openescclose